Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F56417470
ServersLog.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
ServersLog.test
View Options
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
Details
Attached
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)
Attached To
Mode
rVIPER ViperServ scripts
Attached
Detach File
Event Timeline
Log In to Comment