diff --git a/src/compile.rs b/src/compile.rs index fde8d05..bbc5123 100644 --- a/src/compile.rs +++ b/src/compile.rs @@ -2367,9 +2367,4 @@ mod tests { "if (True and False) or (False and True):\n pass\n" )); } - - #[test] - fn test_constant_optimization() { - insta::assert_ron_snapshot!(compile_exec("1 + 2 + 3 + 4\n1.5 * 2.5")); - } } diff --git a/src/snapshots/rustpython_compiler__compile__tests__constant_optimization.snap b/src/snapshots/rustpython_compiler__compile__tests__constant_optimization.snap deleted file mode 100644 index abbe950..0000000 --- a/src/snapshots/rustpython_compiler__compile__tests__constant_optimization.snap +++ /dev/null @@ -1,147 +0,0 @@ ---- -source: compiler/src/compile.rs -expression: "compile_exec(\"1 + 2 + 3 + 4\\n1.5 * 2.5\")" ---- -CodeObject( - instructions: [ - LoadConst( - idx: 0, - ), - LoadConst( - idx: 1, - ), - BinaryOperation( - op: Add, - inplace: false, - ), - LoadConst( - idx: 2, - ), - BinaryOperation( - op: Add, - inplace: false, - ), - LoadConst( - idx: 3, - ), - BinaryOperation( - op: Add, - inplace: false, - ), - Pop, - LoadConst( - idx: 4, - ), - LoadConst( - idx: 5, - ), - BinaryOperation( - op: Multiply, - inplace: false, - ), - Pop, - LoadConst( - idx: 6, - ), - ReturnValue, - ], - label_map: {}, - locations: [ - Location( - row: 1, - column: 1, - ), - Location( - row: 1, - column: 5, - ), - Location( - row: 1, - column: 5, - ), - Location( - row: 1, - column: 9, - ), - Location( - row: 1, - column: 9, - ), - Location( - row: 1, - column: 13, - ), - Location( - row: 1, - column: 13, - ), - Location( - row: 1, - column: 13, - ), - Location( - row: 2, - column: 1, - ), - Location( - row: 2, - column: 7, - ), - Location( - row: 2, - column: 7, - ), - Location( - row: 2, - column: 7, - ), - Location( - row: 2, - column: 7, - ), - Location( - row: 2, - column: 7, - ), - ], - flags: CodeFlags( - bits: 8, - ), - posonlyarg_count: 0, - arg_names: [], - varargs_name: None, - kwonlyarg_names: [], - varkeywords_name: None, - source_path: "source_path", - first_line_number: 0, - obj_name: "", - constants: [ - Integer( - value: (1, [ - 1, - ]), - ), - Integer( - value: (1, [ - 2, - ]), - ), - Integer( - value: (1, [ - 3, - ]), - ), - Integer( - value: (1, [ - 4, - ]), - ), - Float( - value: 1.5, - ), - Float( - value: 2.5, - ), - None, - ], -)