mirror of
https://github.com/imjasonh/testscript-rs
synced 2026-07-09 01:26:40 +00:00
30 lines
No EOL
596 B
Text
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 |