Skip to content

Commit a575e0b

Browse files
committed
Add test for Quantity + Dual
1 parent 65475bf commit a575e0b

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

test/unittests.jl

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,12 @@ using Unitful: Unitful
2828
@inferred base_numeric_type(1.5DynamicQuantities.u"km/s")
2929
end
3030

31-
@test base_numeric_type(1.5DynamicQuantities.u"km/s") == base_numeric_type(typeof(1.5DynamicQuantities.u"km/s"))
32-
@inferred base_numeric_type(1.5DynamicQuantities.u"km/s")
31+
@testset "Nested types" begin
32+
# Quantity ∘ Measurement:
33+
x = 5Unitful.u"m/s" ± 0.1Unitful.u"m/s"
34+
@test base_numeric_type(x) == Float64
35+
36+
# Quantity ∘ Dual:
37+
y = Dual(1.0)Unitful.u"m/s"
38+
@test base_numeric_type(y) == Float64
39+
end

0 commit comments

Comments
 (0)