summaryrefslogtreecommitdiffstats
path: root/testsuite/lib.test/strutils.exp
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-14 20:34:44 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-14 20:34:44 +0000
commite3be059d4da38aa36f1aee1d56f8ceb943d92f1c (patch)
tree26edef31e4e503dd1c92a112de174f366dd61802 /testsuite/lib.test/strutils.exp
parentInitial commit. (diff)
downloadprocps-upstream.tar.xz
procps-upstream.zip
Adding upstream version 2:4.0.4.upstream/2%4.0.4upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
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..72d1fcd
--- /dev/null
+++ b/testsuite/lib.test/strutils.exp
@@ -0,0 +1,25 @@
+#
+# Testsuite for lib/strutils program
+#
+
+set teststr "${topdir}src/tests/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\'"