Skip to content

Commit 48fcee1

Browse files
committed
Make the JSONPath Compliance Test Suite blocking
1 parent 233bb9c commit 48fcee1

File tree

1 file changed

+16
-11
lines changed
  • packages/hurl/src/jsonpath2/tests

1 file changed

+16
-11
lines changed

packages/hurl/src/jsonpath2/tests/cts.rs

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ fn load_testcases() -> Vec<TestCase> {
258258
#[test]
259259
fn run() {
260260
let testcases = load_testcases();
261-
// TODO: Remove Limit when all the todo! has been removed
261+
// TODO: Remove Limit when spec is fully implemented
262262
let testcases = testcases.iter().take(40);
263263
let count_total = testcases.len();
264264

@@ -269,15 +269,20 @@ fn run() {
269269
.filter_map(|test_case| test_case.clone().err())
270270
.collect::<Vec<TestCaseError>>();
271271

272-
let count_failed = errors.len();
273-
let count_passed = count_total - count_failed;
274-
for error in &errors {
275-
eprintln!("{}\n", error);
276-
}
272+
if !errors.is_empty() {
273+
let count_failed = errors.len();
274+
let count_passed = count_total - count_failed;
275+
let mut s = String::new();
276+
for error in &errors {
277+
s.push_str(&error.to_string());
278+
s.push_str("\n\n");
279+
}
277280

278-
// TODO: Make it fail when spec has been fully implemented (might have to skip specific tests)
279-
eprintln!("RFC9535 Compliance tests:");
280-
eprintln!("Total: {count_total}");
281-
eprintln!("Passed: {count_passed}");
282-
eprintln!("Failed: {count_failed}");
281+
// TODO: Make it fail when spec has been fully implemented (might have to skip specific tests)
282+
s.push_str("RFC9535 Compliance tests:\n");
283+
s.push_str(format!("Total: {count_total}\n").as_str());
284+
s.push_str(format!("Passed: {count_passed}\n").as_str());
285+
s.push_str(format!("Failed: {count_failed}\n").as_str());
286+
panic!("{}", s);
287+
}
283288
}

0 commit comments

Comments
 (0)