From 9fb76c74b5d30b592bad60de5955b9efa2e6cd65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Sat, 22 Aug 2026 22:37:53 +0200 Subject: =?UTF-8?q?Shell:=20implement=20=E2=80=98!=E2=80=99=20operator?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changelog: Implement negation using the `!` operator in the shell interpreter. --- test/script/shell.et | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'test/script') 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 -- cgit v1.2.3