aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2020-03-05 16:02:26 +1100
committerdaurnimator <quae@daurnimator.com>2020-03-05 16:02:26 +1100
commite9c3b65bf4c7dc6c5fc07b9bcec195a5fe709db8 (patch)
tree6cc1c5a5571a6a593e86220c8dd877bd5318b308 /lib
parent488ba1560fb80c1115b3b4794031859c0063ba3e (diff)
downloadzig-e9c3b65bf4c7dc6c5fc07b9bcec195a5fe709db8.tar.gz
zig-e9c3b65bf4c7dc6c5fc07b9bcec195a5fe709db8.zip
std: use testing.expectEqual in math.absCast tests
Diffstat (limited to 'lib')
-rw-r--r--lib/std/math.zig17
1 files changed, 5 insertions, 12 deletions
diff --git a/lib/std/math.zig b/lib/std/math.zig
index a411b58fac..ed13e3cd27 100644
--- a/lib/std/math.zig
+++ b/lib/std/math.zig
@@ -697,18 +697,11 @@ pub fn absCast(x: var) switch(@typeInfo(@TypeOf(x))) {
}
test "math.absCast" {
- testing.expect(absCast(@as(i1, -1)) == 1);
-
- testing.expect(absCast(@as(i32, -999)) == 999);
- testing.expect(@TypeOf(absCast(@as(i32, -999))) == u32);
-
- testing.expect(absCast(@as(i32, 999)) == 999);
- testing.expect(@TypeOf(absCast(@as(i32, 999))) == u32);
-
- testing.expect(absCast(@as(i32, minInt(i32))) == -minInt(i32));
- testing.expect(@TypeOf(absCast(@as(i32, minInt(i32)))) == u32);
-
- testing.expect(absCast(-999) == 999);
+ testing.expectEqual(@as(u1, 1), absCast(@as(i1, -1)));
+ testing.expectEqual(@as(u32, 999), absCast(@as(i32, -999)));
+ testing.expectEqual(@as(u32, 999), absCast(@as(i32, 999)));
+ testing.expectEqual(@as(u32, -minInt(i32)), absCast(@as(i32, minInt(i32))));
+ testing.expectEqual(999, absCast(-999));
}
/// Returns the negation of the integer parameter.