aboutsummaryrefslogtreecommitdiff
path: root/test/behavior
diff options
context:
space:
mode:
Diffstat (limited to 'test/behavior')
-rw-r--r--test/behavior/math.zig14
-rw-r--r--test/behavior/math_stage1.zig14
2 files changed, 14 insertions, 14 deletions
diff --git a/test/behavior/math.zig b/test/behavior/math.zig
index 56fbdc124d..8ca757b0cc 100644
--- a/test/behavior/math.zig
+++ b/test/behavior/math.zig
@@ -235,3 +235,17 @@ test "comptime_int param and return" {
fn comptimeAdd(comptime a: comptime_int, comptime b: comptime_int) comptime_int {
return a + b;
}
+
+test "binary not" {
+ try expect(comptime x: {
+ break :x ~@as(u16, 0b1010101010101010) == 0b0101010101010101;
+ });
+ try expect(comptime x: {
+ break :x ~@as(u64, 2147483647) == 18446744071562067968;
+ });
+ try testBinaryNot(0b1010101010101010);
+}
+
+fn testBinaryNot(x: u16) !void {
+ try expect(~x == 0b0101010101010101);
+}
diff --git a/test/behavior/math_stage1.zig b/test/behavior/math_stage1.zig
index f0c160ebc4..caec185414 100644
--- a/test/behavior/math_stage1.zig
+++ b/test/behavior/math_stage1.zig
@@ -219,20 +219,6 @@ const DivResult = struct {
remainder: u64,
};
-test "binary not" {
- try expect(comptime x: {
- break :x ~@as(u16, 0b1010101010101010) == 0b0101010101010101;
- });
- try expect(comptime x: {
- break :x ~@as(u64, 2147483647) == 18446744071562067968;
- });
- try testBinaryNot(0b1010101010101010);
-}
-
-fn testBinaryNot(x: u16) !void {
- try expect(~x == 0b0101010101010101);
-}
-
test "small int addition" {
var x: u2 = 0;
try expect(x == 0);