aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/root.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/root.zig')
-rw-r--r--src/root.zig10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/root.zig b/src/root.zig
index f75f062..e4df465 100644
--- a/src/root.zig
+++ b/src/root.zig
@@ -70,3 +70,13 @@ test "object key filter" {
try testRun("[1,2,3]", allocator, "{\"arr\":[1,2,3]}", ".arr");
try testRun("{\"bar\":true}", allocator, "{\"foo\":{\"bar\":true}}", ".foo");
}
+
+test "addition" {
+ var debug_allocator = std.heap.DebugAllocator(.{}).init;
+ defer std.debug.assert(debug_allocator.deinit() == .ok);
+ const allocator = debug_allocator.allocator();
+
+ try testRun("579", allocator, "null", "123 + 456");
+ try testRun("35", allocator, "{\"a\":12,\"b\":23}", ".a + .b");
+ try testRun("12", allocator, "[1,2,3]", ".[1] + 10");
+}