Skip to content

Commit

Permalink
Merge pull request #297 from JuliaDatabases/ed/fix-test_broken
Browse files Browse the repository at this point in the history
Fix use of test_broken on Julia 1.10
  • Loading branch information
iamed2 authored Aug 8, 2024
2 parents 1969872 + 26cc1bd commit 4752ef0
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/blue_style_formatter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
version: 1
- run: |
julia -e 'using Pkg; Pkg.add("JuliaFormatter")'
julia -e 'using JuliaFormatter; format(".", BlueStyle(); verbose=true)'
julia -e 'using JuliaFormatter; format(".", BlueStyle(); verbose=true, ignore=["test/runtests.jl"])'
- uses: reviewdog/action-suggester@v1
with:
tool_name: JuliaFormatter
Expand Down
33 changes: 24 additions & 9 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1311,12 +1311,21 @@ end
any(T -> data isa T, binary_not_implemented_types) ||
any(occursin.(binary_not_implemented_pgtypes, test_str))
)
@test_broken parsed = func(LibPQ.PQValue{oid}(result, 1, 1))
@test_broken isequal(parsed, data)
@test_broken typeof(parsed) == typeof(data)
@test_broken parsed_no_oid = func(LibPQ.PQValue(result, 1, 1))
@test_broken isequal(parsed_no_oid, data)
@test_broken typeof(parsed_no_oid) == typeof(data)
# this allows us to not care whether we error in the func call or in the tests, considering those both successful breaks
# an error will pass the outer @test_broken and skip the rest
@test_broken let
parsed = func(LibPQ.PQValue{oid}(result, 1, 1))
@test_broken isequal(parsed, data)
@test_broken typeof(parsed) == typeof(data)
# Julia 1.10+ requires @test_broken receive a boolean
false
end
@test_broken let
parsed_no_oid = func(LibPQ.PQValue(result, 1, 1))
@test_broken isequal(parsed_no_oid, data)
@test_broken typeof(parsed_no_oid) == typeof(data)
false
end
else
parsed = func(LibPQ.PQValue{oid}(result, 1, 1))
@test isequal(parsed, data)
Expand Down Expand Up @@ -1389,9 +1398,15 @@ end
any(T -> data isa T, binary_not_implemented_types) ||
any(occursin.(binary_not_implemented_pgtypes, test_str))
)
@test_broken parsed = func(LibPQ.PQValue{oid}(result, 1, 1))
@test_broken parsed == data
@test_broken typeof(parsed) == typeof(data)
# this allows us to not care whether we error in the func call or in the tests, considering those both successful breaks
# an error will pass the outer @test_broken and skip the rest
@test_broken let
parsed = func(LibPQ.PQValue{oid}(result, 1, 1))
@test_broken parsed == data
@test_broken typeof(parsed) == typeof(data)
# Julia 1.10+ requires @test_broken receive a boolean
false
end
else
parsed = func(LibPQ.PQValue{oid}(result, 1, 1))
@test parsed == data
Expand Down

0 comments on commit 4752ef0

Please sign in to comment.