]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
Add unit tests to guard against bad stdin
authorsenhuang42 <senhuang96@fb.com>
Tue, 22 Sep 2020 18:16:26 +0000 (14:16 -0400)
committersenhuang42 <senhuang96@fb.com>
Tue, 22 Sep 2020 18:55:41 +0000 (14:55 -0400)
tests/playTests.sh

index 44fd74008b9051211d691e0e83c2419e275596a4..aee790da534f341df4859c0a075c312f94ca8655 100755 (executable)
@@ -309,6 +309,18 @@ test -f precompressedFilterTestDir/input.5.zst.zst
 test -f precompressedFilterTestDir/input.6.zst.zst
 println "Test completed"
 
+
+
+println "\n===>  warning prompt does not swallow characters"
+println "y" > tmpPrompt
+println "hello world" >> tmpPrompt
+zstd tmpPrompt
+zstd < tmpPrompt -o tmpPrompt.zst
+zstd -q -d tmpPrompt.zst -o tmpPromptRegenerated
+$DIFF tmpPromptRegenerated tmpPrompt
+println "Test completed"
+
+
 println "\n===>  recursive mode test "
 # combination of -r with empty list of input file
 zstd -c -r < tmp > tmp.zst