File tree Expand file tree Collapse file tree 2 files changed +55
-0
lines changed Expand file tree Collapse file tree 2 files changed +55
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Tests
2+ on :
3+ pull_request :
4+ branches :
5+ - main
6+ push :
7+ branches :
8+ - main
9+
10+ # needed to allow julia-actions/cache to delete old caches that it has created
11+ permissions :
12+ actions : write
13+ contents : read
14+
15+ jobs :
16+ test :
17+ runs-on : ubuntu-latest
18+ strategy :
19+ matrix :
20+ version :
21+ - ' min'
22+ - ' 1'
23+ - ' pre'
24+ steps :
25+ - uses : actions/checkout@v4
26+ - uses : julia-actions/setup-julia@v2
27+ with :
28+ version : ${{ matrix.version }}
29+ - uses : julia-actions/cache@v2
30+ - uses : julia-actions/julia-buildpkg@v1
31+ - uses : julia-actions/julia-runtest@v1
32+ - uses : julia-actions/julia-processcoverage@v1
33+ - uses : codecov/codecov-action@v1
34+ with :
35+ file : lcov.info
Original file line number Diff line number Diff line change 1+ using WeakCacheSets
2+ using Test
3+
4+ # This doesn't work if put inside a testset
5+ wcs = WeakCacheSet {Vector{Int}} ()
6+ # The only function we have is `getkey!`, so we check
7+ # contents using `repr`.
8+ @test repr (wcs) == " WeakCacheSet()"
9+ a = [1 ,2 ,3 ]
10+ b = @inferred getkey! (wcs, a)
11+ @test repr (wcs) == " WeakCacheSet([1, 2, 3])"
12+ @test b === a
13+ c = @inferred getkey! (wcs, b)
14+ @test a === b === c
15+ a = b = c = nothing
16+
17+ # hopefully this is enough
18+ GC. gc (); GC. gc (); GC. gc ()
19+
20+ @test repr (wcs) == " WeakCacheSet()"
You can’t perform that action at this time.
0 commit comments