From 17c148d99b30bf5875ef68fbfe52817d087cd1c8 Mon Sep 17 00:00:00 2001 From: ee7 <45465154+ee7@users.noreply.github.com> Date: Fri, 3 Mar 2023 13:00:01 +0100 Subject: [PATCH] exercises: tests: remove `comptime` --- .../binary-search/test_binary_search.zig | 30 ++++--- .../test_collatz_conjecture.zig | 18 ++--- exercises/practice/darts/test_darts.zig | 78 +++++++++---------- .../test_difference_of_squares.zig | 36 ++++----- exercises/practice/grains/test_grains.zig | 36 ++++----- exercises/practice/hamming/test_hamming.zig | 28 ++++--- .../practice/hello-world/test_hello_world.zig | 2 +- .../test_resistor_color_duo.zig | 24 +++--- .../resistor-color/test_resistor_color.zig | 14 ++-- exercises/practice/triangle/test_triangle.zig | 32 ++++---- 10 files changed, 151 insertions(+), 147 deletions(-) diff --git a/exercises/practice/binary-search/test_binary_search.zig b/exercises/practice/binary-search/test_binary_search.zig index b3cf2adf..5dcc6571 100644 --- a/exercises/practice/binary-search/test_binary_search.zig +++ b/exercises/practice/binary-search/test_binary_search.zig @@ -6,33 +6,39 @@ const binarySearch = binary_search.binarySearch; const SearchError = binary_search.SearchError; test "finds a value in an array with one element" { - const actual = comptime try binarySearch(i4, 6, &[_]i4{6}); - try testing.expectEqual(0, actual); + const expected: usize = 0; + const actual = try binarySearch(i4, 6, &[_]i4{6}); + try testing.expectEqual(expected, actual); } test "finds a value in the middle of an array" { - const actual = comptime try binarySearch(u4, 6, &[_]u4{ 1, 3, 4, 6, 8, 9, 11 }); - try testing.expectEqual(3, actual); + const expected: usize = 3; + const actual = try binarySearch(u4, 6, &[_]u4{ 1, 3, 4, 6, 8, 9, 11 }); + try testing.expectEqual(expected, actual); } test "finds a value at the beginning of an array" { - const actual = comptime try binarySearch(i8, 1, &[_]i8{ 1, 3, 4, 6, 8, 9, 11 }); - try testing.expectEqual(0, actual); + const expected: usize = 0; + const actual = try binarySearch(i8, 1, &[_]i8{ 1, 3, 4, 6, 8, 9, 11 }); + try testing.expectEqual(expected, actual); } test "finds a value at the end of an array" { - const actual = comptime try binarySearch(u8, 11, &[_]u8{ 1, 3, 4, 6, 8, 9, 11 }); - try testing.expectEqual(6, actual); + const expected: usize = 6; + const actual = try binarySearch(u8, 11, &[_]u8{ 1, 3, 4, 6, 8, 9, 11 }); + try testing.expectEqual(expected, actual); } test "finds a value in an array of odd length" { - const actual = comptime try binarySearch(i16, 21, &[_]i16{ 1, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 634 }); - try testing.expectEqual(5, actual); + const expected: usize = 5; + const actual = try binarySearch(i16, 21, &[_]i16{ 1, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 634 }); + try testing.expectEqual(expected, actual); } test "finds a value in an array of even length" { - const actual = comptime try binarySearch(u16, 21, &[_]u16{ 1, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377 }); - try testing.expectEqual(5, actual); + const expected: usize = 5; + const actual = try binarySearch(u16, 21, &[_]u16{ 1, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377 }); + try testing.expectEqual(expected, actual); } test "identifies that a value is not included in the array" { diff --git a/exercises/practice/collatz-conjecture/test_collatz_conjecture.zig b/exercises/practice/collatz-conjecture/test_collatz_conjecture.zig index 4cf1414e..d87b5ba9 100644 --- a/exercises/practice/collatz-conjecture/test_collatz_conjecture.zig +++ b/exercises/practice/collatz-conjecture/test_collatz_conjecture.zig @@ -5,31 +5,31 @@ const collatz_conjecture = @import("collatz_conjecture.zig"); const ComputationError = collatz_conjecture.ComputationError; test "zero steps for one" { - const expected = 0; - const actual = comptime try collatz_conjecture.steps(1); + const expected: usize = 0; + const actual = try collatz_conjecture.steps(1); try testing.expectEqual(expected, actual); } test "divide if even" { - const expected = 4; - const actual = comptime try collatz_conjecture.steps(16); + const expected: usize = 4; + const actual = try collatz_conjecture.steps(16); try testing.expectEqual(expected, actual); } test "even and odd steps" { - const expected = 9; - const actual = comptime try collatz_conjecture.steps(12); + const expected: usize = 9; + const actual = try collatz_conjecture.steps(12); try testing.expectEqual(expected, actual); } test "large number of even and odd steps" { - const expected = 152; - const actual = comptime try collatz_conjecture.steps(1_000_000); + const expected: usize = 152; + const actual = try collatz_conjecture.steps(1_000_000); try testing.expectEqual(expected, actual); } test "zero is an error" { const expected = ComputationError.IllegalArgument; - const actual = comptime collatz_conjecture.steps(0); + const actual = collatz_conjecture.steps(0); try testing.expectError(expected, actual); } diff --git a/exercises/practice/darts/test_darts.zig b/exercises/practice/darts/test_darts.zig index cf5e6cdf..f62e8c7d 100644 --- a/exercises/practice/darts/test_darts.zig +++ b/exercises/practice/darts/test_darts.zig @@ -4,92 +4,92 @@ const testing = std.testing; const darts = @import("darts.zig"); test "missed target" { - const coordinate = comptime darts.Coordinate.init(-9.0, 9.0); - const expected = 0; - const actual = comptime coordinate.score(); + const expected: usize = 0; + const coordinate = darts.Coordinate.init(-9.0, 9.0); + const actual = coordinate.score(); try testing.expectEqual(expected, actual); } test "on the outer circle" { - const coordinate = comptime darts.Coordinate.init(0.0, 10.0); - const expected = 1; - const actual = comptime coordinate.score(); + const expected: usize = 1; + const coordinate = darts.Coordinate.init(0.0, 10.0); + const actual = coordinate.score(); try testing.expectEqual(expected, actual); } test "on the middle circle" { - const coordinate = comptime darts.Coordinate.init(-5.0, 0.0); - const expected = 5; - const actual = comptime coordinate.score(); + const expected: usize = 5; + const coordinate = darts.Coordinate.init(-5.0, 0.0); + const actual = coordinate.score(); try testing.expectEqual(expected, actual); } test "on the inner circle" { - const coordinate = comptime darts.Coordinate.init(0.0, -1.0); - const expected = 10; - const actual = comptime coordinate.score(); + const expected: usize = 10; + const coordinate = darts.Coordinate.init(0.0, -1.0); + const actual = coordinate.score(); try testing.expectEqual(expected, actual); } test "exactly on center" { - const coordinate = comptime darts.Coordinate.init(0.0, 0.0); - const expected = 10; - const actual = comptime coordinate.score(); + const expected: usize = 10; + const coordinate = darts.Coordinate.init(0.0, 0.0); + const actual = coordinate.score(); try testing.expectEqual(expected, actual); } test "near the center" { - const coordinate = comptime darts.Coordinate.init(-0.1, -0.1); - const expected = 10; - const actual = comptime coordinate.score(); + const expected: usize = 10; + const coordinate = darts.Coordinate.init(-0.1, -0.1); + const actual = coordinate.score(); try testing.expectEqual(expected, actual); } test "just within the inner circle" { - const coordinate = comptime darts.Coordinate.init(0.7, 0.7); - const expected = 10; - const actual = comptime coordinate.score(); + const expected: usize = 10; + const coordinate = darts.Coordinate.init(0.7, 0.7); + const actual = coordinate.score(); try testing.expectEqual(expected, actual); } test "just outside the inner circle" { - const coordinate = comptime darts.Coordinate.init(0.8, -0.8); - const expected = 5; - const actual = comptime coordinate.score(); + const expected: usize = 5; + const coordinate = darts.Coordinate.init(0.8, -0.8); + const actual = coordinate.score(); try testing.expectEqual(expected, actual); } test "just within the middle circle" { - const coordinate = comptime darts.Coordinate.init(3.5, -3.5); - const expected = 5; - const actual = comptime coordinate.score(); + const expected: usize = 5; + const coordinate = darts.Coordinate.init(3.5, -3.5); + const actual = coordinate.score(); try testing.expectEqual(expected, actual); } test "just outside the middle circle" { - const coordinate = comptime darts.Coordinate.init(-3.6, -3.6); - const expected = 1; - const actual = comptime coordinate.score(); + const expected: usize = 1; + const coordinate = darts.Coordinate.init(-3.6, -3.6); + const actual = coordinate.score(); try testing.expectEqual(expected, actual); } test "just within the outer circle" { - const coordinate = comptime darts.Coordinate.init(-7.0, 7.0); - const expected = 1; - const actual = comptime coordinate.score(); + const expected: usize = 1; + const coordinate = darts.Coordinate.init(-7.0, 7.0); + const actual = coordinate.score(); try testing.expectEqual(expected, actual); } test "just outside the outer circle" { - const coordinate = comptime darts.Coordinate.init(7.1, -7.1); - const expected = 0; - const actual = comptime coordinate.score(); + const expected: usize = 0; + const coordinate = darts.Coordinate.init(7.1, -7.1); + const actual = coordinate.score(); try testing.expectEqual(expected, actual); } test "asymmetric position between the inner and middle circles" { - const coordinate = comptime darts.Coordinate.init(0.5, -4.0); - const expected = 5; - const actual = comptime coordinate.score(); + const expected: usize = 5; + const coordinate = darts.Coordinate.init(0.5, -4.0); + const actual = coordinate.score(); try testing.expectEqual(expected, actual); } diff --git a/exercises/practice/difference-of-squares/test_difference_of_squares.zig b/exercises/practice/difference-of-squares/test_difference_of_squares.zig index 233b03a1..4138571a 100644 --- a/exercises/practice/difference-of-squares/test_difference_of_squares.zig +++ b/exercises/practice/difference-of-squares/test_difference_of_squares.zig @@ -4,55 +4,55 @@ const testing = std.testing; const difference_of_squares = @import("difference_of_squares.zig"); test "square of sum up to 1" { - const expected = 1; - const actual = comptime difference_of_squares.squareOfSum(1); + const expected: usize = 1; + const actual = difference_of_squares.squareOfSum(1); try testing.expectEqual(expected, actual); } test "square of sum up to 5" { - const expected = 225; - const actual = comptime difference_of_squares.squareOfSum(5); + const expected: usize = 225; + const actual = difference_of_squares.squareOfSum(5); try testing.expectEqual(expected, actual); } test "square of sum up to 100" { - const expected = 25_502_500; - const actual = comptime difference_of_squares.squareOfSum(100); + const expected: usize = 25_502_500; + const actual = difference_of_squares.squareOfSum(100); try testing.expectEqual(expected, actual); } test "sum of squares up to 1" { - const expected = 1; - const actual = comptime difference_of_squares.sumOfSquares(1); + const expected: usize = 1; + const actual = difference_of_squares.sumOfSquares(1); try testing.expectEqual(expected, actual); } test "sum of squares up to 5" { - const expected = 55; - const actual = comptime difference_of_squares.sumOfSquares(5); + const expected: usize = 55; + const actual = difference_of_squares.sumOfSquares(5); try testing.expectEqual(expected, actual); } test "sum of squares up to 100" { - const expected = 338_350; - const actual = comptime difference_of_squares.sumOfSquares(100); + const expected: usize = 338_350; + const actual = difference_of_squares.sumOfSquares(100); try testing.expectEqual(expected, actual); } test "difference of squares up to 1" { - const expected = 0; - const actual = comptime difference_of_squares.differenceOfSquares(1); + const expected: usize = 0; + const actual = difference_of_squares.differenceOfSquares(1); try testing.expectEqual(expected, actual); } test "difference of squares up to 5" { - const expected = 170; - const actual = comptime difference_of_squares.differenceOfSquares(5); + const expected: usize = 170; + const actual = difference_of_squares.differenceOfSquares(5); try testing.expectEqual(expected, actual); } test "difference of squares up to 100" { - const expected = 25_164_150; - const actual = comptime difference_of_squares.differenceOfSquares(100); + const expected: usize = 25_164_150; + const actual = difference_of_squares.differenceOfSquares(100); try testing.expectEqual(expected, actual); } diff --git a/exercises/practice/grains/test_grains.zig b/exercises/practice/grains/test_grains.zig index 4d3babb3..ff132704 100644 --- a/exercises/practice/grains/test_grains.zig +++ b/exercises/practice/grains/test_grains.zig @@ -5,61 +5,61 @@ const grains = @import("grains.zig"); const ChessboardError = grains.ChessboardError; test "grains on square 1" { - const expected = 1; - const actual = comptime try grains.square(1); + const expected: usize = 1; + const actual = try grains.square(1); try testing.expectEqual(expected, actual); } test "grains on square 2" { - const expected = 2; - const actual = comptime try grains.square(2); + const expected: usize = 2; + const actual = try grains.square(2); try testing.expectEqual(expected, actual); } test "grains on square 3" { - const expected = 4; - const actual = comptime try grains.square(3); + const expected: usize = 4; + const actual = try grains.square(3); try testing.expectEqual(expected, actual); } test "grains on square 4" { - const expected = 8; - const actual = comptime try grains.square(4); + const expected: usize = 8; + const actual = try grains.square(4); try testing.expectEqual(expected, actual); } test "grains on square 16" { - const expected = 32_768; - const actual = comptime try grains.square(16); + const expected: usize = 32_768; + const actual = try grains.square(16); try testing.expectEqual(expected, actual); } test "grains on square 32" { - const expected = 2_147_483_648; - const actual = comptime try grains.square(32); + const expected: usize = 2_147_483_648; + const actual = try grains.square(32); try testing.expectEqual(expected, actual); } test "grains on square 64" { - const expected = 9_223_372_036_854_775_808; - const actual = comptime try grains.square(64); + const expected: usize = 9_223_372_036_854_775_808; + const actual = try grains.square(64); try testing.expectEqual(expected, actual); } test "square 0 produces an error" { const expected = ChessboardError.IndexOutOfBounds; - const actual = comptime grains.square(0); + const actual = grains.square(0); try testing.expectError(expected, actual); } test "square greater than 64 produces an error" { const expected = ChessboardError.IndexOutOfBounds; - const actual = comptime grains.square(65); + const actual = grains.square(65); try testing.expectError(expected, actual); } test "returns the total number of grains on the board" { - const expected = 18_446_744_073_709_551_615; - const actual = comptime grains.total(); + const expected: usize = 18_446_744_073_709_551_615; + const actual = grains.total(); try testing.expectEqual(expected, actual); } diff --git a/exercises/practice/hamming/test_hamming.zig b/exercises/practice/hamming/test_hamming.zig index 1543d133..d5729c32 100644 --- a/exercises/practice/hamming/test_hamming.zig +++ b/exercises/practice/hamming/test_hamming.zig @@ -6,56 +6,54 @@ const DnaError = hamming.DnaError; test "empty strands" { const expected = DnaError.EmptyDnaStrands; - const actual = comptime hamming.compute("", ""); + const actual = hamming.compute("", ""); try testing.expectError(expected, actual); } test "single letter identical strands" { - const expected = 0; - const actual = comptime try hamming.compute("A", "A"); + const expected: usize = 0; + const actual = try hamming.compute("A", "A"); try testing.expectEqual(expected, actual); } test "single letter different strands" { - const expected = 1; - const actual = comptime try hamming.compute("G", "T"); + const expected: usize = 1; + const actual = try hamming.compute("G", "T"); try testing.expectEqual(expected, actual); } test "long identical strands" { - const expected = 0; - const actual = comptime try hamming - .compute("GGACTGAAATCTG", "GGACTGAAATCTG"); + const expected: usize = 0; + const actual = try hamming.compute("GGACTGAAATCTG", "GGACTGAAATCTG"); try testing.expectEqual(expected, actual); } test "long different strands" { - const expected = 9; - const actual = comptime try hamming - .compute("GGACGGATTCTG", "AGGACGGATTCT"); + const expected: usize = 9; + const actual = try hamming.compute("GGACGGATTCTG", "AGGACGGATTCT"); try testing.expectEqual(expected, actual); } test "disallow first strand longer" { const expected = DnaError.UnequalDnaStrands; - const actual = comptime hamming.compute("AATG", "AAA"); + const actual = hamming.compute("AATG", "AAA"); try testing.expectError(expected, actual); } test "disallow second strand longer" { const expected = DnaError.UnequalDnaStrands; - const actual = comptime hamming.compute("ATA", "AGTG"); + const actual = hamming.compute("ATA", "AGTG"); try testing.expectError(expected, actual); } test "disallow left empty strand" { const expected = DnaError.EmptyDnaStrands; - const actual = comptime hamming.compute("", "G"); + const actual = hamming.compute("", "G"); try testing.expectError(expected, actual); } test "disallow right empty strand" { const expected = DnaError.EmptyDnaStrands; - const actual = comptime hamming.compute("G", ""); + const actual = hamming.compute("G", ""); try testing.expectError(expected, actual); } diff --git a/exercises/practice/hello-world/test_hello_world.zig b/exercises/practice/hello-world/test_hello_world.zig index 4708d4e7..28287ce5 100644 --- a/exercises/practice/hello-world/test_hello_world.zig +++ b/exercises/practice/hello-world/test_hello_world.zig @@ -5,6 +5,6 @@ const hello_world = @import("hello_world.zig"); test "say hi" { const expected = "Hello, World!"; - const actual = comptime hello_world.hello(); + const actual = hello_world.hello(); try testing.expectEqualStrings(expected, actual); } diff --git a/exercises/practice/resistor-color-duo/test_resistor_color_duo.zig b/exercises/practice/resistor-color-duo/test_resistor_color_duo.zig index 5dea7dfe..11fa0788 100644 --- a/exercises/practice/resistor-color-duo/test_resistor_color_duo.zig +++ b/exercises/practice/resistor-color-duo/test_resistor_color_duo.zig @@ -6,42 +6,42 @@ const ColorBand = resistor_color_duo.ColorBand; test "brown and black" { const array = [_]ColorBand{ .brown, .black }; - const expected = 10; - const actual = comptime resistor_color_duo.colorCode(array); + const expected: usize = 10; + const actual = resistor_color_duo.colorCode(array); try testing.expectEqual(expected, actual); } test "blue and grey" { const array = [_]ColorBand{ .blue, .grey }; - const expected = 68; - const actual = comptime resistor_color_duo.colorCode(array); + const expected: usize = 68; + const actual = resistor_color_duo.colorCode(array); try testing.expectEqual(expected, actual); } test "yellow and violet" { const array = [_]ColorBand{ .yellow, .violet }; - const expected = 47; - const actual = comptime resistor_color_duo.colorCode(array); + const expected: usize = 47; + const actual = resistor_color_duo.colorCode(array); try testing.expectEqual(expected, actual); } test "white and red" { const array = [_]ColorBand{ .white, .red }; - const expected = 92; - const actual = comptime resistor_color_duo.colorCode(array); + const expected: usize = 92; + const actual = resistor_color_duo.colorCode(array); try testing.expectEqual(expected, actual); } test "orange and orange" { const array = [_]ColorBand{ .orange, .orange }; - const expected = 33; - const actual = comptime resistor_color_duo.colorCode(array); + const expected: usize = 33; + const actual = resistor_color_duo.colorCode(array); try testing.expectEqual(expected, actual); } test "black and brown, one-digit" { const array = [_]ColorBand{ .black, .brown }; - const expected = 1; - const actual = comptime resistor_color_duo.colorCode(array); + const expected: usize = 1; + const actual = resistor_color_duo.colorCode(array); try testing.expectEqual(expected, actual); } diff --git a/exercises/practice/resistor-color/test_resistor_color.zig b/exercises/practice/resistor-color/test_resistor_color.zig index 8fe734e3..756d1c53 100644 --- a/exercises/practice/resistor-color/test_resistor_color.zig +++ b/exercises/practice/resistor-color/test_resistor_color.zig @@ -5,20 +5,20 @@ const resistor_color = @import("resistor_color.zig"); const ColorBand = resistor_color.ColorBand; test "test black" { - const expected = 0; - const actual = comptime resistor_color.colorCode(.black); + const expected: usize = 0; + const actual = resistor_color.colorCode(.black); try testing.expectEqual(expected, actual); } test "test white" { - const expected = 9; - const actual = comptime resistor_color.colorCode(.white); + const expected: usize = 9; + const actual = resistor_color.colorCode(.white); try testing.expectEqual(expected, actual); } test "test orange" { - const expected = 3; - const actual = comptime resistor_color.colorCode(.orange); + const expected: usize = 3; + const actual = resistor_color.colorCode(.orange); try testing.expectEqual(expected, actual); } @@ -27,6 +27,6 @@ test "test colors" { .black, .brown, .red, .orange, .yellow, .green, .blue, .violet, .grey, .white, }; - const actual = comptime resistor_color.colors(); + const actual = resistor_color.colors(); try testing.expectEqualSlices(ColorBand, expected, actual); } diff --git a/exercises/practice/triangle/test_triangle.zig b/exercises/practice/triangle/test_triangle.zig index 85e17167..27f4afde 100644 --- a/exercises/practice/triangle/test_triangle.zig +++ b/exercises/practice/triangle/test_triangle.zig @@ -4,17 +4,17 @@ const testing = std.testing; const triangle = @import("triangle.zig"); test "equilateral all sides are equal" { - const actual = comptime try triangle.Triangle.init(2, 2, 2); + const actual = try triangle.Triangle.init(2, 2, 2); try testing.expect(actual.isEquilateral()); } test "equilateral any side is unequal" { - const actual = comptime try triangle.Triangle.init(2, 3, 2); + const actual = try triangle.Triangle.init(2, 3, 2); try testing.expect(!actual.isEquilateral()); } test "equilateral no sides are equal" { - const actual = comptime try triangle.Triangle.init(5, 4, 6); + const actual = try triangle.Triangle.init(5, 4, 6); try testing.expect(!actual.isEquilateral()); } @@ -24,32 +24,32 @@ test "equilateral all zero sies is not a triangle" { } test "equilateral sides may be floats" { - const actual = comptime try triangle.Triangle.init(0.5, 0.5, 0.5); + const actual = try triangle.Triangle.init(0.5, 0.5, 0.5); try testing.expect(actual.isEquilateral()); } test "isosceles last two sides are equal" { - const actual = comptime try triangle.Triangle.init(3, 4, 4); + const actual = try triangle.Triangle.init(3, 4, 4); try testing.expect(actual.isIsosceles()); } test "isosceles first two sides are equal" { - const actual = comptime try triangle.Triangle.init(4, 4, 3); + const actual = try triangle.Triangle.init(4, 4, 3); try testing.expect(actual.isIsosceles()); } test "isosceles first and last sides are equal" { - const actual = comptime try triangle.Triangle.init(4, 3, 4); + const actual = try triangle.Triangle.init(4, 3, 4); try testing.expect(actual.isIsosceles()); } test "equilateral triangles are also isosceles" { - const actual = comptime try triangle.Triangle.init(4, 3, 4); + const actual = try triangle.Triangle.init(4, 3, 4); try testing.expect(actual.isIsosceles()); } test "isosceles no sides are equal" { - const actual = comptime try triangle.Triangle.init(2, 3, 4); + const actual = try triangle.Triangle.init(2, 3, 4); try testing.expect(!actual.isIsosceles()); } @@ -69,32 +69,32 @@ test "isosceles third triangle inequality violation" { } test "isosceles sides may be floats" { - const actual = comptime try triangle.Triangle.init(0.5, 0.4, 0.5); + const actual = try triangle.Triangle.init(0.5, 0.4, 0.5); try testing.expect(actual.isIsosceles()); } test "scalene no sides are equal" { - const actual = comptime try triangle.Triangle.init(5, 4, 6); + const actual = try triangle.Triangle.init(5, 4, 6); try testing.expect(actual.isScalene()); } test "scalene all sides are equal" { - const actual = comptime try triangle.Triangle.init(4, 4, 4); + const actual = try triangle.Triangle.init(4, 4, 4); try testing.expect(!actual.isScalene()); } test "scalene first and second sides are equal" { - const actual = comptime try triangle.Triangle.init(4, 4, 3); + const actual = try triangle.Triangle.init(4, 4, 3); try testing.expect(!actual.isScalene()); } test "scalene first and third sides are equal" { - const actual = comptime try triangle.Triangle.init(3, 4, 3); + const actual = try triangle.Triangle.init(3, 4, 3); try testing.expect(!actual.isScalene()); } test "scalene second and third sides are equal" { - const actual = comptime try triangle.Triangle.init(4, 3, 3); + const actual = try triangle.Triangle.init(4, 3, 3); try testing.expect(!actual.isScalene()); } @@ -104,6 +104,6 @@ test "scalene may not violate triangle inequality" { } test "scalene sides may be floats" { - const actual = comptime try triangle.Triangle.init(0.5, 0.4, 0.6); + const actual = try triangle.Triangle.init(0.5, 0.4, 0.6); try testing.expect(actual.isScalene()); }