{"record":{"id":"011191adf3103e3a","repo":"swc-project/swc","slug":"assertion-failed-n","errorCode":null,"errorMessage":"assertion failed\\n{}","messagePattern":"assertion failed\\\\n(.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/testing/src/lib.rs","lineNumber":292,"sourceCode":"            )\n        });\n\n        buf\n    };\n\n    write_to_file(&target_dir.join(\"left\"), &left);\n    write_to_file(&target_dir.join(\"right\"), &right);\n\n    format!(\"----- {test_name}\\n    left:\\n{left}\\n    right:\\n{right}\")\n}\n\n#[macro_export]\nmacro_rules! assert_eq_ignore_span {\n    ($l:expr, $r:expr) => {{\n        println!(\"{}\", module_path!());\n        let (l, r) = ($crate::drop_span($l), $crate::drop_span($r));\n        if l != r {\n            panic!(\"assertion failed\\n{}\", $crate::print_left_right(&l, &r));\n        }\n    }};\n}\n\npub fn diff(l: &str, r: &str) -> String {\n    let cs = Changeset::new(l, r, \"\\n\");\n\n    format!(\"{cs}\")\n}\n\n/// Used for assertions.\n///\n/// Prints string without escaping special characters on failure.\n#[derive(PartialEq, Eq)]\npub struct DebugUsingDisplay<'a>(pub &'a str);\n\nimpl Debug for DebugUsingDisplay<'_> {\n    fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {","sourceCodeStart":274,"sourceCodeEnd":310,"githubUrl":"https://github.com/swc-project/swc/blob/5176682b65416c6b5de6b47379ae1588ea3ecb3f/crates/testing/src/lib.rs#L274-L310","documentation":"The terminal panic of the assert_eq_ignore_span! macro (crates/testing/src/lib.rs:292). After spans are stripped from both values, if the despanned structures still differ, the macro prints the module path and panics with this generic 'assertion failed' header plus the rendered left/right dump from print_left_right. It means two ASTs that are expected to be identical except for spans genuinely differ in content; the differing left/right values are the faulty input.","triggerScenarios":"Thrown at crates/testing/src/lib.rs:292 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the left/right files written under target/swc-test-results to see exactly which node differs","Regenerate expected fixtures with UPDATE=1 only after confirming the difference is an intended behavior change","Fix the transform that produced the unexpected output instead of updating the fixture"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5176682b65416c6b5de6b47379ae1588ea3ecb3f","analyzedAt":"2026-08-17T16:16:52.067Z","contentChangedAt":"2026-08-17T16:16:52.067Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}