Skip to content

Commit

Permalink
Check reverse comparisons in test suite as well
Browse files Browse the repository at this point in the history
  • Loading branch information
AMDmi3 committed Jan 25, 2024
1 parent 7697163 commit 200f7f9
Showing 1 changed file with 47 additions and 19 deletions.
66 changes: 47 additions & 19 deletions tests/suite.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,24 +45,52 @@ fn version_comparison_test_suite() {
let left_flags = parse_flags(&case.left_flags);
let right_flags = parse_flags(&case.right_flags);
let expected = parse_op(&case.expected_result);
let result = version_compare4(
&case.left_version,
&case.right_version,
left_flags,
right_flags,
);
println!(
"{} {}",
if result == expected { "OK" } else { "FAILED" },
case.text
);
assert!(
result == expected,
"Test suite case {}:{}: {} failed with unexpected result {}",
data_path,
case.line_number,
case.text,
display_op(result)
);

{
let result = version_compare4(
&case.left_version,
&case.right_version,
left_flags,
right_flags,
);
println!(
"{} {}",
if result == expected { "OK" } else { "FAILED" },
case.text
);
assert!(
result == expected,
"Test suite case {}:{}: {} failed with unexpected result {}",
data_path,
case.line_number,
case.text,
display_op(result)
);
}
{
let result = version_compare4(
&case.right_version,
&case.left_version,
right_flags,
left_flags,
);
println!(
"{} {}",
if result == expected.reverse() {
"OK"
} else {
"FAILED"
},
case.text
);
assert!(
result == expected.reverse(),
"Test suite case {}:{}: {} reverse check failed with unexpected result {}",
data_path,
case.line_number,
case.text,
display_op(result)
);
}
}
}

0 comments on commit 200f7f9

Please sign in to comment.