From 2bbc237890e45ec11aea671882fbbba7f1feab1f Mon Sep 17 00:00:00 2001 From: Alexander Hansen <alex@alex-hansen.com> Date: Tue, 28 Jan 2025 14:05:40 -0800 Subject: [PATCH] Fix incorrect syntax in qtest tests --- library/qtest/src/Tests.qs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/library/qtest/src/Tests.qs b/library/qtest/src/Tests.qs index 1f89e33048..50a3b4c176 100644 --- a/library/qtest/src/Tests.qs +++ b/library/qtest/src/Tests.qs @@ -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." ); } @@ -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,