2012-02-26 18:01:18 +05:30
|
|
|
#
|
|
|
|
# Testsuite for lib/strutils program
|
|
|
|
#
|
|
|
|
|
2022-08-29 16:10:45 +05:30
|
|
|
set teststr "${topdir}src/tests/test_strutils"
|
2012-02-26 18:01:18 +05:30
|
|
|
|
|
|
|
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\'"
|