mirror of
https://github.com/pjh456/OxideJS.git
synced 2026-10-23 18:21:13 +08:00
style: 自动格式化
This commit is contained in:
@@ -419,12 +419,6 @@ fn binary_literal_fold_entry() {
|
||||
let ir = emit_ir("var a = 2 * 3; var b = 1 + 2;");
|
||||
assert_eq!(count_op(&ir.insts, OpCode::MUL), 0, "双字面量乘法应折叠,MUL 计数为 0");
|
||||
assert_eq!(count_op(&ir.insts, OpCode::ADD), 0, "双字面量加法应折叠,ADD 计数为 0");
|
||||
assert!(
|
||||
ir.constants.contains(&Constant::Number(6.0)),
|
||||
"常量池应含乘法折值 Number(6.0)"
|
||||
);
|
||||
assert!(
|
||||
ir.constants.contains(&Constant::Int(3)),
|
||||
"常量池应含加法折值 Int(3)"
|
||||
);
|
||||
assert!(ir.constants.contains(&Constant::Number(6.0)), "常量池应含乘法折值 Number(6.0)");
|
||||
assert!(ir.constants.contains(&Constant::Int(3)), "常量池应含加法折值 Int(3)");
|
||||
}
|
||||
|
||||
@@ -128,8 +128,7 @@ fn fold_deterministic() {
|
||||
let mut fingerprints: Vec<(String, String)> = Vec::new();
|
||||
for _ in 0..8 {
|
||||
let alloc = oxide_parser::Allocator::default();
|
||||
let program =
|
||||
oxide_parser::parse(&alloc, src).unwrap_or_else(|e| panic!("parse 失败 {src:?}: {e:?}"));
|
||||
let program = oxide_parser::parse(&alloc, src).unwrap_or_else(|e| panic!("parse 失败 {src:?}: {e:?}"));
|
||||
let ir = Emitter::new()
|
||||
.emit_program(&program, false, false)
|
||||
.unwrap_or_else(|e| panic!("emit 失败 {src:?}: {e}"));
|
||||
|
||||
Reference in New Issue
Block a user