Skip to content

Commit

Permalink
Fix incorrect syntax in qtest tests (#2135)
Browse files Browse the repository at this point in the history
I think that this got clobbered in a merge conflict. This fixes up the
Q# code that runs tests within qtest's test suite for itself.x
  • Loading branch information
sezna authored Jan 28, 2025
1 parent d909579 commit ff4b7c0
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions library/qtest/src/Tests.qs
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,18 @@ function FunctionTestMatrixTests() : Unit {
Fact(All(result -> result.did_pass, results), "test matrix did not pass all test cases");
}

function BasicTests() : Unit {
let sample_tests = [
function BasicTests() : (String, () -> Int, Int)[] {
return [
("Should return 42", TestCaseOne, 43),
("Should add one", () -> AddOne(5), 42),
("Should add one", () -> AddOne(5), 6)
]
];
}

@Test()
function ReturnsFalseForFailingTest() : Unit {
Fact(
not Functions.CheckAllTestCases(SampleTestData()),
not Functions.CheckAllTestCases(BasicTests()),
"Test harness failed to return false for a failing tests."
);
}
Expand All @@ -72,7 +72,7 @@ function ReturnsTrueForPassingTest() : Unit {

@Test()
function RunAllTests() : Unit {
let run_all_result = Functions.RunAllTestCases(SampleTestData());
let run_all_result = Functions.RunAllTestCases(BasicTests());

Fact(
Length(run_all_result) == 3,
Expand Down

0 comments on commit ff4b7c0

Please sign in to comment.