Code:
const std = @import("std");
test {
const b = 1;
const a = 10;
try std.testing.expect(@intFromPtr(&a) != @intFromPtr(&b));
}
When I run the test.
Test [1/1] test_0... FAIL (TestUnexpectedResult)
/opt/homebrew/Cellar/zig/0.11.0/lib/zig/std/testing.zig:515:14: 0x1000007a3 in expect (test)
if (!ok) return error.TestUnexpectedResult;
^
/Users/santiago.cabrera/dev/zig/computer-enhance/part3/src/demo.zig:6:5: 0x1000008f3 in test_0 (test)
try std.testing.expect(@intFromPtr(&a) != @intFromPtr(&b));
^
0 passed; 0 skipped; 1 failed.
Why would the pointers to these two be the same?