test: add lib/strutils check

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit is contained in:
Sami Kerola
2012-02-26 13:31:18 +01:00
committed by Craig Small
parent abd113313d
commit 56ed9826a5
3 changed files with 34 additions and 1 deletions

View File

@ -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\'"