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

25 lines
No EOL
645 B
Text

# Test file creation and removal
# Create a file with content
exec ./sample-cli create newfile.txt --content "Hello from CLI"
stdout "Created file: newfile.txt"
exists newfile.txt
exec cat newfile.txt
stdout "Hello from CLI"
# Create empty file
exec ./sample-cli create empty.txt
exists empty.txt
exec ./sample-cli count --mode chars empty.txt
stdout "empty.txt: 0"
# Remove files
exec ./sample-cli remove newfile.txt empty.txt
stdout "Removed: newfile.txt"
stdout "Removed: empty.txt"
! exists newfile.txt
! exists empty.txt
# Try to remove non-existent file
exec ./sample-cli remove nonexistent.txt
stderr "File not found: nonexistent.txt"