diff options
author | Lars Wirzenius <liw@liw.fi> | 2021-02-17 08:49:38 +0200 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2021-02-18 10:42:40 +0200 |
commit | a85e7d15c57c11d8286656531c7394681fb855d9 (patch) | |
tree | 872ec655a99606e8fe2147a4b8d4fb3e1aeb186b /echo.sh | |
parent | 4b9edb354297353cbbe38575553ca1351f68d380 (diff) | |
download | subplot-a85e7d15c57c11d8286656531c7394681fb855d9.tar.gz |
refactor: move echo and muck examples under new examples/ directory
Diffstat (limited to 'echo.sh')
-rw-r--r-- | echo.sh | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/echo.sh b/echo.sh deleted file mode 100644 index 0564d42..0000000 --- a/echo.sh +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/bash - -_run() -{ - if "$@" < /dev/null > stdout 2> stderr - then - ctx_set exit 0 - else - ctx_set exit "$?" - fi - ctx_set stdout "$(cat stdout)" - ctx_set stderr "$(cat stderr)" -} - -run_echo_without_args() -{ - _run echo -} - -run_echo_with_args() -{ - args="$(cap_get args)" - _run echo "$args" -} - -exit_code_is() -{ - actual_exit="$(ctx_get exit)" - wanted_exit="$(cap_get exit_code)" - assert_eq "$actual_exit" "$wanted_exit" -} - -stdout_is_a_newline() -{ - stdout="$(ctx_get stdout)" - assert_eq "$stdout" "$(printf '\n')" -} - -stdout_is_text() -{ - stdout="$(ctx_get stdout)" - text="$(cap_get text)" - assert_contains "$stdout" "$text" -} - -stderr_is_empty() -{ - stderr="$(ctx_get stderr)" - assert_eq "$stderr" "" -} |