Skip to content

Commit

Permalink
Merge pull request #32 from psrenergy/rs/aqua
Browse files Browse the repository at this point in the history
Add project compats and Aqua.jl
  • Loading branch information
raphasampaio authored Jan 2, 2025
2 parents 91ea439 + 037145a commit 2fc472b
Show file tree
Hide file tree
Showing 3 changed files with 101 additions and 15 deletions.
11 changes: 8 additions & 3 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Quiver"
uuid = "cdbb3f72-2527-4dbd-9d0e-93533a5519ac"
authors = ["raphasampaio", "guilhermebodin"]
version = "0.1.7"
version = "0.1.8"

[deps]
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
Expand All @@ -18,17 +18,22 @@ PSRClassesInterface = "1eab49e5-27d8-4905-b9f6-327b6ea666c4"
PSRClassesInterfaceExt = "PSRClassesInterface"

[compat]
Aqua = "0.8"
CSV = "0.10"
DataFrames = "1"
Dates = "1"
OrderedCollections = "1"
PSRClassesInterface = "0.17"
Random = "1"
TOML = "1"
Tables = "1"
julia = "1.8"
Test = "1"
julia = "1.9"

[extras]
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Random", "Test", "PSRClassesInterface"]
test = ["Aqua", "Random", "Test", "PSRClassesInterface"]
9 changes: 9 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
using Aqua
using Quiver
using Test

function test_modules(dir::AbstractString)
Expand All @@ -8,6 +10,13 @@ function test_modules(dir::AbstractString)
return result
end

@testset "Aqua" begin
@testset "Ambiguities" begin
Aqua.test_ambiguities(Quiver, recursive = false)
end
Aqua.test_all(Quiver, ambiguities = false)
end

for file in test_modules(@__DIR__)
@testset "$(basename(file))" begin
include(file)
Expand Down
96 changes: 84 additions & 12 deletions test/test_read_write.jl
Original file line number Diff line number Diff line change
Expand Up @@ -732,10 +732,34 @@ function read_outside_bounds_1(impl)
end
end

@test_throws EOFError Quiver.goto!(reader; stage = num_stages+1, scenario = num_scenarios, block = max_num_blocks, segment = max_num_segments)
@test_throws EOFError Quiver.goto!(reader; stage = num_stages, scenario = num_scenarios+1, block = max_num_blocks, segment = max_num_segments)
@test_throws EOFError Quiver.goto!(reader; stage = num_stages, scenario = num_scenarios, block = max_num_blocks+1, segment = max_num_segments)
@test_throws EOFError Quiver.goto!(reader; stage = num_stages, scenario = num_scenarios, block = max_num_blocks, segment = max_num_segments+1)
@test_throws EOFError Quiver.goto!(
reader;
stage = num_stages + 1,
scenario = num_scenarios,
block = max_num_blocks,
segment = max_num_segments,
)
@test_throws EOFError Quiver.goto!(
reader;
stage = num_stages,
scenario = num_scenarios + 1,
block = max_num_blocks,
segment = max_num_segments,
)
@test_throws EOFError Quiver.goto!(
reader;
stage = num_stages,
scenario = num_scenarios,
block = max_num_blocks + 1,
segment = max_num_segments,
)
@test_throws EOFError Quiver.goto!(
reader;
stage = num_stages,
scenario = num_scenarios,
block = max_num_blocks,
segment = max_num_segments + 1,
)

Quiver.close!(reader)

Expand Down Expand Up @@ -803,10 +827,34 @@ function read_outside_bounds_2(impl)
end
end

@test_throws EOFError Quiver.goto!(reader; stage = num_stages+1, scenario = num_scenarios, block = max_num_blocks, segment = max_num_segments)
@test_throws EOFError Quiver.goto!(reader; stage = num_stages, scenario = num_scenarios+1, block = max_num_blocks, segment = max_num_segments)
@test_throws EOFError Quiver.goto!(reader; stage = num_stages, scenario = num_scenarios, block = max_num_blocks+1, segment = max_num_segments)
@test_throws EOFError Quiver.goto!(reader; stage = num_stages, scenario = num_scenarios, block = max_num_blocks, segment = max_num_segments+1)
@test_throws EOFError Quiver.goto!(
reader;
stage = num_stages + 1,
scenario = num_scenarios,
block = max_num_blocks,
segment = max_num_segments,
)
@test_throws EOFError Quiver.goto!(
reader;
stage = num_stages,
scenario = num_scenarios + 1,
block = max_num_blocks,
segment = max_num_segments,
)
@test_throws EOFError Quiver.goto!(
reader;
stage = num_stages,
scenario = num_scenarios,
block = max_num_blocks + 1,
segment = max_num_segments,
)
@test_throws EOFError Quiver.goto!(
reader;
stage = num_stages,
scenario = num_scenarios,
block = max_num_blocks,
segment = max_num_segments + 1,
)

Quiver.close!(reader)

Expand Down Expand Up @@ -873,10 +921,34 @@ function read_outside_bounds_3(impl)
end
end

@test_throws EOFError Quiver.goto!(reader; stage = num_stages+1, scenario = max_num_scenarios, block = num_blocks, segment = max_num_segments)
@test_throws EOFError Quiver.goto!(reader; stage = num_stages, scenario = max_num_scenarios+1, block = num_blocks, segment = max_num_segments)
@test_throws EOFError Quiver.goto!(reader; stage = num_stages, scenario = max_num_scenarios, block = num_blocks+1, segment = max_num_segments)
@test_throws EOFError Quiver.goto!(reader; stage = num_stages, scenario = max_num_scenarios, block = num_blocks, segment = max_num_segments+1)
@test_throws EOFError Quiver.goto!(
reader;
stage = num_stages + 1,
scenario = max_num_scenarios,
block = num_blocks,
segment = max_num_segments,
)
@test_throws EOFError Quiver.goto!(
reader;
stage = num_stages,
scenario = max_num_scenarios + 1,
block = num_blocks,
segment = max_num_segments,
)
@test_throws EOFError Quiver.goto!(
reader;
stage = num_stages,
scenario = max_num_scenarios,
block = num_blocks + 1,
segment = max_num_segments,
)
@test_throws EOFError Quiver.goto!(
reader;
stage = num_stages,
scenario = max_num_scenarios,
block = num_blocks,
segment = max_num_segments + 1,
)

Quiver.close!(reader)

Expand Down

0 comments on commit 2fc472b

Please sign in to comment.