From 1becf76264c51958a3e618d61e4a8c0c319c9384 Mon Sep 17 00:00:00 2001 From: Bytemalte Date: Sat, 31 Jan 2026 12:47:31 +0100 Subject: [PATCH] updated testall.rs with succesfull testing --- src/bin/testall.rs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/bin/testall.rs b/src/bin/testall.rs index 1238864..4aea0d1 100644 --- a/src/bin/testall.rs +++ b/src/bin/testall.rs @@ -88,6 +88,30 @@ async fn main() -> anyhow::Result<()> { // Non-fatal, DMs are slower } + // 8. Global feed (Discovery) + println!("\n[STEP 6] testing Global Feed Discovery..."); + let random_posts = ez.get_random_posts().await?; + if !random_posts.is_empty() { + println!(" [OK] Found {} random posts.", random_posts.len()); + } else { + println!(" [WARN] No random posts found (depends on relay traffic)."); + } + + // 9. Hashtag search (NIP-12) + println!("\n[STEP 7] Testing Hashtag Search (NIP-12)..."); + // We search for something common or wait for propagation of a tagged post. + // For a robust test, we could publish a tagged post, but for now we search for common tags. + let tags = vec!["nostr".to_string(), "bitcoin".to_string()]; + let filtered_posts = ez.get_posts_by_hashtags(tags).await?; + if !filtered_posts.is_empty() { + println!( + " [OK] Found {} posts with hashtags.", + filtered_posts.len() + ); + } else { + println!(" [WARN] No posts found for tags (depends on relay traffic)."); + } + println!("\n=== Test Complete ==="); Ok(()) }