diff options
Diffstat (limited to 'src/test/strings.zig')
| -rw-r--r-- | src/test/strings.zig | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/test/strings.zig b/src/test/strings.zig index 629bc46..8f640f4 100644 --- a/src/test/strings.zig +++ b/src/test/strings.zig @@ -4,14 +4,14 @@ const testing = std.testing; pub const value = @import("../zisp/value.zig"); -test "istr" { - const istr = value.istr; - const fx = value.fixnum; +const istr = value.istr; +const fx = value.fixnum; +test "istr" { const s1 = "foo bar baz"; - const v1 = istr.intern(s1, false); + const v1 = istr.intern(s1); const v1_len: usize = @intCast(fx.unpack(istr.len(v1))); - try testing.expectEqualStrings(s1, istr.getHeader(v1).bytes()); + try testing.expectEqualStrings(s1, istr.assert(v1).bytes()); try testing.expectEqual(s1.len, v1_len); const file = try std.fs.cwd().openFile("src/test/data/string.txt", .{}); @@ -19,12 +19,12 @@ test "istr" { var s2_buf: [4096]u8 = undefined; const s2_len = try file.readAll(&s2_buf); var s2: []u8 = s2_buf[0..s2_len]; - const v2 = istr.intern(s2, false); + const v2 = istr.intern(s2); const v2_len: usize = @intCast(fx.unpack(istr.len(v2))); var s2_orig_buf: [4096]u8 = undefined; @memcpy(&s2_orig_buf, &s2_buf); const s2_orig = s2_orig_buf[0..s2_len]; s2[0] = s2[0] +% 1; - try testing.expectEqualStrings(s2_orig, istr.getHeader(v2).bytes()); + try testing.expectEqualStrings(s2_orig, istr.assert(v2).bytes()); try testing.expectEqual(s2_len, v2_len); } |
