summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/asset/shell/pipe.et20
-rw-r--r--test/script/shell.et22
2 files changed, 41 insertions, 1 deletions
diff --git a/test/asset/shell/pipe.et b/test/asset/shell/pipe.et
index 64dcb07..a00360a 100644
--- a/test/asset/shell/pipe.et
+++ b/test/asset/shell/pipe.et
@@ -3,3 +3,23 @@ test Pipe:
shell on n as sh:
echo abcd | grep -o '[bc]*'
echo abcd | grep -o '[bcd]*' | grep -o '[ab]*'
+
+
+test Redirect:
+ node n
+ shell on n as sh:
+ echo a > file
+ echo b > file
+ echo c >> file
+ echo x
+ cat file
+ echo y
+ cat < file
+ echo z
+
+test PipeRedirect:
+ node n
+ shell on n as sh:
+ echo abcdefghi | grep -o '[b-h]*' | grep -o '[a-g]*' > file
+ cat < file | grep -o '[acegi]' | cat > file2
+ cat file2 - < file
diff --git a/test/script/shell.et b/test/script/shell.et
index 2fe4ec3..282df37 100644
--- a/test/script/shell.et
+++ b/test/script/shell.et
@@ -74,7 +74,27 @@ test ShellPipe:
expect_next_stdout from p:
"bc"
"b"
-
with p:
expect /run-test-result Pipe done/
+
+ expect_next_stdout from p:
+ "x"
+ "b"
+ "c"
+ "y"
+ "b"
+ "c"
+ "z"
+ with p:
+ expect /run-test-result Redirect done/
+
+ expect_next_stdout from p:
+ "c"
+ "e"
+ "g"
+ "bcdefg"
+ with p:
+ expect /run-test-result PipeRedirect done/
+
+ with p:
expect /run-all-done/