upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--flake.lock12
-rw-r--r--src/lib/client.rs3
-rw-r--r--src/lib/git/mod.rs7
-rw-r--r--src/lib/git/nostr_url.rs8
-rw-r--r--src/lib/login/fresh.rs8
-rw-r--r--test_utils/src/lib.rs10
-rw-r--r--test_utils/src/relay.rs2
-rw-r--r--tests/git_remote_nostr/list.rs23
-rw-r--r--tests/git_remote_nostr/push.rs12
-rw-r--r--tests/ngit_list.rs12
-rw-r--r--tests/ngit_login.rs18
-rw-r--r--tests/ngit_send.rs3
12 files changed, 53 insertions, 65 deletions
diff --git a/flake.lock b/flake.lock
index b89753c..6b8a5ab 100644
--- a/flake.lock
+++ b/flake.lock
@@ -20,11 +20,11 @@
20 }, 20 },
21 "nixpkgs": { 21 "nixpkgs": {
22 "locked": { 22 "locked": {
23 "lastModified": 1746141548, 23 "lastModified": 1752480373,
24 "narHash": "sha256-IgBWhX7A2oJmZFIrpRuMnw5RAufVnfvOgHWgIdds+hc=", 24 "narHash": "sha256-JHQbm+OcGp32wAsXTE/FLYGNpb+4GLi5oTvCxwSoBOA=",
25 "owner": "NixOS", 25 "owner": "NixOS",
26 "repo": "nixpkgs", 26 "repo": "nixpkgs",
27 "rev": "f02fddb8acef29a8b32f10a335d44828d7825b78", 27 "rev": "62e0f05ede1da0d54515d4ea8ce9c733f12d9f08",
28 "type": "github" 28 "type": "github"
29 }, 29 },
30 "original": { 30 "original": {
@@ -62,11 +62,11 @@
62 "nixpkgs": "nixpkgs_2" 62 "nixpkgs": "nixpkgs_2"
63 }, 63 },
64 "locked": { 64 "locked": {
65 "lastModified": 1746153335, 65 "lastModified": 1752633862,
66 "narHash": "sha256-vwKelhJJS8haCdH3t8uf96VFao7/YzJahPG5JLTO1PU=", 66 "narHash": "sha256-Bj7ozT1+5P7NmvDcuAXJvj56txcXuAhk3Vd9FdWFQzk=",
67 "owner": "oxalica", 67 "owner": "oxalica",
68 "repo": "rust-overlay", 68 "repo": "rust-overlay",
69 "rev": "ebc7823c3ffde594c7733113042b72694d996de9", 69 "rev": "8668ca94858206ac3db0860a9dec471de0d995f8",
70 "type": "github" 70 "type": "github"
71 }, 71 },
72 "original": { 72 "original": {
diff --git a/src/lib/client.rs b/src/lib/client.rs
index 445bf77..16cfe30 100644
--- a/src/lib/client.rs
+++ b/src/lib/client.rs
@@ -794,8 +794,7 @@ pub async fn sign_event(
794 if signer.backend() == SignerBackend::NostrConnect { 794 if signer.backend() == SignerBackend::NostrConnect {
795 let term = console::Term::stderr(); 795 let term = console::Term::stderr();
796 term.write_line(&format!( 796 term.write_line(&format!(
797 "signing event ({}) with remote signer...", 797 "signing event ({description}) with remote signer..."
798 description
799 ))?; 798 ))?;
800 let event = signer 799 let event = signer
801 .sign_event(event_builder.build(signer.get_public_key().await?)) 800 .sign_event(event_builder.build(signer.get_public_key().await?))
diff --git a/src/lib/git/mod.rs b/src/lib/git/mod.rs
index 5bdb30a..464990b 100644
--- a/src/lib/git/mod.rs
+++ b/src/lib/git/mod.rs
@@ -888,7 +888,7 @@ pub fn save_git_config_item(git_repo: &Option<&Repo>, item: &str, value: &str) -
888 git2::Config::open_default()? 888 git2::Config::open_default()?
889 .open_global()? 889 .open_global()?
890 .set_str(item, value) 890 .set_str(item, value)
891 .context(format!("failed to set global git config item {}", item)) 891 .context(format!("failed to set global git config item {item}"))
892 } 892 }
893} 893}
894 894
@@ -901,10 +901,7 @@ pub fn remove_git_config_item(git_repo: &Option<&Repo>, item: &str) -> Result<bo
901 git2::Config::open_default()? 901 git2::Config::open_default()?
902 .open_global()? 902 .open_global()?
903 .remove(item) 903 .remove(item)
904 .context(format!( 904 .context(format!("failed to remove existing git config item {item}"))?;
905 "failed to remove existing git config item {}",
906 item
907 ))?;
908 Ok(true) 905 Ok(true)
909 } 906 }
910} 907}
diff --git a/src/lib/git/nostr_url.rs b/src/lib/git/nostr_url.rs
index a9b08eb..e9b482f 100644
--- a/src/lib/git/nostr_url.rs
+++ b/src/lib/git/nostr_url.rs
@@ -71,13 +71,13 @@ impl fmt::Display for NostrUrlDecoded {
71 } 71 }
72 write!(f, "nostr://")?; 72 write!(f, "nostr://")?;
73 if let Some(user) = &self.user { 73 if let Some(user) = &self.user {
74 write!(f, "{}@", user)?; 74 write!(f, "{user}@")?;
75 } 75 }
76 if let Some(protocol) = &self.protocol { 76 if let Some(protocol) = &self.protocol {
77 write!(f, "{}/", protocol)?; 77 write!(f, "{protocol}/")?;
78 } 78 }
79 if let Some(nip05) = &self.nip05 { 79 if let Some(nip05) = &self.nip05 {
80 write!(f, "{}/", nip05)?; 80 write!(f, "{nip05}/")?;
81 } else { 81 } else {
82 write!(f, "{}/", self.coordinate.public_key.to_bech32().unwrap())?; 82 write!(f, "{}/", self.coordinate.public_key.to_bech32().unwrap())?;
83 } 83 }
@@ -454,7 +454,7 @@ impl CloneUrl {
454 format!("{}@", user.as_deref().unwrap_or("git")).as_str(), 454 format!("{}@", user.as_deref().unwrap_or("git")).as_str(),
455 ); 455 );
456 if url.port().is_some() { 456 if url.port().is_some() {
457 formatted_url = format!("ssh://{}", formatted_url); 457 formatted_url = format!("ssh://{formatted_url}");
458 } else { 458 } else {
459 formatted_url = replace_first_occurrence(&formatted_url, '/', ':'); 459 formatted_url = replace_first_occurrence(&formatted_url, '/', ':');
460 } 460 }
diff --git a/src/lib/login/fresh.rs b/src/lib/login/fresh.rs
index 683d4af..a169177 100644
--- a/src/lib/login/fresh.rs
+++ b/src/lib/login/fresh.rs
@@ -278,7 +278,7 @@ pub async fn get_fresh_nip46_signer(
278 let input = Interactor::default() 278 let input = Interactor::default()
279 .input( 279 .input(
280 PromptInputParms::default().with_prompt(if let Some(error) = error { 280 PromptInputParms::default().with_prompt(if let Some(error) = error {
281 format!("error: {}. try again with NIP-05 address", error) 281 format!("error: {error}. try again with NIP-05 address")
282 } else { 282 } else {
283 "NIP-05 address".to_string() 283 "NIP-05 address".to_string()
284 }), 284 }),
@@ -296,7 +296,7 @@ pub async fn get_fresh_nip46_signer(
296 let input = Interactor::default() 296 let input = Interactor::default()
297 .input( 297 .input(
298 PromptInputParms::default().with_prompt(if let Some(error) = error { 298 PromptInputParms::default().with_prompt(if let Some(error) = error {
299 format!("error: {}. try again with bunker url", error) 299 format!("error: {error}. try again with bunker url")
300 } else { 300 } else {
301 "bunker url".to_string() 301 "bunker url".to_string()
302 }), 302 }),
@@ -505,7 +505,7 @@ async fn save_to_git_config(
505 if let Err(error) = 505 if let Err(error) =
506 silently_save_to_git_config(git_repo, signer_info, global).context(err_msg.clone()) 506 silently_save_to_git_config(git_repo, signer_info, global).context(err_msg.clone())
507 { 507 {
508 eprintln!("Error: {:?}", error); 508 eprintln!("Error: {error:?}");
509 match signer_info { 509 match signer_info {
510 SignerInfo::Nsec { 510 SignerInfo::Nsec {
511 nsec, 511 nsec,
@@ -577,7 +577,7 @@ async fn save_to_git_config(
577 ), 577 ),
578 ) 578 )
579 { 579 {
580 eprintln!("Error: {:?}", error); 580 eprintln!("Error: {error:?}");
581 eprintln!("login details were not saved"); 581 eprintln!("login details were not saved");
582 } else { 582 } else {
583 eprintln!( 583 eprintln!(
diff --git a/test_utils/src/lib.rs b/test_utils/src/lib.rs
index 5feb64b..1312610 100644
--- a/test_utils/src/lib.rs
+++ b/test_utils/src/lib.rs
@@ -167,7 +167,7 @@ pub fn generate_repo_ref_event_with_git_server_with_keys(
167 .tags([ 167 .tags([
168 Tag::identifier( 168 Tag::identifier(
169 // root_commit.to_string() 169 // root_commit.to_string()
170 format!("{}-consider-it-random", root_commit), 170 format!("{root_commit}-consider-it-random"),
171 ), 171 ),
172 Tag::from_standardized(TagStandard::Reference(root_commit.to_string())), 172 Tag::from_standardized(TagStandard::Reference(root_commit.to_string())),
173 Tag::from_standardized(TagStandard::Name("example name".into())), 173 Tag::from_standardized(TagStandard::Name("example name".into())),
@@ -1235,10 +1235,10 @@ pub fn create_and_populate_branch(
1235 test_repo.checkout("main")?; 1235 test_repo.checkout("main")?;
1236 test_repo.create_branch(branch_name)?; 1236 test_repo.create_branch(branch_name)?;
1237 test_repo.checkout(branch_name)?; 1237 test_repo.checkout(branch_name)?;
1238 let file_name = format!("{}3.md", prefix); 1238 let file_name = format!("{prefix}3.md");
1239 std::fs::write(test_repo.dir.join(&file_name), "some content")?; 1239 std::fs::write(test_repo.dir.join(&file_name), "some content")?;
1240 test_repo.stage_and_commit_custom_signature( 1240 test_repo.stage_and_commit_custom_signature(
1241 &format!("add {}3.md", prefix), 1241 &format!("add {prefix}3.md"),
1242 Some( 1242 Some(
1243 &Signature::new( 1243 &Signature::new(
1244 "Joe Bloggs", 1244 "Joe Bloggs",
@@ -1250,10 +1250,10 @@ pub fn create_and_populate_branch(
1250 commiter, 1250 commiter,
1251 )?; 1251 )?;
1252 if !only_one_commit { 1252 if !only_one_commit {
1253 let file_name = format!("{}4.md", prefix); 1253 let file_name = format!("{prefix}4.md");
1254 std::fs::write(test_repo.dir.join(&file_name), "some content")?; 1254 std::fs::write(test_repo.dir.join(&file_name), "some content")?;
1255 test_repo.stage_and_commit_custom_signature( 1255 test_repo.stage_and_commit_custom_signature(
1256 &format!("add {}4.md", prefix), 1256 &format!("add {prefix}4.md"),
1257 Some( 1257 Some(
1258 &Signature::new( 1258 &Signature::new(
1259 "Joe Bloggs", 1259 "Joe Bloggs",
diff --git a/test_utils/src/relay.rs b/test_utils/src/relay.rs
index e820651..14778d9 100644
--- a/test_utils/src/relay.rs
+++ b/test_utils/src/relay.rs
@@ -186,7 +186,7 @@ impl<'a> Relay<'a> {
186 186
187pub fn shutdown_relay(port: u64) -> Result<()> { 187pub fn shutdown_relay(port: u64) -> Result<()> {
188 let mut counter = 0; 188 let mut counter = 0;
189 while let Ok((mut socket, _)) = tungstenite::connect(format!("ws://localhost:{}", port)) { 189 while let Ok((mut socket, _)) = tungstenite::connect(format!("ws://localhost:{port}")) {
190 counter += 1; 190 counter += 1;
191 if counter == 1 { 191 if counter == 1 {
192 socket.write(tungstenite::Message::text("shut me down"))?; 192 socket.write(tungstenite::Message::text("shut me down"))?;
diff --git a/tests/git_remote_nostr/list.rs b/tests/git_remote_nostr/list.rs
index 37cff30..c201054 100644
--- a/tests/git_remote_nostr/list.rs
+++ b/tests/git_remote_nostr/list.rs
@@ -41,7 +41,7 @@ mod without_state_announcement {
41 let cli_tester_handle = std::thread::spawn(move || -> Result<()> { 41 let cli_tester_handle = std::thread::spawn(move || -> Result<()> {
42 let mut p = cli_tester_after_fetch(&git_repo)?; 42 let mut p = cli_tester_after_fetch(&git_repo)?;
43 p.send_line("list")?; 43 p.send_line("list")?;
44 p.expect(format!("fetching {} ref list over filesystem...\r\n", source_path).as_str())?; 44 p.expect(format!("fetching {source_path} ref list over filesystem...\r\n").as_str())?;
45 p.expect("list: connecting...\r\n\r\r\r")?; 45 p.expect("list: connecting...\r\n\r\r\r")?;
46 // println!("{}", p.expect_eventually("\r\n\r\n")?); 46 // println!("{}", p.expect_eventually("\r\n\r\n")?);
47 let res = p.expect_eventually("\r\n\r\n")?; 47 let res = p.expect_eventually("\r\n\r\n")?;
@@ -59,8 +59,8 @@ mod without_state_announcement {
59 .collect::<HashSet<String>>(), 59 .collect::<HashSet<String>>(),
60 HashSet::from([ 60 HashSet::from([
61 "@refs/heads/main HEAD".to_string(), 61 "@refs/heads/main HEAD".to_string(),
62 format!("{} refs/heads/main", main_commit_id), 62 format!("{main_commit_id} refs/heads/main"),
63 format!("{} refs/heads/vnext", vnext_commit_id), 63 format!("{vnext_commit_id} refs/heads/vnext"),
64 ]), 64 ]),
65 ); 65 );
66 Ok(()) 66 Ok(())
@@ -120,7 +120,7 @@ mod with_state_announcement {
120 let mut p = cli_tester_after_fetch(&git_repo)?; 120 let mut p = cli_tester_after_fetch(&git_repo)?;
121 p.send_line("list")?; 121 p.send_line("list")?;
122 p.expect( 122 p.expect(
123 format!("fetching {} ref list over filesystem...\r\n", source_path).as_str(), 123 format!("fetching {source_path} ref list over filesystem...\r\n").as_str(),
124 )?; 124 )?;
125 p.expect("list: connecting...\r\n\r\r\r")?; 125 p.expect("list: connecting...\r\n\r\r\r")?;
126 // println!("{}", p.expect_eventually("\r\n\r\n")?); 126 // println!("{}", p.expect_eventually("\r\n\r\n")?);
@@ -135,8 +135,8 @@ mod with_state_announcement {
135 .collect::<HashSet<String>>(), 135 .collect::<HashSet<String>>(),
136 HashSet::from([ 136 HashSet::from([
137 "@refs/heads/main HEAD".to_string(), 137 "@refs/heads/main HEAD".to_string(),
138 format!("{} refs/heads/main", main_commit_id), 138 format!("{main_commit_id} refs/heads/main"),
139 format!("{} refs/heads/example-branch", example_commit_id), 139 format!("{example_commit_id} refs/heads/example-branch"),
140 ]), 140 ]),
141 ); 141 );
142 142
@@ -204,13 +204,12 @@ mod with_state_announcement {
204 let mut p = cli_tester_after_fetch(&git_repo)?; 204 let mut p = cli_tester_after_fetch(&git_repo)?;
205 p.send_line("list")?; 205 p.send_line("list")?;
206 p.expect( 206 p.expect(
207 format!("fetching {} ref list over filesystem...\r\n", source_path).as_str(), 207 format!("fetching {source_path} ref list over filesystem...\r\n").as_str(),
208 )?; 208 )?;
209 p.expect("list: connecting...\r\n\r\r\r")?; 209 p.expect("list: connecting...\r\n\r\r\r")?;
210 p.expect( 210 p.expect(
211 format!( 211 format!(
212 "WARNING: {} refs/heads/main is out of sync with nostr \r\n", 212 "WARNING: {source_path} refs/heads/main is out of sync with nostr \r\n"
213 source_path
214 ) 213 )
215 .as_str(), 214 .as_str(),
216 )?; 215 )?;
@@ -231,8 +230,8 @@ mod with_state_announcement {
231 .collect::<HashSet<String>>(), 230 .collect::<HashSet<String>>(),
232 HashSet::from([ 231 HashSet::from([
233 "@refs/heads/main HEAD".to_string(), 232 "@refs/heads/main HEAD".to_string(),
234 format!("{} refs/heads/main", main_original_commit_id), 233 format!("{main_original_commit_id} refs/heads/main"),
235 format!("{} refs/heads/example-branch", example_commit_id), 234 format!("{example_commit_id} refs/heads/example-branch"),
236 ]), 235 ]),
237 ); 236 );
238 Ok(()) 237 Ok(())
@@ -292,7 +291,7 @@ mod with_state_announcement {
292 let mut p = cli_tester_after_fetch(&git_repo)?; 291 let mut p = cli_tester_after_fetch(&git_repo)?;
293 p.send_line("list")?; 292 p.send_line("list")?;
294 p.expect( 293 p.expect(
295 format!("fetching {} ref list over filesystem...\r\n", source_path).as_str(), 294 format!("fetching {source_path} ref list over filesystem...\r\n").as_str(),
296 )?; 295 )?;
297 p.expect("list: connecting...\r\n\r\r\r")?; 296 p.expect("list: connecting...\r\n\r\r\r")?;
298 // println!("{}", p.expect_eventually("\r\n\r\n")?); 297 // println!("{}", p.expect_eventually("\r\n\r\n")?);
diff --git a/tests/git_remote_nostr/push.rs b/tests/git_remote_nostr/push.rs
index f46b0ea..9f5f492 100644
--- a/tests/git_remote_nostr/push.rs
+++ b/tests/git_remote_nostr/push.rs
@@ -981,7 +981,7 @@ async fn proposal_three_way_merge_commit_pushed_to_main_leads_to_status_event_is
981 981
982 let mut p = CliTester::new_git_with_remote_helper_from_dir(&git_repo.dir, ["push"]); 982 let mut p = CliTester::new_git_with_remote_helper_from_dir(&git_repo.dir, ["push"]);
983 cli_expect_nostr_fetch(&mut p)?; 983 cli_expect_nostr_fetch(&mut p)?;
984 p.expect(format!("fetching {} ref list over filesystem...\r\n", source_path).as_str())?; 984 p.expect(format!("fetching {source_path} ref list over filesystem...\r\n").as_str())?;
985 p.expect("list: connecting...\r\n")?; 985 p.expect("list: connecting...\r\n")?;
986 p.expect_eventually("merge commit ")?; 986 p.expect_eventually("merge commit ")?;
987 // shorthand merge commit id appears in this gap 987 // shorthand merge commit id appears in this gap
@@ -1137,7 +1137,7 @@ async fn proposal_fast_forward_merge_commits_pushed_to_main_leads_to_status_even
1137 1137
1138 let mut p = CliTester::new_git_with_remote_helper_from_dir(&git_repo.dir, ["push"]); 1138 let mut p = CliTester::new_git_with_remote_helper_from_dir(&git_repo.dir, ["push"]);
1139 cli_expect_nostr_fetch(&mut p)?; 1139 cli_expect_nostr_fetch(&mut p)?;
1140 p.expect(format!("fetching {} ref list over filesystem...\r\n", source_path).as_str())?; 1140 p.expect(format!("fetching {source_path} ref list over filesystem...\r\n").as_str())?;
1141 p.expect("list: connecting...\r\n")?; 1141 p.expect("list: connecting...\r\n")?;
1142 p.expect_eventually(format!( 1142 p.expect_eventually(format!(
1143 "fast-forward merge: create nostr proposal status event for {branch_name}\r\n" 1143 "fast-forward merge: create nostr proposal status event for {branch_name}\r\n"
@@ -1323,7 +1323,7 @@ async fn proposal_commits_applied_and_pushed_to_main_leads_to_status_event_issue
1323 1323
1324 let mut p = CliTester::new_git_with_remote_helper_from_dir(&git_repo.dir, ["push"]); 1324 let mut p = CliTester::new_git_with_remote_helper_from_dir(&git_repo.dir, ["push"]);
1325 cli_expect_nostr_fetch(&mut p)?; 1325 cli_expect_nostr_fetch(&mut p)?;
1326 p.expect(format!("fetching {} ref list over filesystem...\r\n", source_path).as_str())?; 1326 p.expect(format!("fetching {source_path} ref list over filesystem...\r\n").as_str())?;
1327 p.expect("list: connecting...\r\n")?; 1327 p.expect("list: connecting...\r\n")?;
1328 p.expect_eventually(format!( 1328 p.expect_eventually(format!(
1329 "applied commits from proposal: create nostr proposal status event for {branch_name}\r\n" ))?; 1329 "applied commits from proposal: create nostr proposal status event for {branch_name}\r\n" ))?;
@@ -1484,7 +1484,7 @@ async fn push_2_commits_to_existing_proposal() -> Result<()> {
1484 1484
1485 let mut p = CliTester::new_git_with_remote_helper_from_dir(&git_repo.dir, ["push"]); 1485 let mut p = CliTester::new_git_with_remote_helper_from_dir(&git_repo.dir, ["push"]);
1486 cli_expect_nostr_fetch(&mut p)?; 1486 cli_expect_nostr_fetch(&mut p)?;
1487 p.expect(format!("fetching {} ref list over filesystem...\r\n", source_path).as_str())?; 1487 p.expect(format!("fetching {source_path} ref list over filesystem...\r\n").as_str())?;
1488 p.expect("list: connecting...\r\n\r\r\r")?; 1488 p.expect("list: connecting...\r\n\r\r\r")?;
1489 p.expect_eventually_and_print(format!("To {}\r\n", get_nostr_remote_url()?).as_str())?; 1489 p.expect_eventually_and_print(format!("To {}\r\n", get_nostr_remote_url()?).as_str())?;
1490 let output = p.expect_end_eventually()?; 1490 let output = p.expect_end_eventually()?;
@@ -1639,7 +1639,7 @@ async fn force_push_creates_proposal_revision() -> Result<()> {
1639 let mut p = 1639 let mut p =
1640 CliTester::new_git_with_remote_helper_from_dir(&git_repo.dir, ["push", "--force"]); 1640 CliTester::new_git_with_remote_helper_from_dir(&git_repo.dir, ["push", "--force"]);
1641 cli_expect_nostr_fetch(&mut p)?; 1641 cli_expect_nostr_fetch(&mut p)?;
1642 p.expect(format!("fetching {} ref list over filesystem...\r\n", source_path).as_str())?; 1642 p.expect(format!("fetching {source_path} ref list over filesystem...\r\n").as_str())?;
1643 p.expect("list: connecting...\r\n")?; 1643 p.expect("list: connecting...\r\n")?;
1644 p.expect_eventually_and_print(format!("To {}\r\n", get_nostr_remote_url()?).as_str())?; 1644 p.expect_eventually_and_print(format!("To {}\r\n", get_nostr_remote_url()?).as_str())?;
1645 let output = p.expect_end_eventually()?; 1645 let output = p.expect_end_eventually()?;
@@ -1791,7 +1791,7 @@ async fn push_new_pr_branch_creates_proposal() -> Result<()> {
1791 branch_name, 1791 branch_name,
1792 ]); 1792 ]);
1793 cli_expect_nostr_fetch(&mut p)?; 1793 cli_expect_nostr_fetch(&mut p)?;
1794 p.expect(format!("fetching {} ref list over filesystem...\r\n", source_path).as_str())?; 1794 p.expect(format!("fetching {source_path} ref list over filesystem...\r\n").as_str())?;
1795 p.expect("list: connecting...\r\n\r\r\r")?; 1795 p.expect("list: connecting...\r\n\r\r\r")?;
1796 p.expect_eventually_and_print(format!("To {}\r\n", get_nostr_remote_url()?).as_str())?; 1796 p.expect_eventually_and_print(format!("To {}\r\n", get_nostr_remote_url()?).as_str())?;
1797 let output = p.expect_end_eventually()?; 1797 let output = p.expect_end_eventually()?;
diff --git a/tests/ngit_list.rs b/tests/ngit_list.rs
index bb742cf..c8f761a 100644
--- a/tests/ngit_list.rs
+++ b/tests/ngit_list.rs
@@ -217,8 +217,7 @@ mod when_main_branch_is_uptodate {
217 ])?; 217 ])?;
218 c.succeeds_with(0, true, None)?; 218 c.succeeds_with(0, true, None)?;
219 p.expect(format!( 219 p.expect(format!(
220 "checked out proposal as 'pr/{}(", 220 "checked out proposal as 'pr/{FEATURE_BRANCH_NAME_1}(",
221 FEATURE_BRANCH_NAME_1,
222 ))?; 221 ))?;
223 p.expect_end_eventually_with(")' branch\r\n")?; 222 p.expect_end_eventually_with(")' branch\r\n")?;
224 223
@@ -334,8 +333,7 @@ mod when_main_branch_is_uptodate {
334 ])?; 333 ])?;
335 c.succeeds_with(0, true, Some(0))?; 334 c.succeeds_with(0, true, Some(0))?;
336 p.expect(format!( 335 p.expect(format!(
337 "checked out proposal as 'pr/{}(", 336 "checked out proposal as 'pr/{FEATURE_BRANCH_NAME_3}(",
338 FEATURE_BRANCH_NAME_3,
339 ))?; 337 ))?;
340 p.expect_end_eventually_with(")' branch\r\n")?; 338 p.expect_end_eventually_with(")' branch\r\n")?;
341 339
@@ -530,8 +528,7 @@ mod when_main_branch_is_uptodate {
530 ])?; 528 ])?;
531 c.succeeds_with(0, true, Some(0))?; 529 c.succeeds_with(0, true, Some(0))?;
532 p.expect(format!( 530 p.expect(format!(
533 "checked out proposal as 'pr/{}(", 531 "checked out proposal as 'pr/{FEATURE_BRANCH_NAME_4}(",
534 FEATURE_BRANCH_NAME_4,
535 ))?; 532 ))?;
536 p.expect_end_eventually_with(")' branch\r\n")?; 533 p.expect_end_eventually_with(")' branch\r\n")?;
537 534
@@ -756,8 +753,7 @@ mod when_main_branch_is_uptodate {
756 ])?; 753 ])?;
757 c.succeeds_with(0, true, Some(0))?; 754 c.succeeds_with(0, true, Some(0))?;
758 p.expect(format!( 755 p.expect(format!(
759 "checked out proposal as 'pr/{}(", 756 "checked out proposal as 'pr/{FEATURE_BRANCH_NAME_1}(",
760 FEATURE_BRANCH_NAME_1,
761 ))?; 757 ))?;
762 p.expect_end_eventually_with(")' branch\r\n")?; 758 p.expect_end_eventually_with(")' branch\r\n")?;
763 759
diff --git a/tests/ngit_login.rs b/tests/ngit_login.rs
index b1e2676..09e40f1 100644
--- a/tests/ngit_login.rs
+++ b/tests/ngit_login.rs
@@ -110,9 +110,7 @@ mod with_relays {
110 110
111 p.expect("failed to extract account name from account metadata...\r\n")?; 111 p.expect("failed to extract account name from account metadata...\r\n")?;
112 112
113 p.expect_end_with( 113 p.expect_end_with(format!("logged in as {TEST_KEY_1_NPUB}\r\n").as_str())?;
114 format!("logged in as {}\r\n", TEST_KEY_1_NPUB).as_str(),
115 )?;
116 for p in [51, 52] { 114 for p in [51, 52] {
117 shutdown_relay(8000 + p)?; 115 shutdown_relay(8000 + p)?;
118 } 116 }
@@ -572,7 +570,7 @@ mod with_offline_flag {
572 570
573 p.expect("saved login details to local git config. you are only logged in to this local repository.\r\n")?; 571 p.expect("saved login details to local git config. you are only logged in to this local repository.\r\n")?;
574 572
575 p.expect_end_with(format!("logged in as {}\r\n", TEST_KEY_1_NPUB).as_str()) 573 p.expect_end_with(format!("logged in as {TEST_KEY_1_NPUB}\r\n").as_str())
576 } 574 }
577 575
578 #[test] 576 #[test]
@@ -587,7 +585,7 @@ mod with_offline_flag {
587 585
588 p.expect("saved login details to local git config. you are only logged in to this local repository.\r\n")?; 586 p.expect("saved login details to local git config. you are only logged in to this local repository.\r\n")?;
589 587
590 p.expect_end_with(format!("logged in as {}\r\n", TEST_KEY_1_NPUB).as_str()) 588 p.expect_end_with(format!("logged in as {TEST_KEY_1_NPUB}\r\n").as_str())
591 } 589 }
592 590
593 mod when_invalid_nsec { 591 mod when_invalid_nsec {
@@ -621,7 +619,7 @@ mod with_offline_flag {
621 619
622 p.expect("saved login details to local git config. you are only logged in to this local repository.\r\n")?; 620 p.expect("saved login details to local git config. you are only logged in to this local repository.\r\n")?;
623 621
624 p.expect_end_with(format!("logged in as {}\r\n", TEST_KEY_1_NPUB).as_str()) 622 p.expect_end_with(format!("logged in as {TEST_KEY_1_NPUB}\r\n").as_str())
625 } 623 }
626 } 624 }
627 } 625 }
@@ -643,7 +641,7 @@ mod with_offline_flag {
643 p.expect("saved login details to local git config. you are only logged in to this local repository.\r\n")?; 641 p.expect("saved login details to local git config. you are only logged in to this local repository.\r\n")?;
644 642
645 p.expect_end_with( 643 p.expect_end_with(
646 format!("logged in as {} via cli arguments\r\n", TEST_KEY_1_NPUB).as_str(), 644 format!("logged in as {TEST_KEY_1_NPUB} via cli arguments\r\n").as_str(),
647 ) 645 )
648 } 646 }
649 647
@@ -682,7 +680,7 @@ mod with_offline_flag {
682 p.expect("saved login details to local git config. you are only logged in to this local repository.\r\n")?; 680 p.expect("saved login details to local git config. you are only logged in to this local repository.\r\n")?;
683 681
684 p.expect_end_with( 682 p.expect_end_with(
685 format!("logged in as {} via cli arguments\r\n", TEST_KEY_1_NPUB).as_str(), 683 format!("logged in as {TEST_KEY_1_NPUB} via cli arguments\r\n").as_str(),
686 ) 684 )
687 } 685 }
688 686
@@ -701,7 +699,7 @@ mod with_offline_flag {
701 p.expect("saved login details to local git config. you are only logged in to this local repository.\r\n")?; 699 p.expect("saved login details to local git config. you are only logged in to this local repository.\r\n")?;
702 700
703 p.expect_end_with( 701 p.expect_end_with(
704 format!("logged in as {} via cli arguments\r\n", TEST_KEY_1_NPUB).as_str(), 702 format!("logged in as {TEST_KEY_1_NPUB} via cli arguments\r\n").as_str(),
705 ) 703 )
706 } 704 }
707 705
@@ -724,7 +722,7 @@ mod with_offline_flag {
724 p.expect("saved login details to local git config. you are only logged in to this local repository.\r\n")?; 722 p.expect("saved login details to local git config. you are only logged in to this local repository.\r\n")?;
725 723
726 p.expect_end_with( 724 p.expect_end_with(
727 format!("logged in as {} via cli arguments\r\n", TEST_KEY_2_NPUB).as_str(), 725 format!("logged in as {TEST_KEY_2_NPUB} via cli arguments\r\n").as_str(),
728 ) 726 )
729 } 727 }
730 } 728 }
diff --git a/tests/ngit_send.rs b/tests/ngit_send.rs
index 0337a6e..5cc5291 100644
--- a/tests/ngit_send.rs
+++ b/tests/ngit_send.rs
@@ -1361,8 +1361,7 @@ mod root_proposal_specified_using_in_reply_to_with_range_of_head_2_and_cover_let
1361 p.expect("updates: 1 new maintainer, 1 announcement update, 1 proposal\r\n")?; 1361 p.expect("updates: 1 new maintainer, 1 announcement update, 1 proposal\r\n")?;
1362 let proposal_root_bech32 = get_pretend_proposal_root_event().id.to_bech32().unwrap(); 1362 let proposal_root_bech32 = get_pretend_proposal_root_event().id.to_bech32().unwrap();
1363 p.expect(format!( 1363 p.expect(format!(
1364 "creating proposal revision for: {}\r\n", 1364 "creating proposal revision for: {proposal_root_bech32}\r\n",
1365 proposal_root_bech32,
1366 ))?; 1365 ))?;
1367 p.expect("creating proposal from 2 commits:\r\n")?; 1366 p.expect("creating proposal from 2 commits:\r\n")?;
1368 p.expect("fe973a8 add t4.md\r\n")?; 1367 p.expect("fe973a8 add t4.md\r\n")?;