From 7b9206498ee8d5f6327da84e72c00bbc6ff1cf48 Mon Sep 17 00:00:00 2001 From: Sam Anthony Date: Sat, 31 Aug 2024 15:17:11 -0400 Subject: test boundary conditions --- test | 12 ++++++++++++ tests/a | 1 + tests/ab | 2 ++ tests/abc | 3 +++ tests/abcd | 4 ++++ tests/empty | 0 6 files changed, 22 insertions(+) create mode 100755 test create mode 100644 tests/a create mode 100644 tests/ab create mode 100644 tests/abc create mode 100644 tests/abcd create mode 100644 tests/empty diff --git a/test b/test new file mode 100755 index 0000000..972ba8c --- /dev/null +++ b/test @@ -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 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 diff --git a/tests/a b/tests/a new file mode 100644 index 0000000..7898192 --- /dev/null +++ b/tests/a @@ -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 -- cgit v1.2.3