(source: &str)
| 18 | let result = pipeline.compile(source); |
| 19 | let err = result.expect_err("expected compilation to fail"); |
| 20 | match err { |
| 21 | CompilationError::DiagnosticErrors(diags) => assert!( |
| 22 | diags.iter().any(|d| d.message.contains(fragment)), |
| 23 | "expected diagnostic containing `{fragment}`, got: {diags:?}" |
| 24 | ), |
| 25 | other => panic!("expected DiagnosticErrors, got: {other:?}"), |
| 26 | } |
| 27 | } |
| 28 | |
| 29 | fn has_instruction<F>(source: &str, pred: F) -> bool |