mirror of
https://github.com/imjasonh/testscript-rs
synced 2026-07-08 09:05:34 +00:00
Add network and advanced condition support
Co-authored-by: imjasonh <210737+imjasonh@users.noreply.github.com>
This commit is contained in:
parent
a716f83e1d
commit
7e37906109
1 changed files with 26 additions and 0 deletions
26
testdata/advanced_api_demo.txt
vendored
Normal file
26
testdata/advanced_api_demo.txt
vendored
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
# Demonstrate complete advanced condition API
|
||||
|
||||
# Set an environment variable for testing
|
||||
env TEST_DEMO=active
|
||||
|
||||
# Test network condition (will work if network is available)
|
||||
[net] exec echo "Network is working"
|
||||
|
||||
# Test environment variable condition
|
||||
[env:TEST_DEMO] exec echo "Environment variable TEST_DEMO is set"
|
||||
[env:TEST_DEMO] stdout "Environment variable TEST_DEMO is set"
|
||||
|
||||
# Test program detection (echo should be available everywhere)
|
||||
[exec:echo] exec echo "echo command is available"
|
||||
[exec:echo] stdout "echo command is available"
|
||||
|
||||
# Test negated environment condition
|
||||
[!env:NONEXISTENT_VAR] exec echo "NONEXISTENT_VAR is not set"
|
||||
[!env:NONEXISTENT_VAR] stdout "NONEXISTENT_VAR is not set"
|
||||
|
||||
# Test platform conditions (existing functionality)
|
||||
[unix] exec echo "Running on Unix-like system"
|
||||
[windows] exec echo "Running on Windows"
|
||||
|
||||
exec echo "All condition tests completed successfully"
|
||||
stdout "All condition tests completed successfully"
|
||||
Loading…
Add table
Add a link
Reference in a new issue