Page MenuHomeDevCentral

ServersLog.test
No OneTemporary

ServersLog.test

package require tcltest
namespace import ::tcltest::*
###
### Init
###
# Tested code
source init.tcl
source $dir/Wearg/ServersLog.tcl
###
### Mocks
###
proc registry {command key {value ""}} {
if {$command == "get" && $key == "serverslog.knowncomponents"} {
return "Alpha Beta"
}
if {$command == "get" && $key == "serverslog.knownnotcomponents"} {
return "{GSoC Mentors}"
}
error "Unexpected registry call: $command $key $value"
}
###
### Tests
###
test is_known_component_when_known {} -body {
is_known_component Alpha
} -result 1
test is_known_component_when_known_parent {} -body {
is_known_component Beta/Delta
} -result 1
test is_known_component_with_trailing_slash {} -body {
is_known_component Beta/
} -result 0
test is_known_component_when_unknown {} -body {
is_known_component Gamma
} -result 0
test could_be_a_component_with_date {} -body {
could_be_a_component "15-Apr-2018 21:37:42 UTC"
} -result 0
test could_be_a_component_with_time {} -body {
could_be_a_component "1905495.738522"
} -result 0
test could_be_a_component_with_time_in_log {} -body {
could_be_a_component " 0.528573"
} -result 0
test could_be_a_component_with_server_name {} -body {
could_be_a_component "Ysul"
} -result 1
test could_be_a_component_with_mailing_list_prefix {} -body {
could_be_a_component "GSoC Mentors"
} -result 0
###
### Cleanup
###
cleanupTests

File Metadata

Mime Type
text/plain
Expires
Sun, Nov 8, 00:02 (1 w, 5 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4249198
Default Alt Text
ServersLog.test (1 KB)

Event Timeline