|
70 | 70 | return 2x + 1
|
71 | 71 | end
|
72 | 72 |
|
73 |
| -@testset "::Union (with `UInt`)" begin |
74 |
| - @syms x |
75 |
| - val = f2(x) |
76 |
| - @test isequal(val, 2x + 1) |
77 |
| - cachestruct = associated_cache(f2) |
78 |
| - cache, stats = cachestruct.tlv[] |
79 |
| - @test cache isa Dict{Tuple{Union{SymbolicKey, UInt}}, Union{BasicSymbolic, UInt}} |
80 |
| - @test length(cache) == 1 |
81 |
| - @test cache[(get_cache_key(x),)] === val |
82 |
| - @test stats.hits == 0 |
83 |
| - @test stats.misses == 1 |
84 |
| - f2(x) |
85 |
| - @test stats.hits == 1 |
86 |
| - @test stats.misses == 1 |
87 |
| - |
88 |
| - y = get_cache_key(x).id |
89 |
| - val = f2(y) |
90 |
| - @test val == 2y + 1 |
91 |
| - @test length(cache) == 2 |
92 |
| - @test cache[(y,)] == val |
93 |
| - @test stats.misses == 2 |
94 |
| - |
95 |
| - clear_cache!(f2) |
96 |
| - @test length(cache) == 0 |
97 |
| - @test stats.hits == stats.misses == stats.clears == 0 |
98 |
| -end |
| 73 | +# @testset "::Union (with `UInt`)" begin |
| 74 | +# @syms x |
| 75 | +# val = f2(x) |
| 76 | +# @test isequal(val, 2x + 1) |
| 77 | +# cachestruct = associated_cache(f2) |
| 78 | +# cache, stats = cachestruct.tlv[] |
| 79 | +# @test cache isa Dict{Tuple{Union{SymbolicKey, UInt}}, Union{BasicSymbolic, UInt}} |
| 80 | +# @test length(cache) == 1 |
| 81 | +# @test cache[(get_cache_key(x),)] === val |
| 82 | +# @test stats.hits == 0 |
| 83 | +# @test stats.misses == 1 |
| 84 | +# f2(x) |
| 85 | +# @test stats.hits == 1 |
| 86 | +# @test stats.misses == 1 |
| 87 | + |
| 88 | +# y = get_cache_key(x).id |
| 89 | +# val = f2(y) |
| 90 | +# @test val == 2y + 1 |
| 91 | +# @test length(cache) == 2 |
| 92 | +# @test cache[(y,)] == val |
| 93 | +# @test stats.misses == 2 |
| 94 | + |
| 95 | +# clear_cache!(f2) |
| 96 | +# @test length(cache) == 0 |
| 97 | +# @test stats.hits == stats.misses == stats.clears == 0 |
| 98 | +# end |
99 | 99 |
|
100 | 100 | @cache function f3(x)::Union{BasicSymbolic, Int}
|
101 | 101 | return 2x + 1
|
|
0 commit comments