mirror of
https://github.com/imjasonh/testscript-rs
synced 2026-07-13 19:36:49 +00:00
initial commit
Signed-off-by: Jason Hall <jason@chainguard.dev>
This commit is contained in:
commit
c39114f1a9
64 changed files with 8704 additions and 0 deletions
25
examples/sample-cli/testdata/file_operations.txt
vendored
Normal file
25
examples/sample-cli/testdata/file_operations.txt
vendored
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
# 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"
|
||||
Loading…
Add table
Add a link
Reference in a new issue