Skip to content

Instantly share code, notes, and snippets.

@victorlin
Created October 31, 2022 21:55
Show Gist options
  • Save victorlin/440f35d39de25f44cedd405285eda2e3 to your computer and use it in GitHub Desktop.
Save victorlin/440f35d39de25f44cedd405285eda2e3 to your computer and use it in GitHub Desktop.
testing Cram's temp directories
Create a new file in the test's temp directory.
$ cat newfile.txt
cat: .*: No such file or directory (re)
[1]
$ echo "hello" > newfile.txt
Create a new file in the test runner's temp directory (shared).
$ cat "$TMP"/newfile.txt
cat: .*: No such file or directory (re)
[1]
$ echo "hello" > "$TMP"/newfile.txt
Create a new file in the test's temp directory.
$ cat newfile.txt
cat: .*: No such file or directory (re)
[1]
$ echo "hello" > newfile.txt
Create a new file in the test runner's temp directory (shared).
$ cat "$TMP"/newfile.txt
cat: .*: No such file or directory (re)
[1]
$ echo "hello" > "$TMP"/newfile.txt
% cram --shell=/bin/bash *.t
.!
--- 2.t
+++ 2.t.err
@@ -8,6 +8,5 @@
Create a new file in the test runner's temp directory (shared).
$ cat "$TMP"/newfile.txt
- cat: .*: No such file or directory (re)
- [1]
+ hello
$ echo "hello" > "$TMP"/newfile.txt
# Ran 2 tests, 0 skipped, 1 failed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment