mirror of
https://github.com/imjasonh/testscript-rs
synced 2026-07-08 17:16:38 +00:00
25 lines
No EOL
645 B
Text
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" |