Skip to content

Commit fddb6cf

Browse files
simontreanorclaude
andcommitted
tests: compile-guard the Network Rail example
It doesn't fit the stdout-pinning run_example harness (Python helper on PYTHONPATH + writes a file), so guard the part a compiler change can break: its type-check and lowering. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent ac0c538 commit fddb6cf

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

tests/compile.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2862,6 +2862,22 @@ fn e2e_example_http_fetch() {
28622862
);
28632863
}
28642864

2865+
#[test]
2866+
fn example_network_rail_compiles() {
2867+
// The Network Rail example lives in a subdir with a Python helper + a bundled
2868+
// sample and writes a file rather than printing, so it doesn't fit the stdout-
2869+
// pinning `run_example` harness. Guard the part a compiler change can break:
2870+
// its type-check and lowering.
2871+
let path = format!(
2872+
"{}/examples/interop/network-rail/chippenham.pyfun",
2873+
env!("CARGO_MANIFEST_DIR")
2874+
);
2875+
let source =
2876+
std::fs::read_to_string(&path).unwrap_or_else(|e| panic!("cannot read {path}: {e}"));
2877+
pyfun::compile(&source)
2878+
.unwrap_or_else(|e| panic!("network-rail chippenham.pyfun must compile: {e}"));
2879+
}
2880+
28652881
// ---------- helpers ----------
28662882

28672883
/// Compile the interop example `name` from `examples/interop/`, run the emitted

0 commit comments

Comments
 (0)