summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer2007-01-27 22:07:54 +0000
committerBernhard Reutner-Fischer2007-01-27 22:07:54 +0000
commit14813c5943ef6d3e07a8ccab1d29d9cb704cebd7 (patch)
tree5fba8e3337e2ff614b237f0f7898afb266bf73e2 /testsuite
parentaae82e0d8b3a1f01f230b29ee3e9c9939c89d688 (diff)
downloadbusybox-14813c5943ef6d3e07a8ccab1d29d9cb704cebd7.zip
busybox-14813c5943ef6d3e07a8ccab1d29d9cb704cebd7.tar.gz
- add a very few simple test for sum.
The very first is currently broken
Diffstat (limited to 'testsuite')
-rwxr-xr-xtestsuite/sum.tests24
1 files changed, 24 insertions, 0 deletions
diff --git a/testsuite/sum.tests b/testsuite/sum.tests
new file mode 100755
index 0000000..0993f03
--- /dev/null
+++ b/testsuite/sum.tests
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+# unit test for sum.
+# Copyright 2007 by Bernhard Fischer
+# Licensed under GPL v2 or later, see file LICENSE for details.
+
+# AUDIT: Unit tests for sum
+
+. testing.sh
+
+# testing "test name" "options" "expected result" "file input" "stdin"
+# file input will be file called "input"
+# test can create a file "actual" instead of writing to stdout
+
+testing "sum -r file doesn't print file's name" \
+ "sum -r $0 | grep -c $0 && echo wrongly_printed_filename || echo yes" \
+ "0\nyes\n" "" ""
+testing "sum -r file file does print both names" \
+ "sum -r $0 $0 | grep -c $0 && echo yes || echo wrongly_omitted_filename" \
+ "2\nyes\n" "" ""
+testing "sum -s file does print file's name" \
+ "sum -s $0 | grep -c $0 && echo yes || echo wrongly_omitted_filename" \
+ "1\nyes\n" "" ""
+exit $FAILCOUNT