aboutsummaryrefslogtreecommitdiff
path: root/contrib/shunit2-2.0.3/src/test/testFailures
diff options
context:
space:
mode:
authorPeter Carbonetto2017-08-21 10:31:26 -0500
committerGitHub2017-08-21 10:31:26 -0500
commitaea3d24c680778cf1691a8c2a76f3221e7f373d6 (patch)
tree8a1ba0770e2344469c58290d4192db186d9439cb /contrib/shunit2-2.0.3/src/test/testFailures
parent85797beb24da3d591a79fddcff4ab48d702b465f (diff)
parent2e76646998df0ca1b7d160329c0f3ac8cdda2fe0 (diff)
downloadpangemma-aea3d24c680778cf1691a8c2a76f3221e7f373d6.tar.gz
Merge pull request #73 from genenetwork/merge-checkK
Check K and added unit test framework.
Diffstat (limited to 'contrib/shunit2-2.0.3/src/test/testFailures')
-rwxr-xr-xcontrib/shunit2-2.0.3/src/test/testFailures89
1 files changed, 89 insertions, 0 deletions
diff --git a/contrib/shunit2-2.0.3/src/test/testFailures b/contrib/shunit2-2.0.3/src/test/testFailures
new file mode 100755
index 0000000..9410510
--- /dev/null
+++ b/contrib/shunit2-2.0.3/src/test/testFailures
@@ -0,0 +1,89 @@
+#! /bin/sh
+# $Id$
+# vim: expandtab
+# author: Kate Ward <kate.ward@forestent.com>
+#
+# Self-testing unit tests for shUnit2 failures
+#
+
+MSG='This is a test message'
+
+#-----------------------------------------------------------------------------
+# suite tests
+#
+
+commonNotEqualsSame()
+{
+ fn=$1
+
+ msg='same, with message'
+ rslt=`${fn} "${MSG}" 'x' 'x' 2>&1`
+ assertNotSame "${msg}" '' "${rslt}"
+
+ msg='same'
+ rslt=`${fn} 'x' 'x' 2>&1`
+ assertNotSame "${msg}" '' "${rslt}"
+
+ msg='not same'
+ rslt=`${fn} 'x' 'y' 2>&1`
+ assertNotSame "${msg}" '' "${rslt}"
+
+ msg='null values'
+ rslt=`${fn} '' '' 2>&1`
+ assertNotSame "${msg}" '' "${rslt}"
+
+ msg='too few arguments'
+ rslt=`${fn} 2>&1`
+ assertNotSame "${msg}" '' "${rslt}"
+}
+
+testFail()
+{
+ msg='with message'
+ rslt=`fail "${MSG}" 2>&1`
+ assertNotSame "${msg}" '' "${rslt}"
+
+ msg='without message'
+ rslt=`fail 2>&1`
+ assertNotSame "${msg}" '' "${rslt}"
+}
+
+testFailNotEquals()
+{
+ commonNotEqualsSame 'failNotEquals'
+}
+
+testFailSame()
+{
+ msg='same, with message'
+ rslt=`failSame "${MSG}" 'x' 'x' 2>&1`
+ assertNotSame "${msg}" '' "${rslt}"
+
+ msg='same'
+ rslt=`failSame 'x' 'x' 2>&1`
+ assertNotSame "${msg}" '' "${rslt}"
+
+ msg='not same'
+ rslt=`failSame 'x' 'y' 2>&1`
+ assertNotSame "${msg}" '' "${rslt}"
+
+ msg='null values'
+ rslt=`failSame '' '' 2>&1`
+ assertNotSame "${msg}" '' "${rslt}"
+
+ msg='too few arguments'
+ rslt=`failSame 2>&1`
+ assertNotSame "${msg}" '' "${rslt}"
+}
+
+testFailNotSame()
+{
+ commonNotEqualsSame 'failNotSame'
+}
+
+#-----------------------------------------------------------------------------
+# suite functions
+#
+
+# load and run shUnit2
+. ./shunit2