Skip to content

Commit

Permalink
Clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
malcolmstill committed Mar 31, 2024
1 parent 1385108 commit ee7973c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion biscuit-builder/src/term.zig
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ pub const Term = union(TermTag) {
.integer => |n| try writer.print("{}", .{n}),
.bool => |b| if (b) try writer.print("true", .{}) else try writer.print("false", .{}),
.date => |n| try writer.print("{}", .{n}),
.bytes => unreachable,
.bytes => |b| try writer.print("{x}", .{b}),
.set => |s| {
try writer.print("[", .{});

Expand Down
4 changes: 3 additions & 1 deletion biscuit-parser/src/parser.zig
Original file line number Diff line number Diff line change
Expand Up @@ -1023,7 +1023,7 @@ test "parse predicates" {
const arena = arena_state.allocator();

{
var parser = Parser.init(arena, "read(-1, 1, \"hello world\", hex:abcd, true, false, $foo, 2024-03-30T20:48:00Z, [1, 2, 3], [])");
var parser = Parser.init(arena, "read(-1, 1, \"hello world\", hex:abcd, true, false, $foo, 2024-03-30T20:48:00Z, [1, 2, 3], [], hex:)");
const predicate = try parser.predicate(.rule);

try testing.expectEqualStrings("read", predicate.name);
Expand All @@ -1043,6 +1043,8 @@ test "parse predicates" {

const empty_set = predicate.terms.items[9].set;
try testing.expectEqual(0, empty_set.count());

try testing.expectEqualStrings("", predicate.terms.items[10].bytes);
}

{
Expand Down

0 comments on commit ee7973c

Please sign in to comment.