aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorGravatar BanceDev 2024-09-26 23:08:46 -0400
committerGravatar BanceDev 2024-09-26 23:08:46 -0400
commitcd554877c5f57cdebc919cd889c1812773446a1e (patch)
tree6e4f4ca5a55a7faf859cd9cc6cbb897d75d0fa7e /test
parentv0.2.1 (diff)
fixed crash in redirect operator
Diffstat (limited to 'test')
-rw-r--r--test/chaining_test.lua (renamed from test/pipes_test.lua)37
-rw-r--r--test/run_tests.lua4
2 files changed, 39 insertions, 2 deletions
diff --git a/test/pipes_test.lua b/test/chaining_test.lua
index 46000e3..83f3e76 100644
--- a/test/pipes_test.lua
+++ b/test/chaining_test.lua
@@ -22,4 +22,41 @@ if lush.exec('cat "example.lua" | grep "hello" | sort | uniq') then
else
print("piping test failed ❌\n")
end
+
+if lush.exec("echo hi && echo bye") then
+ print("and test passed ✅\n")
+else
+ print("and test failed ❌\n")
+end
+
+if lush.exec("cd lol || echo lol does not exist") then
+ print("or test passed ✅\n")
+else
+ print("or test failed ❌\n")
+end
+
+if lush.exec("sleep 2 &") then
+ print("background test passed ✅\n")
+else
+ print("background test failed ❌\n")
+end
+
+if lush.exec("echo hi; echo bye") then
+ print("semicolon test passed ✅\n")
+else
+ print("semicolon test failed ❌\n")
+end
+
+if lush.exec("echo hi > test.txt") then
+ print("redirect test passed ✅\n")
+else
+ print("redirect test failed ❌\n")
+end
+
+if lush.exec("echo hi >> test.txt") then
+ print("append test passed ✅\n")
+else
+ print("append test failed ❌\n")
+end
+
lush.cd(cwd)
diff --git a/test/run_tests.lua b/test/run_tests.lua
index e861326..6c54157 100644
--- a/test/run_tests.lua
+++ b/test/run_tests.lua
@@ -22,8 +22,8 @@ lush.debug(true)
print("Testing Args...")
lush.exec("args_test.lua testarg1 testarg2 testarg3")
-print("\nTesting Piping...")
-lush.exec("pipes_test.lua")
+print("\nTesting Chaining...")
+lush.exec("chaining_test.lua")
print("\nTesting File Checks...")
lush.exec("filecheck_test.lua")