aboutsummaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authoraldot <aldot@69ca8d6d-28ef-0310-b511-8ec308f3f277>2007-01-27 22:07:54 +0000
committeraldot <aldot@69ca8d6d-28ef-0310-b511-8ec308f3f277>2007-01-27 22:07:54 +0000
commitf3b4153b07bce2df8739aec8c97732eb4cf89927 (patch)
tree5fba8e3337e2ff614b237f0f7898afb266bf73e2 /testsuite
parent1f848d65d3c2b24d3fc6feb7f592038f8d8f71e6 (diff)
downloadbusybox-w32-f3b4153b07bce2df8739aec8c97732eb4cf89927.tar.gz
busybox-w32-f3b4153b07bce2df8739aec8c97732eb4cf89927.tar.bz2
busybox-w32-f3b4153b07bce2df8739aec8c97732eb4cf89927.zip
- add a very few simple test for sum.
The very first is currently broken git-svn-id: svn://busybox.net/trunk/busybox@17555 69ca8d6d-28ef-0310-b511-8ec308f3f277
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 000000000..0993f03b1
--- /dev/null
+++ b/testsuite/sum.tests
@@ -0,0 +1,24 @@
1#!/bin/sh
2
3# unit test for sum.
4# Copyright 2007 by Bernhard Fischer
5# Licensed under GPL v2 or later, see file LICENSE for details.
6
7# AUDIT: Unit tests for sum
8
9. testing.sh
10
11# testing "test name" "options" "expected result" "file input" "stdin"
12# file input will be file called "input"
13# test can create a file "actual" instead of writing to stdout
14
15testing "sum -r file doesn't print file's name" \
16 "sum -r $0 | grep -c $0 && echo wrongly_printed_filename || echo yes" \
17 "0\nyes\n" "" ""
18testing "sum -r file file does print both names" \
19 "sum -r $0 $0 | grep -c $0 && echo yes || echo wrongly_omitted_filename" \
20 "2\nyes\n" "" ""
21testing "sum -s file does print file's name" \
22 "sum -s $0 | grep -c $0 && echo yes || echo wrongly_omitted_filename" \
23 "1\nyes\n" "" ""
24exit $FAILCOUNT