diff options
Diffstat (limited to 'src/test/values.zig')
| -rw-r--r-- | src/test/values.zig | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/test/values.zig b/src/test/values.zig index 4a62afa..153b53f 100644 --- a/src/test/values.zig +++ b/src/test/values.zig @@ -82,13 +82,13 @@ test "rune" { const r = value.rune.pack("test"); try testing.expect(value.rune.check(r)); - const s = value.rune.unpack(r); - try testing.expectEqualStrings("test", s.slice()); + const s = value.rune.unpack(&r); + try testing.expectEqualStrings("test", s); } const SstrImpl = struct { SstrPack, SstrUnpack }; const SstrPack = *const fn ([]const u8) Value; -const SstrUnpack = *const fn (Value) value.ShortString; +const SstrUnpack = *const fn (*const Value) []const u8; test "sstr" { const impls = [_]SstrImpl{ @@ -123,17 +123,17 @@ fn testSstr(impl: SstrImpl) !void { const ss2 = pack("123"); const ss3 = pack("123456"); - const s1 = unpack(ss1); - const s2 = unpack(ss2); - const s3 = unpack(ss3); + const s1 = unpack(&ss1); + const s2 = unpack(&ss2); + const s3 = unpack(&ss3); try testing.expect(value.sstr.check(ss1)); try testing.expect(value.sstr.check(ss2)); try testing.expect(value.sstr.check(ss3)); - try testing.expectEqualStrings("1", s1.slice()); - try testing.expectEqualStrings("123", s2.slice()); - try testing.expectEqualStrings("123456", s3.slice()); + try testing.expectEqualStrings("1", s1); + try testing.expectEqualStrings("123", s2); + try testing.expectEqualStrings("123456", s3); } fn benchmarkSstr(impl: SstrImpl, id: usize, iters: usize) !void { |
