(source: &str, pred: F)
| 54 | .filter(|i| pred(i)) |
| 55 | .count() |
| 56 | } |
| 57 | |
| 58 | // -- Smoke tests --------------------------------------------------------------- |
| 59 | |
| 60 | #[test] |
| 61 | fn compiles_minimal_valid_program() { |
| 62 | let mut pipeline = CompilationPipeline::new(); |
| 63 | pipeline.set_write_artifacts(false); |
| 64 | pipeline.set_run_semantic_analysis(false); |
| 65 | assert!(pipeline.compile("main: () -> i32 { return 42 }").is_ok()); |
| 66 | } |
| 67 | |
| 68 | #[test] |
| 69 | fn rejects_invalid_tokens() { |
| 70 | let result = CompilationPipeline::new().compile("@invalid_token!@#"); |
| 71 | assert!(matches!( |
| 72 | result.unwrap_err(), |
nothing calls this directly
no test coverage detected