Skip to content

Commit ad0478e

Browse files
committed
test: add implementation-independent oracle for --json-input --min-ratio
The min-ratio test previously verified `actual` only against a value produced by replaying the same culling pipeline as the code under test. Assert directly that an entry far above the threshold survives and one far below it is culled, so the test no longer depends solely on that pipeline. https://claude.ai/code/session_01Nj3xEp1eoDKRp1MUCxNQRQ
1 parent d306b48 commit ad0478e

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

tests/json.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,12 @@ fn json_input_min_ratio() {
254254
let unculled = visualize(&apply_pipeline(sample_tree(), 10, 0.0, false));
255255
eprintln!("UNCULLED:\n{unculled}\n");
256256
assert_ne!(expected, unculled);
257+
258+
// Implementation-independent oracle: `foo` is far above the 10% threshold and
259+
// must remain, while `bar` is far below it and must be culled. This pins the
260+
// culling without reusing the pipeline that produces `expected`.
261+
assert!(actual.contains("foo"));
262+
assert!(!actual.contains("bar"));
257263
}
258264

259265
#[test]

0 commit comments

Comments
 (0)