From 05478d5cc7a2cf6cd58876bcb2b79a12261c6cf8 Mon Sep 17 00:00:00 2001 From: Andrew Gallant Date: Tue, 12 Aug 2025 14:15:47 -0400 Subject: [PATCH] [ty] Tweak some completion tests These tests were added as a regression check that a panic didn't occur. So we were asserting a bit more than necessary. In particular, these will soon return completions for modules, which creates large snapshots that we don't need. So modify these to just check there is sensible output that doesn't panic. --- crates/ty_ide/src/completion.rs | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/crates/ty_ide/src/completion.rs b/crates/ty_ide/src/completion.rs index 72d4a29756..2470308c41 100644 --- a/crates/ty_ide/src/completion.rs +++ b/crates/ty_ide/src/completion.rs @@ -2262,7 +2262,11 @@ import fo ", ); - assert_snapshot!(test.completions_without_builtins(), @""); + // This snapshot would generate a big list of modules, + // which is kind of annoying. So just assert that it + // runs without panicking and produces some non-empty + // output. + assert!(!test.completions_without_builtins().is_empty()); } // Ref: https://github.com/astral-sh/ty/issues/572 @@ -2274,7 +2278,11 @@ import foo as ba ", ); - assert_snapshot!(test.completions_without_builtins(), @""); + // This snapshot would generate a big list of modules, + // which is kind of annoying. So just assert that it + // runs without panicking and produces some non-empty + // output. + assert!(!test.completions_without_builtins().is_empty()); } // Ref: https://github.com/astral-sh/ty/issues/572 @@ -2286,7 +2294,11 @@ from fo import wat ", ); - assert_snapshot!(test.completions_without_builtins(), @""); + // This snapshot would generate a big list of modules, + // which is kind of annoying. So just assert that it + // runs without panicking and produces some non-empty + // output. + assert!(!test.completions_without_builtins().is_empty()); } // Ref: https://github.com/astral-sh/ty/issues/572