upleb.uk

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

summaryrefslogtreecommitdiff
path: root/tests/claim.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/claim.rs')
-rw-r--r--tests/claim.rs81
1 files changed, 41 insertions, 40 deletions
diff --git a/tests/claim.rs b/tests/claim.rs
index 93feb54..ef669d0 100644
--- a/tests/claim.rs
+++ b/tests/claim.rs
@@ -117,10 +117,10 @@ mod when_repo_not_previously_claimed {
117 mod sent_to_correct_relays { 117 mod sent_to_correct_relays {
118 use super::*; 118 use super::*;
119 119
120 #[test] 120 #[tokio::test]
121 #[serial] 121 #[serial]
122 fn only_1_repository_kind_event_sent_to_user_relays() -> Result<()> { 122 async fn only_1_repository_kind_event_sent_to_user_relays() -> Result<()> {
123 let (_, _, r53, r55, _) = futures::executor::block_on(prep_run_claim())?; 123 let (_, _, r53, r55, _) = prep_run_claim().await?;
124 for relay in [&r53, &r55] { 124 for relay in [&r53, &r55] {
125 assert_eq!( 125 assert_eq!(
126 relay 126 relay
@@ -134,10 +134,10 @@ mod when_repo_not_previously_claimed {
134 Ok(()) 134 Ok(())
135 } 135 }
136 136
137 #[test] 137 #[tokio::test]
138 #[serial] 138 #[serial]
139 fn only_1_repository_kind_event_sent_to_specified_repo_relays() -> Result<()> { 139 async fn only_1_repository_kind_event_sent_to_specified_repo_relays() -> Result<()> {
140 let (_, _, _, r55, r56) = futures::executor::block_on(prep_run_claim())?; 140 let (_, _, _, r55, r56) = prep_run_claim().await?;
141 for relay in [&r55, &r56] { 141 for relay in [&r55, &r56] {
142 assert_eq!( 142 assert_eq!(
143 relay 143 relay
@@ -151,10 +151,10 @@ mod when_repo_not_previously_claimed {
151 Ok(()) 151 Ok(())
152 } 152 }
153 153
154 #[test] 154 #[tokio::test]
155 #[serial] 155 #[serial]
156 fn event_not_sent_to_fallback_relay() -> Result<()> { 156 async fn event_not_sent_to_fallback_relay() -> Result<()> {
157 let (r51, r52, _, _, _) = futures::executor::block_on(prep_run_claim())?; 157 let (r51, r52, _, _, _) = prep_run_claim().await?;
158 for relay in [&r51, &r52] { 158 for relay in [&r51, &r52] {
159 assert_eq!( 159 assert_eq!(
160 relay 160 relay
@@ -241,10 +241,10 @@ mod when_repo_not_previously_claimed {
241 Ok(()) 241 Ok(())
242 } 242 }
243 243
244 #[test] 244 #[tokio::test]
245 #[serial] 245 #[serial]
246 fn contains_maintainers_and_relays() -> Result<()> { 246 async fn contains_maintainers_and_relays() -> Result<()> {
247 futures::executor::block_on(async_run_test())?; 247 async_run_test().await?;
248 Ok(()) 248 Ok(())
249 } 249 }
250 } 250 }
@@ -252,9 +252,10 @@ mod when_repo_not_previously_claimed {
252 mod tags { 252 mod tags {
253 use super::*; 253 use super::*;
254 254
255 #[test] 255 #[tokio::test]
256 #[serial] 256 #[serial]
257 fn d_replaceable_event_identifier_defaults_to_root_commit_id_shorthand() -> Result<()> { 257 async fn d_replaceable_event_identifier_defaults_to_root_commit_id_shorthand()
258 -> Result<()> {
258 let (_, _, r53, r55, r56) = futures::executor::block_on(prep_run_claim())?; 259 let (_, _, r53, r55, r56) = futures::executor::block_on(prep_run_claim())?;
259 for relay in [&r53, &r55, &r56] { 260 for relay in [&r53, &r55, &r56] {
260 let event: &nostr::Event = relay 261 let event: &nostr::Event = relay
@@ -273,10 +274,10 @@ mod when_repo_not_previously_claimed {
273 Ok(()) 274 Ok(())
274 } 275 }
275 276
276 #[test] 277 #[tokio::test]
277 #[serial] 278 #[serial]
278 fn root_commit_as_reference() -> Result<()> { 279 async fn root_commit_as_reference() -> Result<()> {
279 let (_, _, r53, r55, r56) = futures::executor::block_on(prep_run_claim())?; 280 let (_, _, r53, r55, r56) = prep_run_claim().await?;
280 for relay in [&r53, &r55, &r56] { 281 for relay in [&r53, &r55, &r56] {
281 let event: &nostr::Event = relay 282 let event: &nostr::Event = relay
282 .events 283 .events
@@ -290,10 +291,10 @@ mod when_repo_not_previously_claimed {
290 Ok(()) 291 Ok(())
291 } 292 }
292 293
293 #[test] 294 #[tokio::test]
294 #[serial] 295 #[serial]
295 fn name() -> Result<()> { 296 async fn name() -> Result<()> {
296 let (_, _, r53, r55, r56) = futures::executor::block_on(prep_run_claim())?; 297 let (_, _, r53, r55, r56) = prep_run_claim().await?;
297 for relay in [&r53, &r55, &r56] { 298 for relay in [&r53, &r55, &r56] {
298 let event: &nostr::Event = relay 299 let event: &nostr::Event = relay
299 .events 300 .events
@@ -311,10 +312,10 @@ mod when_repo_not_previously_claimed {
311 Ok(()) 312 Ok(())
312 } 313 }
313 314
314 #[test] 315 #[tokio::test]
315 #[serial] 316 #[serial]
316 fn description() -> Result<()> { 317 async fn description() -> Result<()> {
317 let (_, _, r53, r55, r56) = futures::executor::block_on(prep_run_claim())?; 318 let (_, _, r53, r55, r56) = prep_run_claim().await?;
318 for relay in [&r53, &r55, &r56] { 319 for relay in [&r53, &r55, &r56] {
319 let event: &nostr::Event = relay 320 let event: &nostr::Event = relay
320 .events 321 .events
@@ -328,10 +329,10 @@ mod when_repo_not_previously_claimed {
328 Ok(()) 329 Ok(())
329 } 330 }
330 331
331 #[test] 332 #[tokio::test]
332 #[serial] 333 #[serial]
333 fn git_server() -> Result<()> { 334 async fn git_server() -> Result<()> {
334 let (_, _, r53, r55, r56) = futures::executor::block_on(prep_run_claim())?; 335 let (_, _, r53, r55, r56) = prep_run_claim().await?;
335 for relay in [&r53, &r55, &r56] { 336 for relay in [&r53, &r55, &r56] {
336 let event: &nostr::Event = relay 337 let event: &nostr::Event = relay
337 .events 338 .events
@@ -347,10 +348,10 @@ mod when_repo_not_previously_claimed {
347 Ok(()) 348 Ok(())
348 } 349 }
349 350
350 #[test] 351 #[tokio::test]
351 #[serial] 352 #[serial]
352 fn relays() -> Result<()> { 353 async fn relays() -> Result<()> {
353 let (_, _, r53, r55, r56) = futures::executor::block_on(prep_run_claim())?; 354 let (_, _, r53, r55, r56) = prep_run_claim().await?;
354 for relay in [&r53, &r55, &r56] { 355 for relay in [&r53, &r55, &r56] {
355 let event: &nostr::Event = relay 356 let event: &nostr::Event = relay
356 .events 357 .events
@@ -369,9 +370,9 @@ mod when_repo_not_previously_claimed {
369 Ok(()) 370 Ok(())
370 } 371 }
371 372
372 #[test] 373 #[tokio::test]
373 #[serial] 374 #[serial]
374 fn web() -> Result<()> { 375 async fn web() -> Result<()> {
375 let (_, _, r53, r55, r56) = futures::executor::block_on(prep_run_claim())?; 376 let (_, _, r53, r55, r56) = futures::executor::block_on(prep_run_claim())?;
376 for relay in [&r53, &r55, &r56] { 377 for relay in [&r53, &r55, &r56] {
377 let event: &nostr::Event = relay 378 let event: &nostr::Event = relay
@@ -473,10 +474,10 @@ mod when_repo_not_previously_claimed {
473 Ok(()) 474 Ok(())
474 } 475 }
475 476
476 #[test] 477 #[tokio::test]
477 #[serial] 478 #[serial]
478 fn check_cli_output() -> Result<()> { 479 async fn check_cli_output() -> Result<()> {
479 futures::executor::block_on(run_test_async())?; 480 run_test_async().await?;
480 Ok(()) 481 Ok(())
481 } 482 }
482 } 483 }
@@ -572,10 +573,10 @@ mod when_repo_not_previously_claimed {
572 mod tags { 573 mod tags {
573 use super::*; 574 use super::*;
574 575
575 #[test] 576 #[tokio::test]
576 #[serial] 577 #[serial]
577 fn relays_match_user_write_relays() -> Result<()> { 578 async fn relays_match_user_write_relays() -> Result<()> {
578 let (_, _, r53, r55, _) = futures::executor::block_on(prep_run_claim())?; 579 let (_, _, r53, r55, _) = prep_run_claim().await?;
579 for relay in [&r53, &r55] { 580 for relay in [&r53, &r55] {
580 let event: &nostr::Event = relay 581 let event: &nostr::Event = relay
581 .events 582 .events
@@ -650,10 +651,10 @@ mod when_repo_not_previously_claimed {
650 Ok(()) 651 Ok(())
651 } 652 }
652 653
653 #[test] 654 #[tokio::test]
654 #[serial] 655 #[serial]
655 fn check_cli_output() -> Result<()> { 656 async fn check_cli_output() -> Result<()> {
656 futures::executor::block_on(run_test_async())?; 657 run_test_async().await?;
657 Ok(()) 658 Ok(())
658 } 659 }
659 } 660 }