@@ -379,20 +379,21 @@ end
379379 @test ustrip (z) ≈ 60 * 60 * 24 * 365.25
380380
381381 # Test type stability of extreme range of units
382- @test typeof (u " 1" ) == Quantity{ DEFAULT_UNIT_TYPE,DEFAULT_DIM_TYPE}
383- @test typeof (u " 1f0" ) == Quantity{ DEFAULT_UNIT_TYPE,DEFAULT_DIM_TYPE}
384- @test typeof (u " s" ^ 2 ) == Quantity{ DEFAULT_UNIT_TYPE,DEFAULT_DIM_TYPE}
385- @test typeof (u " Ω" ) == Quantity{ DEFAULT_UNIT_TYPE,DEFAULT_DIM_TYPE}
386- @test typeof (u " Gyr" ) == Quantity{ DEFAULT_UNIT_TYPE,DEFAULT_DIM_TYPE}
387- @test typeof (u " fm" ) == Quantity{ DEFAULT_UNIT_TYPE,DEFAULT_DIM_TYPE}
388- @test typeof (u " fm" ^ 2 ) == Quantity{ DEFAULT_UNIT_TYPE,DEFAULT_DIM_TYPE}
382+ @test typeof (u " 1" ) == DEFAULT_UNIT_TYPE
383+ @test typeof (u " 1f0" ) == DEFAULT_UNIT_TYPE
384+ @test typeof (u " s" ^ 2 ) == DEFAULT_UNIT_TYPE
385+ @test typeof (u " Ω" ) == DEFAULT_UNIT_TYPE
386+ @test typeof (u " Gyr" ) == DEFAULT_UNIT_TYPE
387+ @test typeof (u " fm" ) == DEFAULT_UNIT_TYPE
388+ @test typeof (u " fm" ^ 2 ) == DEFAULT_UNIT_TYPE
389389
390390 # Test type demotion
391- @test typeof (1 u " m" ) == Quantity{Int64 ,DEFAULT_DIM_TYPE}
391+ @test typeof (1 u " m" ) == Quantity{Float64 ,DEFAULT_DIM_TYPE}
392392 @test typeof (1f0 u " m" ) == Quantity{Float32,DEFAULT_DIM_TYPE}
393393 @test typeof (1.0 u " m" ) == Quantity{Float64,DEFAULT_DIM_TYPE}
394+ @test typeof (Float16 (1.0 )u " m" ) == Quantity{Float16,DEFAULT_DIM_TYPE}
394395
395- @test typeof (1 u " m^2/s" ) == Quantity{Int64 ,DEFAULT_DIM_TYPE}
396+ @test typeof (1 u " m^2/s" ) == Quantity{Float64 ,DEFAULT_DIM_TYPE}
396397 @test typeof (1f0 u " m^2/s" ) == Quantity{Float32,DEFAULT_DIM_TYPE}
397398 @test typeof (1.0 u " m^2/s" ) == Quantity{Float64,DEFAULT_DIM_TYPE}
398399
651652 @test promote (x, y) == (x, y)
652653 @test_throws ErrorException promote (x, convert (FixedRational{Int32,100 }, 10 ))
653654 @test round (Missing, x) === missing
654- @test promote_type (typeof (u " km/s" ), typeof (convert (Quantity{Float32}, u " km/s" ))) <: Quantity{Float64}
655+ @test promote_type (typeof (1.0 u " km/s" ), typeof (convert (Quantity{Float32}, u " km/s" ))) <: Quantity{Float64}
655656
656657 x = 1.0 u " m"
657658 y = missing
0 commit comments