Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix incorrect syntax in qtest tests #2135

Merged
merged 1 commit into from
Jan 28, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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