Skip to content

Commit d243b9f

Browse files
test: update test with new cache structure
1 parent 2856c67 commit d243b9f

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

test/cache_macro.jl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ end
1313
@test isequal(val, 2x + 1)
1414
cachestruct = associated_cache(f1)
1515
cache, stats = cachestruct.tlv[]
16-
@test cache isa Dict{Tuple{SymbolicKey}, BasicSymbolic}
16+
@test cache isa Dict{Tuple{SymbolicKey}, Tuple{BasicSymbolic, BasicSymbolic}}
1717
@test length(cache) == 1
18-
@test cache[(SymbolicKey(objectid(x)),)] === val
18+
@test cache[(SymbolicKey(objectid(x)),)][end] === val
1919
@test stats.hits == 0
2020
@test stats.misses == 1
2121
f1(x)
@@ -75,9 +75,9 @@ end
7575
@test isequal(val, 2x + 1)
7676
cachestruct = associated_cache(f2)
7777
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}}}
7979
@test length(cache) == 1
80-
@test cache[(SymbolicKey(objectid(x)),)] === val
80+
@test cache[(SymbolicKey(objectid(x)),)][end] === val
8181
@test stats.hits == 0
8282
@test stats.misses == 1
8383
f2(x)
@@ -88,7 +88,7 @@ end
8888
val = f2(y)
8989
@test val == 2y + 1
9090
@test length(cache) == 2
91-
@test cache[(y,)] == val
91+
@test cache[(y,)][end] == val
9292
@test stats.misses == 2
9393

9494
clear_cache!(f2)
@@ -110,9 +110,9 @@ end
110110
@test isequal(val, 2x + 1)
111111
cachestruct = associated_cache(fn)
112112
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}}}
114114
@test length(cache) == 1
115-
@test cache[(SymbolicKey(objectid(x)),)] === val
115+
@test cache[(SymbolicKey(objectid(x)),)][end] === val
116116
@test stats.hits == 0
117117
@test stats.misses == 1
118118
fn(x)

0 commit comments

Comments
 (0)