From 3cf8621541b81ec654d5af9bde8297be1916c5fc Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Tue, 18 Nov 2025 11:02:39 +0000 Subject: test: nostr git url with path add additional test to cover this scenario --- src/lib/git/nostr_url.rs | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'src/lib') 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 @@ -1032,6 +1032,31 @@ mod tests { Ok(()) } + #[test] + fn relay_hint_has_path() -> Result<()> { + assert_eq!( + format!("{}", NostrUrlDecoded { + original_string: String::new(), + coordinate: Nip19Coordinate { + coordinate: Coordinate { + identifier: "ngit".to_string(), + public_key: PublicKey::parse( + "npub15qydau2hjma6ngxkl2cyar74wzyjshvl65za5k5rl69264ar2exs5cyejr", + ) + .unwrap(), + kind: nostr_sdk::Kind::GitRepoAnnouncement, + }, + relays: vec![RelayUrl::parse("wss://nos.lol/outbox").unwrap()], + }, + protocol: None, + ssh_key_file: None, + nip05: None, + }), + "nostr://npub15qydau2hjma6ngxkl2cyar74wzyjshvl65za5k5rl69264ar2exs5cyejr/nos.lol%2Foutbox/ngit", + ); + Ok(()) + } + #[test] fn with_protocol() -> Result<()> { assert_eq!( -- cgit v1.2.3