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

34 lines
No EOL
654 B
Text

# Test count functionality
# Count lines in a file
exec ./sample-cli count test_file.txt
stdout "test_file.txt: 3"
# Count words
exec ./sample-cli count --mode words test_file.txt
stdout "test_file.txt: 9"
# Count characters
exec ./sample-cli count --mode chars test_file.txt
stdout "test_file.txt: 44"
# Test multiple files
exec ./sample-cli count file1.txt file2.txt
stdout "file1.txt: 2"
stdout "file2.txt: 1"
# Test error on missing file
! exec ./sample-cli count nonexistent.txt
stderr ".*No such file.*"
-- test_file.txt --
Hello world
This is line two
Line three here
-- file1.txt --
First file
Second line
-- file2.txt --
Single line file