From 62eba813b7501b39612146cbf29cd07f1d4ac29c Mon Sep 17 00:00:00 2001 From: Steven Arcangeli Date: Tue, 20 Aug 2024 09:27:22 -0700 Subject: ci: ensure test runs properly on mac and on linux CI --- tests/runner_spec.lua | 20 +++++++++++++++----- 1 file 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) -- cgit v1.2.3-70-g09d2