From e0a136839ff1f359f01320e2c3e32bae0164b785 Mon Sep 17 00:00:00 2001 From: Peter Bex Date: Sat, 21 Apr 2018 10:40:07 +0200 Subject: Make ">" redirect truncate existing files Thanks to Joerg Wittenberger --- tests/run.scm | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tests') diff --git a/tests/run.scm b/tests/run.scm index 96d49eb..9bf2c75 100644 --- a/tests/run.scm +++ b/tests/run.scm @@ -143,6 +143,16 @@ (test "Subprocess writing to a file" "hi, there\n" (begin (run (echo "hi, there") (> ,the-outfile)) + (read-all the-outfile))) + + (test "Appending to the file" + "hi, there\nhi, again\n" + (begin (run (echo "hi, again") (>> ,the-outfile)) + (read-all the-outfile))) + + (test "Writing to the file truncates" + "hi, truncated\n" + (begin (run (echo "hi, truncated") (> ,the-outfile)) (read-all the-outfile)))) (delete-file* "outfile") -- cgit v1.2.3