Tree @master (Download .tar.gz)
- ..
- cat.py
- crlf.py
- echo.py
- eg.silly-interpreter
- fail.py
- silly-interpreter.py
- test-appliances-a.markdown
- test-appliances-b.markdown
- test-appliances.expected
- test-bad-indentation.expected
- test-bad-indentation.markdown
- test-crlf.expected
- test-crlf.markdown
- test-err-no-stderr.expected
- test-err-no-stderr.markdown
- test-freestyle-format.expected
- test-freestyle-format.markdown
- test-ill-formed.expected
- test-ill-formed.markdown
- test-implementations-global-a.markdown
- test-implementations-global-b.markdown
- test-implementations-global.expected
- test-input-sections.expected
- test-input-sections.markdown
- test-no-eol.expected
- test-no-eol.markdown
- test-no-functionality-leak-a.markdown
- test-no-functionality-leak-b.markdown
- test-no-functionality-leak.expected
- test-no-functionality.expected
- test-no-functionality.markdown
- test-no-test-body.expected
- test-no-test-body.markdown
- test-no-tests.expected
- test-no-tests.markdown
- test-pass-fail.expected
- test-pass-fail.markdown
- test-shared-body.expected
- test-shared-body.markdown
- test-stdout-stderr.expected
- test-stdout-stderr.markdown
- test-substring-error.expected
- test-substring-error.markdown
- test-utf8.expected
- test-utf8.markdown
- test-var-subst.expected
- test-var-subst.markdown
test-stdout-stderr.markdown @master — view markup · raw · history · blame
Falderal Test: Standard output and standard error
When we have a test that expects a successful result, the expected text is matched against standard output.
-> Functionality "Succeed" is implemented by shell command
-> "python3 fail.py %(test-body-text) bar 0"
-> Tests for functionality "Succeed"
| foo
= foo
If you wish to match the expected result against both standard output and standard error, it's up to you to redirect them.
-> Functionality "Succeed/All" is implemented by shell command
-> "python3 fail.py %(test-body-text) bar 0 2>&1"
-> Tests for functionality "Succeed/All"
| foo
= foo
= bar
When we have a test that expects an error result, the expected text is matched against standard error.
-> Functionality "Fail" is implemented by shell command
-> "python3 fail.py foo %(test-body-text) 1"
-> Tests for functionality "Fail"
| bar
? bar
If you wish to match the expected error against both standard output and standard error, it's up to you to redirect them.
-> Functionality "Fail/All" is implemented by shell command
-> "python3 fail.py foo %(test-body-text) 1 1>&2"
-> Tests for functionality "Fail/All"
| bar
? foo
? bar