summaryrefslogtreecommitdiff
path: root/test/script/shell.et
diff options
context:
space:
mode:
authorRoman Smrž <roman.smrz@seznam.cz>2026-08-22 22:37:53 +0200
committerRoman Smrž <roman.smrz@seznam.cz>2026-08-22 22:38:56 +0200
commit9fb76c74b5d30b592bad60de5955b9efa2e6cd65 (patch)
tree3985118032a13f5044dee357c622e3ad34d79985 /test/script/shell.et
parent0ba7a3adcc5e539a31b5893bc956a39105e6a9bf (diff)
Shell: implement ‘!’ operator
Changelog: Implement negation using the `!` operator in the shell interpreter.
Diffstat (limited to 'test/script/shell.et')
-rw-r--r--test/script/shell.et26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/script/shell.et b/test/script/shell.et
index e58dfea..086d3d3 100644
--- a/test/script/shell.et
+++ b/test/script/shell.et
@@ -154,3 +154,29 @@ test ShellExitOnError:
expect /run-test-result Enabled failed/
expect /run-done/
flush
+
+
+test ShellLogic:
+ spawn as p
+ with p:
+ send "load ${scripts.path}/logic.et"
+ local:
+ expect /(load-.*)/ capture done
+ guard (done == "load-done")
+
+ send "run NegateFalse"
+ expect /run-test-result NegateFalse done/
+ expect /run-done/
+ flush
+
+ send "run NegateTrue"
+ expect /child-fail sh failed at: .*logic.et:9:9: ! true/
+ expect /run-test-result NegateTrue failed/
+ expect /run-done/
+ flush
+
+ send "run NegateNothing"
+ expect /child-fail sh failed at: .*logic.et:14:9: !/
+ expect /run-test-result NegateNothing failed/
+ expect /run-done/
+ flush