updated testall.rs with succesfull testing

This commit is contained in:
2026-01-31 12:47:31 +01:00
parent 7b644785ee
commit 1becf76264

View File

@@ -88,6 +88,30 @@ async fn main() -> anyhow::Result<()> {
// Non-fatal, DMs are slower // 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 ==="); println!("\n=== Test Complete ===");
Ok(()) Ok(())
} }