File tree Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -115,10 +115,11 @@ end
115
115
116
116
"""
117
117
empty!(cache::ProcessResultCache)
118
+ empty!(plan::RecoPlan{ProcessResultCache})
118
119
119
120
Empty the cache of the `ProcessResultCache`
120
121
"""
121
- Base. empty! (cache:: ProcessResultCache ) = empty! (cache. cache)
122
+ Base. empty! (cache:: Union{ ProcessResultCache, RecoPlan{<:ProcessResultCache}} ) = empty! (cache. cache)
122
123
"""
123
124
resize!(cache::ProcessResultCache)
124
125
Original file line number Diff line number Diff line change 171
171
172
172
@testset " RecoPlan" begin
173
173
cache_misses = Ref (0 )
174
- cached_parameter = CacheableParameter (3 , cache_misses)
174
+ cached_parameter = PureCacheableParameter (3 , cache_misses)
175
175
cache = ProcessResultCache (; param = cached_parameter, maxsize = 1 )
176
176
177
177
plan = toPlan (cache)
178
178
setAll! (plan, :maxsize , 3 )
179
179
@test plan. cache. maxsize == 3
180
180
181
- clear! (plan. param)
181
+ process (CacheableAlgorithm, cache, 42 )
182
+ @test length (keys (cache. cache)) == 1
183
+ empty! (cache)
184
+ @test length (keys (cache. cache)) == 0
185
+ process (CacheableAlgorithm, cache, 42 )
186
+ @test plan. cache == cache. cache
187
+ @test length (keys (cache. cache)) == 1
188
+ empty! (plan)
189
+ @test length (keys (cache. cache)) == 0
190
+
191
+ clear! (plan)
182
192
io = IOBuffer ()
183
193
toTOML (io, plan)
184
194
seekstart (io)
You can’t perform that action at this time.
0 commit comments