aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/root.zig
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-01-17 23:31:40 +0900
committernsfisis <nsfisis@gmail.com>2026-01-18 00:37:54 +0900
commit6739144edaf34d10e0c0901231b196f377007934 (patch)
tree015d78a96fa66390fe332226a1f27e7a55bda52e /src/root.zig
parent0295edea4c2d5e6f2e0a6761483cc9e2c64544f8 (diff)
downloadzgjq-6739144edaf34d10e0c0901231b196f377007934.tar.gz
zgjq-6739144edaf34d10e0c0901231b196f377007934.tar.zst
zgjq-6739144edaf34d10e0c0901231b196f377007934.zip
implement addition
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");
+}