1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
|
# -*- tcl -*-
# -------------------------------------------------------------------------
# cache.test
# -------------------------------------------------------------------------
source [file join [file dirname [info script]] support testutilities.tcl]
testsNeedTcl 8.6 9
testsNeedTcltest 2
support {
useLocal lib/stubs_container/container.tcl stubs::container
useLocal lib/stubs_reader/reader.tcl stubs::reader
useLocal lib/stubs_genframe/genframe.tcl stubs::gen
# Helper procedures
useLocalFile test/support/crit_utils.tcl
}
testing {
useLocal lib/critcl/critcl.tcl critcl
}
overrides
# -------------------------------------------------------------------------
## cache syntax
test critcl-cache-1.0.7 {cache, wrong\#args, too many} -constraints tcl9 -body {
critcl::cache C X
} -returnCodes error -result {wrong # args: should be "critcl::cache ?dir?"}
test critcl-cache-1.0.6 {cache, wrong\#args, too many} -constraints tcl8.6plus -body {
critcl::cache C X
} -returnCodes error -result {wrong # args: should be "critcl::cache ?dir?"}
test critcl-cache-1.0.5 {cache, wrong\#args, too many} -constraints tcl8.5 -body {
critcl::cache C X
} -returnCodes error -result {wrong # args: should be "critcl::cache ?dir?"}
test critcl-cache-1.0.4 {cache, wrong\#args, too many} -constraints tcl8.4 -body {
critcl::cache C X
} -returnCodes error -result {wrong # args: should be "critcl::cache ?dir?"}
# -------------------------------------------------------------------------
##
test critcl-cache-2.0 {cache, default, home directory} -body {
# Note file join below is to not fail because of \ vs / separators
critcl::cache
} -match glob -result [file dirname [file normalize [file join $::env(HOME) .critcl * _dummy_]]]
test critcl-cache-2.1 {cache, redirecting cache} -setup {
set here [critcl::cache]
} -body {
critcl::cache $env(HOME)/FOO
} -cleanup {
critcl::cache $here
unset here
} -match glob -result [file dirname [file normalize [file join $::env(HOME) FOO _dummy_]]]
# -------------------------------------------------------------------------
testsuiteCleanup
# Local variables:
# mode: tcl
# indent-tabs-mode: nil
# End:
|