Skip to content

Commit 464141d

Browse files
committed
test: ustrip with affine units
1 parent 284586f commit 464141d

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
@@ -2089,6 +2089,15 @@ end
20892089
@test sprint(show, °C) == "°C"
20902090

20912091
@test sprint(show, °F) == "°F"
2092+
2093+
# Test the two-argument ustrip method with AffineUnit
2094+
@test ustrip(ua"degC", 273.15u"K") 0.0
2095+
@test ustrip(ua"degC", 300.15u"K") 27.0
2096+
@test ustrip(ua"degF", 273.15u"K") 32.0
2097+
@test ustrip(ua"degF", 300.15u"K") 80.6
2098+
@test ustrip(ua"degC", 22ua"degC") 22.0
2099+
@test ustrip(ua"degF", 22ua"degC") 71.6
2100+
@test_throws DimensionError ustrip(ua"degC", 1.0u"m")
20922101
end
20932102

20942103
@testset "Test div" begin

0 commit comments

Comments
 (0)