Skip to content

Commit 4752ef0

Browse files
authored
Merge pull request #297 from JuliaDatabases/ed/fix-test_broken
Fix use of test_broken on Julia 1.10
2 parents 1969872 + 26cc1bd commit 4752ef0

File tree

2 files changed

+25
-10
lines changed

2 files changed

+25
-10
lines changed

.github/workflows/blue_style_formatter.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
version: 1
1414
- run: |
1515
julia -e 'using Pkg; Pkg.add("JuliaFormatter")'
16-
julia -e 'using JuliaFormatter; format(".", BlueStyle(); verbose=true)'
16+
julia -e 'using JuliaFormatter; format(".", BlueStyle(); verbose=true, ignore=["test/runtests.jl"])'
1717
- uses: reviewdog/action-suggester@v1
1818
with:
1919
tool_name: JuliaFormatter

test/runtests.jl

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1311,12 +1311,21 @@ end
13111311
any(T -> data isa T, binary_not_implemented_types) ||
13121312
any(occursin.(binary_not_implemented_pgtypes, test_str))
13131313
)
1314-
@test_broken parsed = func(LibPQ.PQValue{oid}(result, 1, 1))
1315-
@test_broken isequal(parsed, data)
1316-
@test_broken typeof(parsed) == typeof(data)
1317-
@test_broken parsed_no_oid = func(LibPQ.PQValue(result, 1, 1))
1318-
@test_broken isequal(parsed_no_oid, data)
1319-
@test_broken typeof(parsed_no_oid) == typeof(data)
1314+
# this allows us to not care whether we error in the func call or in the tests, considering those both successful breaks
1315+
# an error will pass the outer @test_broken and skip the rest
1316+
@test_broken let
1317+
parsed = func(LibPQ.PQValue{oid}(result, 1, 1))
1318+
@test_broken isequal(parsed, data)
1319+
@test_broken typeof(parsed) == typeof(data)
1320+
# Julia 1.10+ requires @test_broken receive a boolean
1321+
false
1322+
end
1323+
@test_broken let
1324+
parsed_no_oid = func(LibPQ.PQValue(result, 1, 1))
1325+
@test_broken isequal(parsed_no_oid, data)
1326+
@test_broken typeof(parsed_no_oid) == typeof(data)
1327+
false
1328+
end
13201329
else
13211330
parsed = func(LibPQ.PQValue{oid}(result, 1, 1))
13221331
@test isequal(parsed, data)
@@ -1389,9 +1398,15 @@ end
13891398
any(T -> data isa T, binary_not_implemented_types) ||
13901399
any(occursin.(binary_not_implemented_pgtypes, test_str))
13911400
)
1392-
@test_broken parsed = func(LibPQ.PQValue{oid}(result, 1, 1))
1393-
@test_broken parsed == data
1394-
@test_broken typeof(parsed) == typeof(data)
1401+
# this allows us to not care whether we error in the func call or in the tests, considering those both successful breaks
1402+
# an error will pass the outer @test_broken and skip the rest
1403+
@test_broken let
1404+
parsed = func(LibPQ.PQValue{oid}(result, 1, 1))
1405+
@test_broken parsed == data
1406+
@test_broken typeof(parsed) == typeof(data)
1407+
# Julia 1.10+ requires @test_broken receive a boolean
1408+
false
1409+
end
13951410
else
13961411
parsed = func(LibPQ.PQValue{oid}(result, 1, 1))
13971412
@test parsed == data

0 commit comments

Comments
 (0)