From 4aca87515a5083ae0e31ce3177189fd43b6d05ac Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Sat, 3 Jan 2015 13:58:15 +0100 Subject: patch to Vanilla Tomato 1.28 --- release/src/router/busybox/testsuite/sum.tests | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 release/src/router/busybox/testsuite/sum.tests (limited to 'release/src/router/busybox/testsuite/sum.tests') diff --git a/release/src/router/busybox/testsuite/sum.tests b/release/src/router/busybox/testsuite/sum.tests new file mode 100755 index 00000000..e537cf60 --- /dev/null +++ b/release/src/router/busybox/testsuite/sum.tests @@ -0,0 +1,24 @@ +#!/bin/sh + +# unit test for sum. +# Copyright 2007 by Bernhard Reutner-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 -- cgit v1.2.3-54-g00ecf