add basic test
authorIan Kelling <ian@iankelling.org>
Mon, 28 Jul 2014 11:57:35 +0000 (04:57 -0700)
committerIan Kelling <ian@iankelling.org>
Mon, 28 Jul 2014 11:57:35 +0000 (04:57 -0700)
test/test [new file with mode: 0755]

diff --git a/test/test b/test/test
new file mode 100755 (executable)
index 0000000..c2f2109
--- /dev/null
+++ b/test/test
@@ -0,0 +1,46 @@
+#!/bin/bash -l
+x=$(mktemp)
+appendu $x<<'EOF'
+abc
+
+*!@#$^&*))0_)()?><M;sdf234
+
+EOF
+
+y=$(mktemp)
+tee -a $y<<'EOF'
+abc
+
+*!@#$^&*))0_)()?><M;sdf234
+
+EOF
+
+
+output=$(appendu $x<<'EOF'
+foo
+abc
+*(@#$%)
+
+*!@#$^&*))0_)()?><M;sdf234
+EOF
+)
+
+good_output='foo
+*(@#$%)'
+
+[[ $output == "$good_output" ]] || { echo check1 failed; echo "$output != $good_output"; }
+
+echo "$good_output" >> $y
+
+
+diff $x $y || echo check2 failed diffing $x and $y
+
+output=$(appendu $x "abc
+bd" "abc")
+
+good_output="abc
+bd"
+
+[[ $output == $good_output ]] || { echo check3 failed; echo "$output != $good_output"; }
+
+