add basic test
[tee-unique] / test / test
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"; }
+
+