Skip to content

Commit 2dc4fc7

Browse files
committed
edits to version and tests
1 parent 3e124a0 commit 2dc4fc7

File tree

2 files changed

+54
-51
lines changed

2 files changed

+54
-51
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,16 @@ on:
99
jobs:
1010
test:
1111
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
julia-version: ['1.6', '1']
1215

1316
steps:
1417
- uses: actions/checkout@v4
1518

1619
- uses: julia-actions/setup-julia@v1
1720
with:
18-
version: "1" # <-- Or your preferred Julia version
19-
21+
version: ${{ matrix.julia-version }}
2022
- name: Cache Julia deps
2123
uses: actions/cache@v4
2224
with:
@@ -25,7 +27,7 @@ jobs:
2527
~/.julia/compiled
2628
~/.julia/environments
2729
~/.julia/packages
28-
key: ${{ runner.os }}-julia-${{ hashFiles('Project.toml', 'Manifest.toml') }}
30+
key: ${{ runner.os }}-julia-${{ matrix.julia-version }}-${{ hashFiles('Project.toml', 'Manifest.toml') }}
2931

3032
- name: Install dependencies
3133
run: julia --project=. -e 'import Pkg; Pkg.instantiate()'

test/runtests.jl

Lines changed: 49 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -5,51 +5,52 @@ atlasFileName = joinpath(@__DIR__, "test.jsonl") # Path to your test file
55
atlasFileNameGziped = joinpath(@__DIR__, "test.jsonl.gz") # Path to your test file
66
first_map_truth= Dict{Tuple{Vararg{String}}, Int64}(("p2", "c2") => 1, ("p1", "c2") => 1, ("p3", "c7", "b100") => 2)
77
second_map_truth=Dict{Tuple{Vararg{String}}, Int64}(("p2", "c2") => 2, ("p1", "c2") => 1, ("p3", "c7", "b100") => 1)
8-
9-
@testset "Atlas Reading" begin
10-
11-
io = smartOpen(atlasFileName, "r")
12-
atlas = openAtlas(io)
13-
@test !eof(atlas) # The atlas should have content
14-
@test atlas.description == "Test Atlas" # Replace with expected description
15-
16-
# Read the first map and check its properties
17-
first_map = nextMap(atlas)
18-
# Example checks — adapt to your test file fields
19-
@test first_map.name == "map1" # Replace "map1" with expected map name
20-
@test length(first_map.districting) == 3 # Replace 100 with expected size
21-
@test first_map.districting == first_map_truth # Check if the first map matches the expected structure
22-
23-
second_map = nextMap(atlas)
24-
@test second_map.name == "map2" # Replace "map1" with expected map name
25-
@test length(second_map.districting) == 3 # Replace 100 with expected size
26-
@test second_map.districting == second_map_truth # Check if the first map matches the expected structure
27-
28-
29-
# Clean up
30-
close(io)
31-
end
32-
33-
@testset "Compressed Atlas Reading" begin
34-
35-
io = smartOpen(atlasFileNameGziped, "r")
36-
atlas = openAtlas(io)
37-
@test !eof(atlas) # The atlas should have content
38-
@test atlas.description == "Test Atlas" # Replace with expected description
39-
40-
# Read the first map and check its properties
41-
first_map = nextMap(atlas)
42-
# Example checks — adapt to your test file fields
43-
@test first_map.name == "map1" # Replace "map1" with expected map name
44-
@test length(first_map.districting) == 3 # Replace 100 with expected size
45-
@test first_map.districting == first_map_truth # Check if the first map matches the expected structure
46-
47-
second_map = nextMap(atlas)
48-
@test second_map.name == "map2" # Replace "map1" with expected map name
49-
@test length(second_map.districting) == 3 # Replace 100 with expected size
50-
@test second_map.districting == second_map_truth # Check if the first map matches the expected structure
51-
52-
53-
# Clean up
54-
close(io)
55-
end
8+
@testset verbose = true "Atlas Tests" begin
9+
@testset "Compressed Atlas Reading" begin
10+
11+
io = smartOpen(atlasFileName, "r")
12+
atlas = openAtlas(io)
13+
@test !eof(atlas) # The atlas should have content
14+
@test atlas.description == "Test Atlas" # Replace with expected description
15+
16+
# Read the first map and check its properties
17+
first_map = nextMap(atlas)
18+
# Example checks — adapt to your test file fields
19+
@test first_map.name == "map1" # Replace "map1" with expected map name
20+
@test length(first_map.districting) == 3 # Replace 100 with expected size
21+
@test first_map.districting == first_map_truth # Check if the first map matches the expected structure
22+
23+
second_map = nextMap(atlas)
24+
@test second_map.name == "map2" # Replace "map1" with expected map name
25+
@test length(second_map.districting) == 3 # Replace 100 with expected size
26+
@test second_map.districting == second_map_truth # Check if the first map matches the expected structure
27+
28+
29+
# Clean up
30+
close(io)
31+
end
32+
33+
@testset "Compressed Atlas Reading" begin
34+
35+
io = smartOpen(atlasFileNameGziped, "r")
36+
atlas = openAtlas(io)
37+
@test !eof(atlas) # The atlas should have content
38+
@test atlas.description == "Test Atlas" # Replace with expected description
39+
40+
# Read the first map and check its properties
41+
first_map = nextMap(atlas)
42+
# Example checks — adapt to your test file fields
43+
@test first_map.name == "map1" # Replace "map1" with expected map name
44+
@test length(first_map.districting) == 3 # Replace 100 with expected size
45+
@test first_map.districting == first_map_truth # Check if the first map matches the expected structure
46+
47+
second_map = nextMap(atlas)
48+
@test second_map.name == "map2" # Replace "map1" with expected map name
49+
@test length(second_map.districting) == 3 # Replace 100 with expected size
50+
@test second_map.districting == second_map_truth # Check if the first map matches the expected structure
51+
52+
53+
# Clean up
54+
close(io)
55+
end;
56+
end;

0 commit comments

Comments
 (0)