summaryrefslogtreecommitdiff
path: root/test/asset/shell
diff options
context:
space:
mode:
Diffstat (limited to 'test/asset/shell')
-rw-r--r--test/asset/shell/echo.et25
-rw-r--r--test/asset/shell/pipe.et25
-rw-r--r--test/asset/shell/spawn.et13
3 files changed, 63 insertions, 0 deletions
diff --git a/test/asset/shell/echo.et b/test/asset/shell/echo.et
new file mode 100644
index 0000000..1e48cac
--- /dev/null
+++ b/test/asset/shell/echo.et
@@ -0,0 +1,25 @@
+test Echo:
+ node n
+ let echo_str = "echo"
+ let space_str = "a b"
+
+ shell on n as sh:
+ echo a b c
+ echo "a b c"
+ echo 'a b d'
+ echo a b " c d"
+
+ /bin/echo "abcd" xyz
+ "echo" a"a" "b"c d
+ $echo_str b $echo_str c
+
+ echo "$space_str"
+ echo $space_str
+ echo '$space_str'
+
+ echo \$ \" \\
+ echo "\""\""a"
+ echo "'" '"' '\\\' "\\"
+ echo a\ b\ \ c
+
+ echo \" \' \\ \$ \# \| \> \< \; \[ \] \{ \} \( \) \* \? \~ \& \!
diff --git a/test/asset/shell/pipe.et b/test/asset/shell/pipe.et
new file mode 100644
index 0000000..a00360a
--- /dev/null
+++ b/test/asset/shell/pipe.et
@@ -0,0 +1,25 @@
+test Pipe:
+ node n
+ 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/asset/shell/spawn.et b/test/asset/shell/spawn.et
new file mode 100644
index 0000000..9d48e72
--- /dev/null
+++ b/test/asset/shell/spawn.et
@@ -0,0 +1,13 @@
+test ShellTrue:
+ node n
+ shell on n:
+ true
+
+ shell on n as sh:
+ true
+
+
+test ShellFalse:
+ node n
+ shell on n as sh:
+ false