1
0
Fork 0
mirror of https://github.com/imjasonh/testscript-rs synced 2026-07-09 09:36:48 +00:00
testscript-rs/examples/sample-cli/testdata/grep_functionality.txt

30 lines
596 B
Text
Raw Normal View History

# Test grep functionality
# Basic grep
exec ./sample-cli grep "world" test_file.txt
stdout "test_file.txt:1: Hello world"
# Case insensitive grep
exec ./sample-cli grep --ignore-case "HELLO" test_file.txt
stdout "test_file.txt:1: Hello world"
# Multiple files
exec ./sample-cli grep "file" file1.txt file2.txt
stdout "file1.txt:1: First file"
stdout "file2.txt:1: Single line file"
# No matches
exec ./sample-cli grep "xyz" test_file.txt
! stdout "xyz"
-- test_file.txt --
Hello world
This is line two
Line three here
-- file1.txt --
First file
Second line
-- file2.txt --
Single line file