diff options
| author | Saikari <[email protected]> | 2026-02-02 11:32:51 +0300 |
|---|---|---|
| committer | Saikari <[email protected]> | 2026-02-02 11:32:51 +0300 |
| commit | 586227cf172385c9abebe6f19c2343bbf7f94a2c (patch) | |
| tree | 0410d84f60dbf10309bfe4d6342bb7d05b9f53c3 /tests/modules/stdin/test.lua | |
| parent | cd45a05d8b83235f8e2c421769f12afa063ce669 (diff) | |
refactor: improve stdin command formatting for better cross-platform compatibility
Diffstat (limited to 'tests/modules/stdin/test.lua')
| -rw-r--r-- | tests/modules/stdin/test.lua | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/modules/stdin/test.lua b/tests/modules/stdin/test.lua index c6544a6b1..e2d139e87 100644 --- a/tests/modules/stdin/test.lua +++ b/tests/modules/stdin/test.lua @@ -47,7 +47,10 @@ function main(t) end end - local run_stdin = string.format('env "%s" l --stdin', xmake) + local run_stdin = string.format('"%s" l --stdin', xmake) + if not is_host("windows") then + run_stdin = string.format('env "%s" l --stdin', xmake) + end -- Fix pwsh and cosmocc "exec format error" for MacOS if is_ape and not is_host("windows") then run_stdin = string.format("sh -c ' \"%s\" l --stdin '", xmake) @@ -100,7 +103,7 @@ function main(t) test_shell("cmd_calc", string.format('cmd /c echo "local f = 1+1; print(f)" | %s l --stdin', xmake), "2") test_shell( "cmd_multi", - string.format("cmd /c echo \"print('line1')\\nprint('line2')\" | %s l --stdin", xmake), + string.format("cmd /c \"(echo print 'line1'& echo print 'line2')\" | %s l --stdin", xmake), "line1[\r\n]+line2" ) -- Test powershell (if available) |
