diff options
author | sebres <sebres@users.sourceforge.net> | 2017-05-11 12:32:47 (GMT) |
---|---|---|
committer | sebres <sebres@users.sourceforge.net> | 2017-05-11 12:32:47 (GMT) |
commit | dceaea0327abc9d0e7620a7b2a4af177e9c8d569 (patch) | |
tree | 761cd32be2c4e8a5a209ade3012962f11e59230c /tests | |
parent | c8cfbe73a6df84730116e0513bbb3796f38ac89d (diff) | |
download | tcl-dceaea0327abc9d0e7620a7b2a4af177e9c8d569.zip tcl-dceaea0327abc9d0e7620a7b2a4af177e9c8d569.tar.gz tcl-dceaea0327abc9d0e7620a7b2a4af177e9c8d569.tar.bz2 |
auto-loading of ensemble and stubs on demand only (+ test covered now, see clock-0.1);
introduces new possibility to implement namespace-based auto-loading, e. g.:
set ::auto_index_ns(::some::namespace) [list ::source [::file join $dir some namespace.tcl]]]
loading of clock-stubs (clock.tcl) implemented via handler "auto_index_ns" now.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/clock.test | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/clock.test b/tests/clock.test index 0737558..af517c8 100644 --- a/tests/clock.test +++ b/tests/clock.test @@ -35,6 +35,9 @@ testConstraint y2038 \ # TEST PLAN +# clock-0: +# several base test-cases +# # clock-1: # [clock format] - tests of bad and empty arguments # @@ -251,6 +254,24 @@ proc ::testClock::registry { cmd path key } { return [dict get $reg $path $key] } +# Base test cases: + +test clock-0.1 "initial: auto-loading of ensemble and stubs on demand" { + set i [interp create]; # because clock can be used somewhere, test it in new interp: + + set ret [$i eval { + + lappend ret ens:[namespace ensemble exists ::clock] + clock seconds; # init ensemble (but not yet stubs, loading of clock.tcl retarded) + lappend ret ens:[namespace ensemble exists ::clock] + lappend ret stubs:[expr {[namespace which -command ::tcl::clock::GetSystemTimeZone] ne ""}] + clock format -now; # clock.tcl stubs expected + lappend ret stubs:[expr {[namespace which -command ::tcl::clock::GetSystemTimeZone] ne ""}] + }] + interp delete $i + set ret +} {ens:0 ens:1 stubs:0 stubs:1} + # Test some of the basics of [clock format] test clock-1.0 "clock format - wrong # args" { |