mirror of
https://github.com/danbulant/oxc
synced 2026-05-20 12:48:38 +00:00
chore(codegen): test function reports duplicate error information (#6067)
<img width="649" alt="image" src="https://github.com/user-attachments/assets/7789a7b4-56fb-40a2-a76d-52a55fe2bfad">
This commit is contained in:
parent
b2760ec91c
commit
93d509db2b
1 changed files with 3 additions and 12 deletions
|
|
@ -15,10 +15,7 @@ pub fn test(source_text: &str, expected: &str) {
|
|||
)
|
||||
.build(&ret.program)
|
||||
.source_text;
|
||||
assert_eq!(
|
||||
result, expected,
|
||||
"\nfor source {source_text:?}\nexpect {expected:?}\ngot {result:?}"
|
||||
);
|
||||
assert_eq!(result, expected, "\nfor source: {source_text:?}");
|
||||
}
|
||||
|
||||
pub fn test_without_source(source_text: &str, expected: &str) {
|
||||
|
|
@ -26,10 +23,7 @@ pub fn test_without_source(source_text: &str, expected: &str) {
|
|||
let allocator = Allocator::default();
|
||||
let ret = Parser::new(&allocator, source_text, source_type).parse();
|
||||
let result = CodeGenerator::new().build(&ret.program).source_text;
|
||||
assert_eq!(
|
||||
result, expected,
|
||||
"\nfor source {source_text:?}\nexpect {expected:?}\ngot {result:?}\nwithout providing the original code."
|
||||
);
|
||||
assert_eq!(result, expected, "\nfor source: {source_text:?}");
|
||||
}
|
||||
|
||||
pub fn test_minify(source_text: &str, expected: &str) {
|
||||
|
|
@ -40,8 +34,5 @@ pub fn test_minify(source_text: &str, expected: &str) {
|
|||
.with_options(CodegenOptions { minify: true, ..CodegenOptions::default() })
|
||||
.build(&ret.program)
|
||||
.source_text;
|
||||
assert_eq!(
|
||||
result, expected,
|
||||
"\nfor minify source {source_text}\nexpect {expected}\ngot {result:?}"
|
||||
);
|
||||
assert_eq!(result, expected, "\nfor minify source: {source_text}");
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue