add tests
authorLaurent Mazet <mazet@softndesign.org>
Wed, 18 Dec 2024 22:16:35 +0000 (23:16 +0100)
committerLaurent Mazet <mazet@softndesign.org>
Wed, 18 Dec 2024 22:16:35 +0000 (23:16 +0100)
bogus.sok [new file with mode: 0644]
sokoban.c

diff --git a/bogus.sok b/bogus.sok
new file mode 100644 (file)
index 0000000..97bd873
--- /dev/null
+++ b/bogus.sok
@@ -0,0 +1,3 @@
+width: 7
+height: 5
+tab: "####  #@  #  # #$#### $ ..########"
index dcc7805028c9bab5a8de26ed48e4a5759bd4b33a..3bf0843ffc6fb31351bf3cab32e9466633386201 100644 (file)
--- a/sokoban.c
+++ b/sokoban.c
@@ -236,9 +236,17 @@ int main (int argc, char *argv[])
 /* test: sokoban.exe -f nofile.sok 2>&1 | grep "can't read file" */
 /* test: sokoban.exe -f bogus.sok 2>&1 | grep 'incorrect file' */
 /* test: sokoban.exe -h | grep usage */
-/* test: sokoban.exe -l nofile.skb 2>&1 | grep "can't read library" */
-/* test: sokoban.exe -l bogus.skb 2>&1 | grep 'incorrect library' */
+/* test_: sokoban.exe -l nofile.skb 2>&1 | grep "can't read library" */
+/* test_: sokoban.exe -l bogus.skb 2>&1 | grep 'incorrect library' */
+/* test: sokoban.exe -s 2>&1 | grep specified */
 /* test: sokoban.exe -v 2>&1 | grep missing */
 /* test: sokoban.exe _ 2>&1 | grep invalid */
+/* test: { sleep 1; echo -n k; sleep 1; echo -n q; } | sokoban.exe -f test.sok -s 0 */
+/* test: { sleep 1; echo -n k; sleep 1; echo -n q; } | sokoban.exe -f test.sok -s 1 */
+/* test: { sleep 1; echo -n k; sleep 1; echo -n q; } | sokoban.exe -f test.sok -s 2 */
+/* test: { sleep 1; echo -n k; sleep 1; echo -n q; } | sokoban.exe -f test.sok -s 3 */
+/* test: { sleep 1; echo -n k; sleep 1; echo -ne 'a.sok\e'; sleep 1; echo -e 'sab\b.sok'; sleep 1; echo q; } | sokoban.exe -v 3 -f test.sok */
+/* test: { sleep 1; echo s; sleep 1; echo q; } | sokoban.exe -f a.sok && rm a.sok && test \! -f b.sok */
+/* test: { sleep 1; echo -n kkklll; sleep 1; echo -n jjjiiillkk; sleep 1; echo -n iijjkkkll; sleep 3; echo; } | sokoban.exe -f test.sok -s 3 */
 
 /* vim: set ts=4 sw=4 et: */