mirror of
https://github.com/sagiegurari/duckscript
synced 2024-09-15 22:19:51 +00:00
36 lines
730 B
Plaintext
36 lines
730 B
Plaintext
|
|
fn test_echo_with_output
|
|
output = exec echo hello world
|
|
|
|
stdout = trim ${output.stdout}
|
|
stderr = trim ${output.stderr}
|
|
exit_code = set ${output.code}
|
|
|
|
assert_eq ${stdout} "hello world"
|
|
assert_eq ${stderr} ""
|
|
assert_eq ${exit_code} 0
|
|
end
|
|
|
|
fn test_echo_with_input
|
|
if not is_windows
|
|
output = exec --input "1 2 3" cat
|
|
|
|
stdout = trim ${output.stdout}
|
|
stderr = trim ${output.stderr}
|
|
exit_code = set ${output.code}
|
|
|
|
assert_eq ${stdout} "1 2 3"
|
|
assert_eq ${stderr} ""
|
|
assert_eq ${exit_code} 0
|
|
end
|
|
end
|
|
|
|
fn test_echo_without_output
|
|
exec echo hello world
|
|
end
|
|
|
|
fn test_echo_with_fail_on_error_flag
|
|
exec --fail-on-error echo hello world
|
|
end
|
|
|