diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2025-11-18 11:02:39 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2025-11-18 11:02:39 +0000 |
| commit | 3cf8621541b81ec654d5af9bde8297be1916c5fc (patch) | |
| tree | e25f21076f68365a0d38db479ee148f9acb9aaf4 /src/lib/git/nostr_url.rs | |
| parent | 689500f5f8978d29e535d8c33932ca69dcd43553 (diff) | |
test: nostr git url with path
add additional test to cover this scenario
Diffstat (limited to 'src/lib/git/nostr_url.rs')
| -rw-r--r-- | src/lib/git/nostr_url.rs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/lib/git/nostr_url.rs b/src/lib/git/nostr_url.rs index 23c98e7..c26c56a 100644 --- a/src/lib/git/nostr_url.rs +++ b/src/lib/git/nostr_url.rs | |||
| @@ -1033,6 +1033,31 @@ mod tests { | |||
| 1033 | } | 1033 | } |
| 1034 | 1034 | ||
| 1035 | #[test] | 1035 | #[test] |
| 1036 | fn relay_hint_has_path() -> Result<()> { | ||
| 1037 | assert_eq!( | ||
| 1038 | format!("{}", NostrUrlDecoded { | ||
| 1039 | original_string: String::new(), | ||
| 1040 | coordinate: Nip19Coordinate { | ||
| 1041 | coordinate: Coordinate { | ||
| 1042 | identifier: "ngit".to_string(), | ||
| 1043 | public_key: PublicKey::parse( | ||
| 1044 | "npub15qydau2hjma6ngxkl2cyar74wzyjshvl65za5k5rl69264ar2exs5cyejr", | ||
| 1045 | ) | ||
| 1046 | .unwrap(), | ||
| 1047 | kind: nostr_sdk::Kind::GitRepoAnnouncement, | ||
| 1048 | }, | ||
| 1049 | relays: vec![RelayUrl::parse("wss://nos.lol/outbox").unwrap()], | ||
| 1050 | }, | ||
| 1051 | protocol: None, | ||
| 1052 | ssh_key_file: None, | ||
| 1053 | nip05: None, | ||
| 1054 | }), | ||
| 1055 | "nostr://npub15qydau2hjma6ngxkl2cyar74wzyjshvl65za5k5rl69264ar2exs5cyejr/nos.lol%2Foutbox/ngit", | ||
| 1056 | ); | ||
| 1057 | Ok(()) | ||
| 1058 | } | ||
| 1059 | |||
| 1060 | #[test] | ||
| 1036 | fn with_protocol() -> Result<()> { | 1061 | fn with_protocol() -> Result<()> { |
| 1037 | assert_eq!( | 1062 | assert_eq!( |
| 1038 | format!("{}", NostrUrlDecoded { | 1063 | format!("{}", NostrUrlDecoded { |