summaryrefslogtreecommitdiff
path: root/testsuite/lib.test/strutils.exp
diff options
context:
space:
mode:
authorSami Kerola <kerolasa@iki.fi>2012-02-26 13:31:18 +0100
committerCraig Small <csmall@enc.com.au>2012-03-03 18:36:29 +1100
commit56ed9826a522448da60a6645a8eca47f5f0c6826 (patch)
tree586e2766d1dc8e9b5b9410c4540a42ed4f187f98 /testsuite/lib.test/strutils.exp
parentabd113313dd8952b84943403a251d63a4208fdf0 (diff)
downloadprocps-ng-56ed9826a522448da60a6645a8eca47f5f0c6826.tar.gz
test: add lib/strutils check
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'testsuite/lib.test/strutils.exp')
-rw-r--r--testsuite/lib.test/strutils.exp25
1 files changed, 25 insertions, 0 deletions
diff --git a/testsuite/lib.test/strutils.exp b/testsuite/lib.test/strutils.exp
new file mode 100644
index 0000000..7afa8f7
--- /dev/null
+++ b/testsuite/lib.test/strutils.exp
@@ -0,0 +1,25 @@
+#
+# Testsuite for lib/strutils program
+#
+
+set teststr "${topdir}lib/test_strutils"
+
+set test "without argument"
+spawn $teststr
+expect_pass "$test" "test_strutils: no arguments"
+
+set test "test long"
+spawn $teststr 1
+expect_pass "$test" "1"
+
+set test "test long fail"
+spawn $teststr fail
+expect_pass "$test" "test_strutils: strtol_or_err: \'fail\'"
+
+set test "test double"
+spawn $teststr dummy 1.1
+expect_pass "$test" "1.100000"
+
+set test "test double fail"
+spawn $teststr dummy fail
+expect_pass "$test" "test_strutils: strtod_or_err: \'fail\'"