aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/indent/zig/pr-3269.zig10
-rw-r--r--tests/indent/zig_spec.lua22
2 files changed, 32 insertions, 0 deletions
diff --git a/tests/indent/zig/pr-3269.zig b/tests/indent/zig/pr-3269.zig
new file mode 100644
index 000000000..65b6b64c3
--- /dev/null
+++ b/tests/indent/zig/pr-3269.zig
@@ -0,0 +1,10 @@
+// https://github.com/nvim-treesitter/nvim-treesitter/pull/3269
+const std = @import("std");
+
+pub fn main() anyerror!void {
+ std.log.info("All your codebase are belong to us.", .{});
+}
+
+test "basic test" {
+ try std.testing.expectEqual(10, 3 + 7);
+}
diff --git a/tests/indent/zig_spec.lua b/tests/indent/zig_spec.lua
new file mode 100644
index 000000000..7a6f45d00
--- /dev/null
+++ b/tests/indent/zig_spec.lua
@@ -0,0 +1,22 @@
+local Runner = require("tests.indent.common").Runner
+--local XFAIL = require("tests.indent.common").XFAIL
+
+local run = Runner:new(it, "tests/indent/zig", {
+ tabstop = 4,
+ shiftwidth = 4,
+ softtabstop = 4,
+ expandtab = false,
+})
+
+describe("indent Zig:", function()
+ describe("whole file:", function()
+ run:whole_file(".", {
+ expected_failures = {},
+ })
+ end)
+
+ describe("new lines:", function()
+ run:new_line("pr-3269.zig", { on_line = 5, text = "return;", indent = 4 })
+ run:new_line("pr-3269.zig", { on_line = 6, text = "", indent = 0 })
+ end)
+end)