Skip to content

Commit cd02f61

Browse files
committed
add ok test for match
1 parent 6b69bb5 commit cd02f61

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

crates/ruff/tests/lint.rs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2630,6 +2630,30 @@ class A(Generic[T]):
26302630

26312631
#[test]
26322632
fn match_before_py310() {
2633+
// ok on 3.10
2634+
assert_cmd_snapshot!(Command::new(get_cargo_bin(BIN_NAME))
2635+
.args(STDIN_BASE_OPTIONS)
2636+
.args(["--stdin-filename", "test.py"])
2637+
.arg("--target-version=py310")
2638+
.arg("-")
2639+
.pass_stdin(
2640+
r#"
2641+
match 2:
2642+
case 1:
2643+
print("it's one")
2644+
"#
2645+
),
2646+
@r"
2647+
success: true
2648+
exit_code: 0
2649+
----- stdout -----
2650+
All checks passed!
2651+
2652+
----- stderr -----
2653+
"
2654+
);
2655+
2656+
// syntax error on 3.9
26332657
assert_cmd_snapshot!(Command::new(get_cargo_bin(BIN_NAME))
26342658
.args(STDIN_BASE_OPTIONS)
26352659
.args(["--stdin-filename", "test.py"])

0 commit comments

Comments
 (0)