From 5c7f9d2ddba764b18182c77462e6902721befbb0 Mon Sep 17 00:00:00 2001 From: phynalle Date: Mon, 8 Aug 2022 22:00:19 +0900 Subject: Add zig tests for newline --- tests/indent/zig/pr-3269.zig | 10 ++++++++++ tests/indent/zig_spec.lua | 22 ++++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 tests/indent/zig/pr-3269.zig create mode 100644 tests/indent/zig_spec.lua (limited to 'tests') 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) -- cgit v1.2.3-70-g09d2