From 7e75c772192d78c34e9218cefa882b3bd4ee7369 Mon Sep 17 00:00:00 2001 From: Felix Ableitner Date: Wed, 15 Nov 2023 15:07:02 +0100 Subject: [PATCH] wip: add follow test --- tests/test.rs | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/tests/test.rs b/tests/test.rs index 16e0675..20e4447 100644 --- a/tests/test.rs +++ b/tests/test.rs @@ -5,7 +5,7 @@ use fediwiki::start; #[tokio::test] async fn test_get_article() { let hostname = "localhost:8131"; - let join = tokio::task::spawn(async { + let handle = tokio::task::spawn(async { start(hostname).await.unwrap(); }); @@ -18,5 +18,20 @@ async fn test_get_article() { .unwrap(); assert_eq!(title, res.title); assert!(res.local); - join.abort(); + handle.abort(); } + +#[tokio::test] +async fn test_follow_instance() { + let hostname_alpha = "localhost:8131"; + let hostname_beta = "localhost:8132"; + let handle_alpha = tokio::task::spawn(async { + start(hostname_alpha).await.unwrap(); + }); + let handle_beta = tokio::task::spawn(async { + start(hostname_beta).await.unwrap(); + }); + + handle_alpha.abort(); + handle_beta.abort(); +} \ No newline at end of file