@@ -902,21 +902,23 @@ def test_missing_arc_descriptions_bug460(self) -> None:
902
902
assert parser .missing_arc_description (2 , - 3 ) == "line 3 didn't finish the lambda on line 3"
903
903
904
904
@pytest .mark .skipif (not env .PYBEHAVIOR .match_case , reason = "Match-case is new in 3.10" )
905
- def test_match_case_with_default (self ) -> None :
906
- parser = self .parse_text ("""\
907
- for command in ["huh", "go home", "go n"]:
908
- match command.split():
909
- case ["go", direction] if direction in "nesw":
910
- match = f"go: {direction}"
911
- case ["go", _]:
912
- match = "no go"
913
- print(match)
905
+ def test_match_case (self ) -> None :
906
+ parser = self .parse_text ("""\
907
+ match command.split():
908
+ case ["go", direction] if direction in "nesw": # 2
909
+ match = f"go: {direction}"
910
+ case ["go", _]: # 4
911
+ match = "no go"
912
+ print(match) # 6
914
913
""" )
915
- assert parser .missing_arc_description (3 , 4 ) == (
916
- "line 3 didn't jump to line 4 , because the pattern on line 3 never matched"
914
+ assert parser .missing_arc_description (2 , 3 ) == (
915
+ "line 2 didn't jump to line 3 , because the pattern on line 2 never matched"
917
916
)
918
- assert parser .missing_arc_description (3 , 5 ) == (
919
- "line 3 didn't jump to line 5, because the pattern on line 3 always matched"
917
+ assert parser .missing_arc_description (2 , 4 ) == (
918
+ "line 2 didn't jump to line 4, because the pattern on line 2 always matched"
919
+ )
920
+ assert parser .missing_arc_description (4 , 6 ) == (
921
+ "line 4 didn't jump to line 6, because the pattern on line 4 always matched"
920
922
)
921
923
922
924
0 commit comments