1
0
Fork 0
mirror of https://github.com/imjasonh/testscript-rs synced 2026-07-09 01:26:40 +00:00
testscript-rs/examples/sample-cli/testdata/grep_functionality.txt
Jason Hall c39114f1a9 initial commit
Signed-off-by: Jason Hall <jason@chainguard.dev>
2025-09-26 18:41:14 -04:00

30 lines
No EOL
596 B
Text

# 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