mirror of
https://codeberg.org/ziglings/exercises.git
synced 2025-01-14 10:46:30 +00:00
18 lines
624 B
Diff
18 lines
624 B
Diff
--- exercises/102_testing.zig 2023-10-03 22:15:22.125574535 +0200
|
|
+++ answers/102_testing.zig 2023-10-05 20:04:07.302771500 +0200
|
|
@@ -83,7 +83,7 @@
|
|
// an error that you need
|
|
// to correct.
|
|
test "sub" {
|
|
- try testing.expect(sub(10, 5) == 6);
|
|
+ try testing.expect(sub(10, 5) == 5);
|
|
|
|
try testing.expect(sub(3, 1.5) == 1.5);
|
|
}
|
|
@@ -108,5 +108,5 @@
|
|
// Now we test if the function returns an error
|
|
// if we pass a zero as denominator.
|
|
// But which error needs to be tested?
|
|
- try testing.expectError(error.???, divide(15, 0));
|
|
+ try testing.expectError(error.DivisionByZero, divide(15, 0));
|
|
}
|