summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorRoman Smrž <roman.smrz@seznam.cz>2025-09-15 21:10:39 +0200
committerRoman Smrž <roman.smrz@seznam.cz>2025-09-19 19:44:28 +0200
commit89ed9a3a6c0ada2b1c252a5e24283b84eb0fa4c8 (patch)
tree5ba8a271690d43bab73fd4c86ff2702ca8afce45 /README.md
parent77fdc01b6dfa6f497ed80a46c51e227ca9bdaeed (diff)
Add timeout argument for the ‘expect’ command
Changelog: Added `timeout` argument for the `expect` command
Diffstat (limited to 'README.md')
-rw-r--r--README.md5
1 files changed, 4 insertions, 1 deletions
diff --git a/README.md b/README.md
index 4beb96a..be41714 100644
--- a/README.md
+++ b/README.md
@@ -261,7 +261,7 @@ send <string> to <process>
Send line with `<string>` to the standard input of `<process>`.
```
-expect <regex> from <process> [capture <var1> [, <var2> ... ]]
+expect <regex> from <process> [timeout <timeout>] [capture <var1> [, <var2> ... ]]
```
Check whether `<process>` produces line matching `<regex>` on standard output, and if this does not happen within current timeout, the test fails.
Output lines produced before starting this command and not matched by some previous `expect` are accepted as well.
@@ -274,6 +274,9 @@ The regular expression can contain capture groups – parts enclosed in parenthe
In that case the expect command has to have the `capture` clause with matching number of variable names.
Results of the captures are then assigned to the newly created variables as strings.
+If the `timeout` clause is used, the current timeout value is multiplied by the given `<timeout>` for this `expect` call.
+Timeout of zero can be used to expect a matching output line to have been already produced in the past.
+
```
flush [from <proc>] [matching <regex>]
```