diff options
| author | Sam Anthony <sam@samanthony.xyz> | 2024-08-31 15:17:11 -0400 |
|---|---|---|
| committer | Sam Anthony <sam@samanthony.xyz> | 2024-08-31 15:28:19 -0400 |
| commit | 7b9206498ee8d5f6327da84e72c00bbc6ff1cf48 (patch) | |
| tree | ee3c5048653d25b222914e285d75e1d513498bbf | |
| parent | 5ec152ecd424d67474f36992acae5c620e46e2c6 (diff) | |
| download | markov-7b9206498ee8d5f6327da84e72c00bbc6ff1cf48.zip | |
test boundary conditions
| -rwxr-xr-x | test | 12 | ||||
| -rw-r--r-- | tests/a | 1 | ||||
| -rw-r--r-- | tests/ab | 2 | ||||
| -rw-r--r-- | tests/abc | 3 | ||||
| -rw-r--r-- | tests/abcd | 4 | ||||
| -rw-r--r-- | tests/empty | 0 |
6 files changed, 22 insertions, 0 deletions
@@ -0,0 +1,12 @@ +#!/usr/bin/sh + +# Check boundary conditions with small files. Output should match input. +for f in empty a ab abc abcd; do + ./markov <tests/$f > out + if !(diff tests/$f out > /dev/null); then + echo tests/$f: output of markov does not match input: + diff tests/$f out + exit 1 + fi +done +rm out
\ No newline at end of file @@ -0,0 +1 @@ +a diff --git a/tests/ab b/tests/ab new file mode 100644 index 0000000..422c2b7 --- /dev/null +++ b/tests/ab @@ -0,0 +1,2 @@ +a +b diff --git a/tests/abc b/tests/abc new file mode 100644 index 0000000..de98044 --- /dev/null +++ b/tests/abc @@ -0,0 +1,3 @@ +a +b +c diff --git a/tests/abcd b/tests/abcd new file mode 100644 index 0000000..d68dd40 --- /dev/null +++ b/tests/abcd @@ -0,0 +1,4 @@ +a +b +c +d diff --git a/tests/empty b/tests/empty new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tests/empty |