aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/root.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/root.zig')
-rw-r--r--src/root.zig7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/root.zig b/src/root.zig
index cce3ce5..650acdf 100644
--- a/src/root.zig
+++ b/src/root.zig
@@ -42,6 +42,13 @@ fn testRunMultiple(expected: []const []const u8, input: []const u8, query: []con
try std.testing.expectEqual(null, try runtime.next());
}
+test "literals" {
+ try testRun("\"hello\"", "null", "\"hello\"");
+ try testRun("\"\"", "null", "\"\"");
+ try testRun("\"hello\\nworld\"", "null", "\"hello\\nworld\"");
+ try testRun("\"hello\"", "{\"a\":1}", "\"hello\"");
+}
+
test "identity filter" {
try testRun("null", "null", ".");
try testRun("false", "false", ".");