Skip to content

Commit d8c3d34

Browse files
committed
Fix stale pandoc-oracle test fixtures after 3.10 ceiling bump
d747904 bumped PANDOC_ORACLE_MAX_VERSION to (3, 10) but left two test fixtures pointing at the old ceiling: PANDOC_ORACLE_RANGE_CASES still expected (3, 10) to be out of range, and the gate-failure message test still asserted on "3.9". Rewrite both to derive boundary values from PANDOC_ORACLE_MIN/MAX_VERSION instead of hardcoded literals, so future ceiling bumps propagate automatically.
1 parent d747904 commit d8c3d34

1 file changed

Lines changed: 25 additions & 6 deletions

File tree

  • crates/pampa/tests/integration

crates/pampa/tests/integration/test.rs

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -206,12 +206,23 @@ const PANDOC_VERSION_PARSE_CASES: &[(&str, (u32, u32))] = &[
206206
("", (0, 0)),
207207
];
208208

209+
/// Boundary cases are derived from `PANDOC_ORACLE_MIN/MAX_VERSION` so bumping
210+
/// the ceiling doesn't require hand-editing this table too.
209211
const PANDOC_ORACLE_RANGE_CASES: &[((u32, u32), bool)] = &[
210-
((3, 5), false),
211-
((3, 6), true),
212-
((3, 7), true),
213-
((3, 9), true),
214-
((3, 10), false),
212+
(
213+
(PANDOC_ORACLE_MIN_VERSION.0, PANDOC_ORACLE_MIN_VERSION.1 - 1),
214+
false,
215+
),
216+
(PANDOC_ORACLE_MIN_VERSION, true),
217+
(
218+
(PANDOC_ORACLE_MIN_VERSION.0, PANDOC_ORACLE_MIN_VERSION.1 + 1),
219+
true,
220+
),
221+
(PANDOC_ORACLE_MAX_VERSION, true),
222+
(
223+
(PANDOC_ORACLE_MAX_VERSION.0, PANDOC_ORACLE_MAX_VERSION.1 + 1),
224+
false,
225+
),
215226
((4, 0), false),
216227
((0, 0), false),
217228
];
@@ -249,8 +260,16 @@ mod pandoc_oracle_gate_tests {
249260
message.contains("pandoc 3.10"),
250261
"message should contain the raw detected version line, got: {message}"
251262
);
263+
let min_str = format!(
264+
"{}.{}",
265+
PANDOC_ORACLE_MIN_VERSION.0, PANDOC_ORACLE_MIN_VERSION.1
266+
);
267+
let max_str = format!(
268+
"{}.{}",
269+
PANDOC_ORACLE_MAX_VERSION.0, PANDOC_ORACLE_MAX_VERSION.1
270+
);
252271
assert!(
253-
message.contains("3.6") && message.contains("3.9"),
272+
message.contains(&min_str) && message.contains(&max_str),
254273
"message should contain the calibrated range, got: {message}"
255274
);
256275
assert!(

0 commit comments

Comments
 (0)