mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-24 23:23:58 +00:00
Shell: Add some tests for builtin redirection
This commit is contained in:
parent
c589625418
commit
154ffa3f5f
Notes:
sideshowbarker
2024-07-19 03:36:08 +09:00
Author: https://github.com/alimpfard Commit: https://github.com/SerenityOS/serenity/commit/154ffa3f5f1 Pull-request: https://github.com/SerenityOS/serenity/pull/3144 Issue: https://github.com/SerenityOS/serenity/issues/3072 Reviewed-by: https://github.com/awesomekling
1 changed files with 17 additions and 0 deletions
17
Shell/Tests/builtin-redir.sh
Normal file
17
Shell/Tests/builtin-redir.sh
Normal file
|
@ -0,0 +1,17 @@
|
|||
#!/bin/sh
|
||||
|
||||
rm -rf shell-test
|
||||
mkdir -p shell-test
|
||||
cd shell-test
|
||||
|
||||
time sleep 1 2>timeerr >timeout
|
||||
cat timeout
|
||||
# We cannot be sure about the values, so just assert that they're not empty.
|
||||
test -n "$(cat timeerr)" || echo "Failure: 'time' stderr output not redirected correctly" && exit 1
|
||||
test -e timeout || echo "Failure: 'time' stdout output not redirected correctly" && exit 1
|
||||
|
||||
time ls 2> /dev/null | head > timeout
|
||||
test -n "$(cat timeout)" || echo "Failure: 'time' stdout not piped correctly" && exit 1
|
||||
|
||||
cd ..
|
||||
rm -rf shell-test # TODO: Remove this file at the end once we have `trap'
|
Loading…
Reference in a new issue