Skip to content

Commit

Permalink
Fix zero tests on Julia master
Browse files Browse the repository at this point in the history
Broken tests were fixed by JuliaLang/julia#48221
  • Loading branch information
sostock committed Feb 1, 2023
1 parent e2aa6f8 commit 2c06f4c
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1429,17 +1429,24 @@ end
@test zero(Quantity[1m, 1s]) == [0m, 0s]
@test zero([1mm, missing]) == [0mm, 0mm]
@test zero(Union{typeof(0.0s),Missing}[missing]) == [0.0s]
@test_broken zero(Union{Quantity{Int,𝐋},Missing}[1mm, missing]) == [0mm, 0m]
@test_broken zero(Union{Quantity{Float64,𝐋},Missing}[1.0mm, missing]) == [0.0mm, 0.0m]
if VERSION v"1.10.0-DEV.425"
@test zero(Union{Quantity{Int,𝐋},Missing}[1mm, missing]) == [0m, 0m]
@test zero(Union{Quantity{Float64,𝐋},Missing}[1.0mm, missing]) == [0.0m, 0.0m]
@test zero(Union{Quantity{Int,𝚯},Missing}[1°C, 2°F, missing]) == [0K, 0K, 0K]
@test zero(Vector{Union{Quantity{Float64,𝐋},Missing}}(undef, 1)) == [0.0m]
else
@test_broken zero(Union{Quantity{Int,𝐋},Missing}[1mm, missing]) == [0m, 0m]
@test_broken zero(Union{Quantity{Float64,𝐋},Missing}[1.0mm, missing]) == [0.0m, 0.0m]
@test_broken zero(Union{Quantity{Int,𝚯},Missing}[1°C, 2°F, missing]) == [0K, 0K, 0K]
@test_broken zero(Vector{Union{Quantity{Float64,𝐋},Missing}}(undef, 1)) == [0.0m]
end
@test_broken zero(Union{Quantity,Missing}[1m, 1mm]) == [0m, 0mm]
@test zero([1°C, 2°C]) == [0K, 0K]
@test zero(Quantity[1°C, 2°F]) == [0K, 0K]
@test zero(Union{typeof(0°C),Missing}[missing]) == [0K]
@test_broken zero(Union{Quantity{Int,𝚯},Missing}[1°C, 2°F, missing]) == [0K, 0K, 0K]
@test zero(Vector{typeof(big(1)mm)}(undef, 1)) == [big(0)mm]
@test zero(Vector{Union{typeof(big(1)mm),Missing}}(undef, 1)) == [big(0)mm]
@test zero(Vector{Quantity{Float64,𝐋}}(undef, 1)) == [0.0m]
@test_broken zero(Vector{Union{Quantity{Float64,𝐋},Missing}}(undef, 1)) == [0.0m]
@test_throws MethodError zero(Union{Quantity,Missing}[1m, 1s, missing])
@test_throws MethodError zero(Vector{Quantity}(undef, 1))
@test_throws MethodError zero(Vector{Union{Quantity,Missing}}(undef, 1))
Expand Down

0 comments on commit 2c06f4c

Please sign in to comment.