[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.
This commit is contained in:
Andrew Gallant 2025-08-12 14:15:47 -04:00 committed by Andrew Gallant
parent 4db20f459c
commit 05478d5cc7

View file

@ -2262,7 +2262,11 @@ import fo<CURSOR>
", ",
); );
assert_snapshot!(test.completions_without_builtins(), @"<No completions found>"); // 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 // Ref: https://github.com/astral-sh/ty/issues/572
@ -2274,7 +2278,11 @@ import foo as ba<CURSOR>
", ",
); );
assert_snapshot!(test.completions_without_builtins(), @"<No completions found>"); // 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 // Ref: https://github.com/astral-sh/ty/issues/572
@ -2286,7 +2294,11 @@ from fo<CURSOR> import wat
", ",
); );
assert_snapshot!(test.completions_without_builtins(), @"<No completions found>"); // 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 // Ref: https://github.com/astral-sh/ty/issues/572