Index: modules/cache/ChangeLog ================================================================== --- modules/cache/ChangeLog +++ modules/cache/ChangeLog @@ -1,5 +1,13 @@ +2018-08-28 Aldo Buratti + + * + * BugFix in method 'clear' + * Added a test in async.test + * Release 0.3.1 + * + 2013-02-01 Andreas Kupries * * Released and tagged Tcllib 1.15 ======================== * Index: modules/cache/async.man ================================================================== --- modules/cache/async.man +++ modules/cache/async.man @@ -1,15 +1,16 @@ -[manpage_begin cache::async n 0.3] +[vset Version 0.3.1] +[manpage_begin cache::async n [vset Version]] [keywords asynchronous] [keywords cache] [keywords callback] [keywords synchronous] [copyright {2008 Andreas Kupries }] [moddesc {In-memory caches}] [titledesc {Asynchronous in-memory cache}] [require Tcl 8.4] -[require cache::async [opt 0.3]] +[require cache::async [opt [vset Version]]] [description] This package provides objects which cache data in memory, and operate asynchronously with regard to request and responses. The objects are agnostic with regard to cache keys and values, and unknown methods are Index: modules/cache/async.tcl ================================================================== --- modules/cache/async.tcl +++ modules/cache/async.tcl @@ -80,11 +80,11 @@ # 'clear'. if {![llength $args]} { array unset myhit * array unset mymiss * - } elseif {[llength $arg] == 1} { + } elseif {[llength $args] == 1} { set key [lindex $args 0] unset -nocomplain myhit($key) unset -nocomplain mymiss($key) } else { WrongArgs ?key? @@ -180,6 +180,6 @@ } # ### ### ### ######### ######### ######### ## Ready -package provide cache::async 0.3 +package provide cache::async 0.3.1 Index: modules/cache/async.test ================================================================== --- modules/cache/async.test +++ modules/cache/async.test @@ -223,8 +223,37 @@ } -result {BEGIN WAIT DATA_HOLE get KEY ::ca DONE {unset KEY} RESUME} + +# -- $obj clear --------------------------------------------------------------- + +test cache-async-6.0 {clear a not existing value} -setup { + cache::async ca DATA_NONE + res! +} -body { + res+ BEGIN + ca clear KEY + res+ END + res?lines +} -cleanup { + ca destroy +} -result {BEGIN +END} + +test cache-async-6.1 {clear an existing value} -setup { + cache::async ca DATA_NONE + ca set KEY VALUE + res! +} -body { + res+ BEGIN + ca clear KEY + res+ END + res?lines +} -cleanup { + ca destroy +} -result {BEGIN +END} # ------------------------------------------------------------------------- testsuiteCleanup Index: modules/cache/pkgIndex.tcl ================================================================== --- modules/cache/pkgIndex.tcl +++ modules/cache/pkgIndex.tcl @@ -1,3 +1,3 @@ if {![package vsatisfies [package provide Tcl] 8.4]} {return} -package ifneeded cache::async 0.3 [list source [file join $dir async.tcl]] +package ifneeded cache::async 0.3.1 [list source [file join $dir async.tcl]]