mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-28 18:59:04 +08:00
Remove optimization unit test
This commit is contained in:
2 files changed
-152
No files matched your search
@@ -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"));
|
||||
}
|
||||
}
|
||||
-147
@@ -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: "<module>",
|
||||
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,
|
||||
],
|
||||
)
|
||||
Reference in new issue
Block a user