From d361b5cb163316d4e0c56cab30301e18b548afff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Sun, 19 Apr 2026 21:02:51 +0200 Subject: Arbitrary expressions as variable values --- test/asset/run-fail/command-ignore.et | 13 +++++++++++++ test/asset/run-success/command-flush.et | 30 ++++++++++++++++++++++++++++++ test/script/run.et | 4 ++-- 3 files changed, 45 insertions(+), 2 deletions(-) create mode 100644 test/asset/run-fail/command-ignore.et create mode 100644 test/asset/run-success/command-flush.et (limited to 'test') diff --git a/test/asset/run-fail/command-ignore.et b/test/asset/run-fail/command-ignore.et new file mode 100644 index 0000000..9622782 --- /dev/null +++ b/test/asset/run-fail/command-ignore.et @@ -0,0 +1,13 @@ +test Test: + node n + shell on n as p: + cat + + send "a" to p + send "b" to p + send "x" to p + expect /x/ from p + ignore from p + + multiply_timeout by 0.0 + expect /.*/ from p diff --git a/test/asset/run-success/command-flush.et b/test/asset/run-success/command-flush.et new file mode 100644 index 0000000..8c5f7b8 --- /dev/null +++ b/test/asset/run-success/command-flush.et @@ -0,0 +1,30 @@ +def expect_next from p (str): + expect /(.*)/ from p capture line + guard (line == str) + +test Test: + node n + shell on n as p: + cat + + send "a1" to p + send "b" to p + send "x" to p + expect /x/ from p + + flush from p matching /a.*/ + send "a2" to p + send "c" to p + + expect_next "b" from p + expect_next "a2" from p + expect_next "c" from p + + send "d" to p + send "e" to p + send "f" to p + send "x" to p + expect /x/ from p + flush from p + send "g" to p + expect_next "g" from p diff --git a/test/script/run.et b/test/script/run.et index ace5192..2572f87 100644 --- a/test/script/run.et +++ b/test/script/run.et @@ -29,8 +29,8 @@ test TrivialRun: test SimpleRun: - let should_succeed = [ "bool", "command-ignore" ] - let should_fail = [ "bool" ] + let should_succeed = [ "bool", "command-flush", "command-ignore" ] + let should_fail = [ "bool", "command-ignore" ] spawn as p with p: -- cgit v1.2.3