Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F56413646
Core.test
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
Core.test
View Options
package require tcltest
namespace import ::tcltest::*
###
### Init
###
source init.tcl
###
### Tests
###
test strlen_regular_string {} -body {
strlen "quux"
} -result 4
test strlen_empty_string {} -body {
strlen ""
} -result 0
test strlenmax {} -body {
strlenmax "a aa alpha beta gamma delta omega"
} -result 5
test strlenmax_empty_words {} -body {
strlenmax [list "" "" "" ""]
} -result 0
test strlenmax_empty_list_one_empty_word {} -body {
strlenmax {""}
} -result 0
test strlenmax_empty_list {} -body {
strlenmax {}
} -result 0
test strlenmap {} -body {
strlenmap "a aa aaa aa a"
} -result "1 2 3 2 1"
test lmax {} -body {
lmax "7 10 1 20 11 4 3"
} -result 20
test lmin {} -body {
lmin "7 10 1 20 11 4 3"
} -result 1
test lmax_from_an_empty_list {
When there is no numeric value, nothing should be returned
} -body {
lmax ""
} -result ""
test lmax_from_an_words_list {
When there is no numeric value, nothing should be returned
} -body {
lmax "alpha beta gamma"
} -result ""
test lmax_from_a_mixed_list {
Non numeric numbers should be ignored
} -body {
lmax "7 10 1 20 notanumber 11 4 3"
} -result 20
test zeroornumber_from_integer {} -body {
zeroornumber 4
} -result 4
test zeroornumber_from_non_numeric_string {} -body {
zeroornumber "alpha"
} -result 0
test zeroornumber_from_zero {} -body {
zeroornumber 0
} -result 0
test zeroornumber_from_empty_list {} -body {
zeroornumber ""
} -result 0
###
### Cleanup
###
cleanupTests
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 7, 23:04 (1 w, 4 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4253631
Default Alt Text
Core.test (1 KB)
Attached To
Mode
rVIPER ViperServ scripts
Attached
Detach File
Event Timeline
Log In to Comment