aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Arcangeli <stevearc@stevearc.com>2024-08-20 09:27:22 -0700
committerSteven Arcangeli <stevearc@stevearc.com>2024-08-20 09:27:22 -0700
commit62eba813b7501b39612146cbf29cd07f1d4ac29c (patch)
tree02c9e47edc44c8d1b8af60916635e8e87a9892cd
parent6047101486f6c0ae44b444424c0e45ed8053c840 (diff)
ci: ensure test runs properly on mac and on linux CImaster
-rw-r--r--tests/runner_spec.lua20
1 files changed, 15 insertions, 5 deletions
diff --git a/tests/runner_spec.lua b/tests/runner_spec.lua
index 2e6fe0e..a7550ac 100644
--- a/tests/runner_spec.lua
+++ b/tests/runner_spec.lua
@@ -1,5 +1,6 @@
require("plenary.async").tests.add_to_env()
local conform = require("conform")
+local fs = require("conform.fs")
local runner = require("conform.runner")
local test_util = require("tests.test_util")
local util = require("conform.util")
@@ -387,11 +388,20 @@ print("a")
end)
it("can run the format command in the shell", function()
- conform.formatters.test = {
- command = "seq",
- args = "3 1 | sort",
- }
- run_formatter_test("", "1\n2\n3")
+ -- Mac echo doesn't seem to support -e, but the linux ci runner apparently doesn't have seq
+ if fs.is_mac then
+ conform.formatters.test = {
+ command = "seq",
+ args = "3 1 | sort",
+ }
+ run_formatter_test("", "1\n2\n3")
+ else
+ conform.formatters.test = {
+ command = "echo",
+ args = '-e "World\nHello" | sort',
+ }
+ run_formatter_test("", "Hello\nWorld")
+ end
end)
end)
end)