aboutsummaryrefslogtreecommitdiffstats
path: root/test/chaining_test.lua
diff options
context:
space:
mode:
authorGravatar BanceDev 2024-09-27 09:33:01 -0400
committerGravatar BanceDev 2024-09-27 09:33:01 -0400
commit68ce253ca289030922581b10a34094750c34d729 (patch)
tree24a8d2a158794a0e42b5a154d3cf595188bd7227 /test/chaining_test.lua
parentfixed chaining execution attempting to execute operator (diff)
added exit api function
Diffstat (limited to 'test/chaining_test.lua')
-rw-r--r--test/chaining_test.lua8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/chaining_test.lua b/test/chaining_test.lua
index 83f3e76..411dcdd 100644
--- a/test/chaining_test.lua
+++ b/test/chaining_test.lua
@@ -15,48 +15,56 @@ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
]]
+-- TODO: Add more edge case tests for chaining operators
local cwd = lush.getcwd()
lush.cd("~/.lush/scripts")
if lush.exec('cat "example.lua" | grep "hello" | sort | uniq') then
print("piping test passed ✅\n")
else
print("piping test failed ❌\n")
+ lush.exit()
end
if lush.exec("echo hi && echo bye") then
print("and test passed ✅\n")
else
print("and test failed ❌\n")
+ lush.exit()
end
if lush.exec("cd lol || echo lol does not exist") then
print("or test passed ✅\n")
else
print("or test failed ❌\n")
+ lush.exit()
end
if lush.exec("sleep 2 &") then
print("background test passed ✅\n")
else
print("background test failed ❌\n")
+ lush.exit()
end
if lush.exec("echo hi; echo bye") then
print("semicolon test passed ✅\n")
else
print("semicolon test failed ❌\n")
+ lush.exit()
end
if lush.exec("echo hi > test.txt") then
print("redirect test passed ✅\n")
else
print("redirect test failed ❌\n")
+ lush.exit()
end
if lush.exec("echo hi >> test.txt") then
print("append test passed ✅\n")
else
print("append test failed ❌\n")
+ lush.exit()
end
lush.cd(cwd)