|
13 | 13 | @test isequal(val, 2x + 1) |
14 | 14 | cachestruct = associated_cache(f1) |
15 | 15 | cache, stats = cachestruct.tlv[] |
16 | | - @test cache isa Dict{Tuple{SymbolicKey}, BasicSymbolic} |
| 16 | + @test cache isa Dict{Tuple{SymbolicKey}, Tuple{BasicSymbolic, BasicSymbolic}} |
17 | 17 | @test length(cache) == 1 |
18 | | - @test cache[(SymbolicKey(objectid(x)),)] === val |
| 18 | + @test cache[(SymbolicKey(objectid(x)),)][end] === val |
19 | 19 | @test stats.hits == 0 |
20 | 20 | @test stats.misses == 1 |
21 | 21 | f1(x) |
|
75 | 75 | @test isequal(val, 2x + 1) |
76 | 76 | cachestruct = associated_cache(f2) |
77 | 77 | cache, stats = cachestruct.tlv[] |
78 | | - @test cache isa Dict{Tuple{Union{SymbolicKey, UInt}}, Union{BasicSymbolic, UInt}} |
| 78 | + @test cache isa Dict{Tuple{Union{SymbolicKey, UInt}}, NTuple{2, Union{BasicSymbolic, UInt}}} |
79 | 79 | @test length(cache) == 1 |
80 | | - @test cache[(SymbolicKey(objectid(x)),)] === val |
| 80 | + @test cache[(SymbolicKey(objectid(x)),)][end] === val |
81 | 81 | @test stats.hits == 0 |
82 | 82 | @test stats.misses == 1 |
83 | 83 | f2(x) |
|
88 | 88 | val = f2(y) |
89 | 89 | @test val == 2y + 1 |
90 | 90 | @test length(cache) == 2 |
91 | | - @test cache[(y,)] == val |
| 91 | + @test cache[(y,)][end] == val |
92 | 92 | @test stats.misses == 2 |
93 | 93 |
|
94 | 94 | clear_cache!(f2) |
|
110 | 110 | @test isequal(val, 2x + 1) |
111 | 111 | cachestruct = associated_cache(fn) |
112 | 112 | cache, stats = cachestruct.tlv[] |
113 | | - @test cache isa Dict{Tuple{Any}, Union{BasicSymbolic, Int}} |
| 113 | + @test cache isa Dict{Tuple{Any}, Tuple{Any, Union{BasicSymbolic, Int}}} |
114 | 114 | @test length(cache) == 1 |
115 | | - @test cache[(SymbolicKey(objectid(x)),)] === val |
| 115 | + @test cache[(SymbolicKey(objectid(x)),)][end] === val |
116 | 116 | @test stats.hits == 0 |
117 | 117 | @test stats.misses == 1 |
118 | 118 | fn(x) |
|
0 commit comments