Skip to content

Commit 5c9c0cb

Browse files
committed
test fix
1 parent da7c43d commit 5c9c0cb

File tree

3 files changed

+3
-24
lines changed

3 files changed

+3
-24
lines changed

compiler/codegen/src/compile.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2170,7 +2170,6 @@ impl Compiler<'_> {
21702170
p: &PatternMatchClass,
21712171
pc: &mut PatternContext,
21722172
) -> CompileResult<()> {
2173-
dbg!();
21742173
// Extract components from the MatchClass pattern.
21752174
let match_class = p;
21762175
let patterns = &match_class.arguments.patterns;
@@ -4540,13 +4539,10 @@ mod tests {
45404539

45414540
fn compile_exec(source: &str) -> CodeObject {
45424541
let opts = CompileOpts::default();
4543-
let mode = Mode::Exec;
45444542
let source_code = SourceCode::new("source_path", source);
4545-
let parsed = ruff_python_parser::parse(
4546-
source_code.text,
4547-
ruff_python_parser::Mode::from(mode).into(),
4548-
)
4549-
.unwrap();
4543+
let parsed =
4544+
ruff_python_parser::parse(source_code.text, ruff_python_parser::Mode::Module.into())
4545+
.unwrap();
45504546
let ast = parsed.into_syntax();
45514547
let ast = match ast {
45524548
ruff_python_ast::Mod::Module(stmts) => stmts,

compiler/codegen/src/snapshots/rustpython_codegen__compile__tests__match.snap.new renamed to compiler/codegen/src/snapshots/rustpython_codegen__compile__tests__match.snap

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

extra_tests/snippets/syntax_match.py

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -48,19 +48,3 @@ def test_or(i):
4848
assert test_or(2) == 1
4949
assert test_or(3) == 1
5050
assert test_or(4) == 2
51-
52-
match [0, 1, 2]:
53-
case [0, 1, 2]:
54-
assert True
55-
case _:
56-
assert False
57-
58-
class Test:
59-
pass
60-
61-
t = Test()
62-
match t:
63-
case Test():
64-
assert True
65-
case _:
66-
assert False

0 commit comments

Comments
 (0)