Skip to content

Commit 76737ff

Browse files
committed
More coverage
1 parent d173a25 commit 76737ff

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

test/unittests.jl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ using DynamicQuantities: DEFAULT_QUANTITY_TYPE, DEFAULT_DIM_BASE_TYPE, DEFAULT_D
44
using DynamicQuantities: array_type, value_type, dim_type, quantity_type
55
using DynamicQuantities: GenericQuantity, with_type_parameters, constructorof
66
using DynamicQuantities: promote_quantity_on_quantity, promote_quantity_on_value
7+
using DynamicQuantities: map_dimensions
78
using Ratios: SimpleRatio
89
using SaferIntegers: SafeInt16
910
using StaticArrays: SArray, MArray
@@ -749,6 +750,14 @@ end
749750
z = uexpand(x)
750751
@test x == z
751752

753+
# Trigger part of map_dimensions missed elsewhere
754+
x = us"km"
755+
y = us"km"
756+
@test x * y |> uexpand == u"km^2"
757+
@test x / y |> uexpand == u"1"
758+
@test map_dimensions(+, dimension(us"km"), dimension(us"km")) == dimension(us"km^2")
759+
@test map_dimensions(-, dimension(us"km"), dimension(us"km")) == dimension(us"1")
760+
752761
@testset "Promotion with Dimensions" begin
753762
x = 0.5u"cm"
754763
y = -0.03u"m"

0 commit comments

Comments
 (0)