diff options
| author | ruki <[email protected]> | 2026-02-03 10:03:26 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2026-02-03 10:03:26 +0800 |
| commit | 7d1615632117405b5078aef5a3ecdb6dd5d0edf0 (patch) | |
| tree | caf0013630bbb544e867e3562ec82893b0e2245b /tests/modules/stdin/test.lua | |
| parent | 2ddc34d3ecfe4b3cdbf8370fdbcc4c46f61f54d0 (diff) | |
Update test.lua
Diffstat (limited to 'tests/modules/stdin/test.lua')
| -rw-r--r-- | tests/modules/stdin/test.lua | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/modules/stdin/test.lua b/tests/modules/stdin/test.lua index d739e9bab..60e8ca1e5 100644 --- a/tests/modules/stdin/test.lua +++ b/tests/modules/stdin/test.lua @@ -12,7 +12,7 @@ end function _run_cmd(t, name, cmd, expect) if is_host("windows") then local xmake = path.translate(os.programfile()) - local run_stdin = string.format('"%s" l --stdin', xmake) + local run_stdin = string.format('%s l --stdin', xmake) local outdata = os.iorunv("cmd", {"/c", cmd .. " | " .. run_stdin}) or "" t:are_equal(outdata:trim(), expect) end @@ -21,7 +21,7 @@ end function _run_pwsh(t, name, cmd, expect) if is_host("windows") then local xmake = path.translate(os.programfile()) - local run_stdin = string.format('"%s" l --stdin', xmake) + local run_stdin = string.format('%s l --stdin', xmake) local pwsh = find_tool("powershell") if pwsh then local outdata = os.iorunv(pwsh.program, {"-c", cmd .. " | " .. run_stdin}) or "" @@ -40,13 +40,13 @@ end function test_cmd(t) _run_cmd(t, "cmd_single", "echo print 'hello_cmd'", "hello_cmd") _run_cmd(t, "cmd_calc", "echo local f = 1+1; print(f)", "2") - _run_cmd(t, "cmd_multi_lines", "(echo print 'line1'&& echo print 'line2')", "line1\r\nline2") - _run_cmd(t, "cmd_multi_semicolon", "echo \"print('semi1'); print('semi2')\"", "semi1\r\nsemi2") + _run_cmd(t, "cmd_multi_lines", "(echo print 'line1' && echo print 'line2')", "line1\nline2") + _run_cmd(t, "cmd_multi_semicolon", "echo print('semi1'); print('semi2')", "semi1\nsemi2") end function test_pwsh(t) _run_pwsh(t, "pwsh_single", "echo \"print('hello_pwsh')\"", "hello_pwsh") _run_pwsh(t, "pwsh_calc", "echo \"local f = 1+1; print(f)\"", "2") _run_pwsh(t, "pwsh_main", "echo \"function main() print('in_pwsh_main') end\"", "in_pwsh_main") - _run_pwsh(t, "pwsh_multi", "echo \"print('pline1')\"; echo \"print('pline2')\"", "pline1\r\npline2") + _run_pwsh(t, "pwsh_multi", "echo \"print('pline1')\"; echo \"print('pline2')\"", "pline1\npline2") end |
