Skip to content

Commit 30e5aa1

Browse files
committed
Fix coveralls testing coverage
1 parent 3ac2fbe commit 30e5aa1

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

test/unittests.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,11 @@ end
428428
end
429429
@test show_string(FixedRational{Int,10}(2)) == "2"
430430
@test show_string(FixedRational{Int,10}(11//10)) == "11//10"
431+
432+
# Promotion rules
433+
@test promote_type(FixedRational{Int64,10},FixedRational{BigInt,10}) == FixedRational{BigInt,10}
434+
@test promote_type(Rational{Int8}, FixedRational{Int,12345}) == Rational{Int}
435+
@test promote_type(Int8, FixedRational{Int,12345}) == promote_type(Int8, Rational{Int})
431436
end
432437

433438
@testset "Quantity promotion" begin
@@ -541,6 +546,7 @@ end
541546
@test promote(x, y) == (x, y)
542547
@test_throws ErrorException promote(x, convert(FixedRational{Int32,100}, 10))
543548
@test round(Missing, x) === missing
549+
@test promote_type(typeof(u"km/s"), typeof(convert(Quantity{Float32}, u"km/s"))) <: Quantity{Float64}
544550

545551
x = 1.0u"m"
546552
y = missing
@@ -669,6 +675,7 @@ end
669675
expected_D = Dimensions{Rational{Int64}}
670676
expected_type = QuantityArray{expected_T,1,expected_D,Quantity{Float64,expected_D},Array{expected_T,1}}
671677

678+
@test promote_type(typeof(qarr1), typeof(qarr2)) == expected_type
672679
@test typeof(promote(qarr1, qarr2)) == Tuple{expected_type, expected_type}
673680
end
674681

0 commit comments

Comments
 (0)