4 releases
Uses new Rust 2024
new 0.1.3 | Apr 16, 2025 |
---|---|
0.1.2 | Apr 16, 2025 |
0.1.1 | Apr 16, 2025 |
0.1.0 | Apr 16, 2025 |
#1749 in Command line utilities
303 downloads per month
53KB
1.5K
SLoC
Contains (Zip file, 4KB) highlighting/functional-tests-0.0.1.vsix
cli-tester
A CLI testing tool that allows you to write tests for command-line applications using a simple syntax.
Syntax
The test files use the following syntax:
# <comment>
- Comments that are ignored during test execution$ <command>
- Shell command to execute? <grok pattern>
- Match output using a grok pattern! <literal>
- Match output exactly as specified!!!
- Multi-line literal block (starts and ends with!!!
)repeat { ... }
- Match the enclosed patterns multiple timesoptional { ... }
- Match the enclosed patterns zero or one timechoice { ... }
- Match one of the enclosed patternsunordered { ... }
- Match all enclosed patterns in any ordersequence { ... }
- Match all enclosed patterns in sequenceignore { ... }
- Ignore any output that matches the enclosed patternsreject { ... }
- Fail if any output matches the enclosed patterns
Examples
Match exact output:
$ echo "a\nb\nc"
! a
! b
! c
Match using a grok pattern:
$ echo "anything"
? %{GREEDYDATA}
Match multiple lines:
$ echo "a\nb\nc"
!!!
a
b
c
!!!
Match multiple lines using a grok pattern:
$ echo "a\nb\nc"
repeat {
? %{DATA}
}
???
Dependencies
~4–12MB
~168K SLoC