diff --git a/crates/ty_python_semantic/tests/corpus.rs b/crates/ty_python_semantic/tests/corpus.rs index c3c9b4297e..2f72a4bce3 100644 --- a/crates/ty_python_semantic/tests/corpus.rs +++ b/crates/ty_python_semantic/tests/corpus.rs @@ -12,6 +12,8 @@ use ty_python_semantic::{ SearchPathSettings, default_lint_registry, }; +use test_case::test_case; + fn get_cargo_workspace_root() -> anyhow::Result { Ok(SystemPathBuf::from(String::from_utf8( std::process::Command::new("cargo") @@ -39,19 +41,16 @@ fn parser_no_panic() -> anyhow::Result<()> { )) } -#[test] -fn linter_af_no_panic() -> anyhow::Result<()> { +#[test_case("a-e")] +#[test_case("f")] +#[test_case("g-o")] +#[test_case("p")] +#[test_case("q-z")] +#[test_case("!a-z")] +fn linter_no_panic(range: &str) -> anyhow::Result<()> { let workspace_root = get_cargo_workspace_root()?; run_corpus_tests(&format!( - "{workspace_root}/crates/ruff_linter/resources/test/fixtures/[a-f]*/**/*.py" - )) -} - -#[test] -fn linter_gz_no_panic() -> anyhow::Result<()> { - let workspace_root = get_cargo_workspace_root()?; - run_corpus_tests(&format!( - "{workspace_root}/crates/ruff_linter/resources/test/fixtures/[g-z]*/**/*.py" + "{workspace_root}/crates/ruff_linter/resources/test/fixtures/[{range}]*/**/*.py" )) } @@ -63,11 +62,15 @@ fn linter_stubs_no_panic() -> anyhow::Result<()> { )) } -#[test] -fn typeshed_no_panic() -> anyhow::Result<()> { +#[test_case("a-e")] +#[test_case("f-k")] +#[test_case("l-p")] +#[test_case("q-z")] +#[test_case("!a-z")] +fn typeshed_no_panic(range: &str) -> anyhow::Result<()> { let workspace_root = get_cargo_workspace_root()?; run_corpus_tests(&format!( - "{workspace_root}/crates/ty_vendored/vendor/typeshed/**/*.pyi" + "{workspace_root}/crates/ty_vendored/vendor/typeshed/stdlib/[{range}]*.pyi" )) }