@@ -462,26 +462,26 @@ end
462462 @test utime (z) == 1
463463 @test ustrip (z) ≈ 60 * 60 * 24 * 365.25
464464
465- # Test that `u_str` respects original type:
466- @test typeof (u " 1" ) == Int
467- @test typeof (u " 1f0" ) == Float32
465+ # Test type stability of extreme range of units
466+ @test typeof (u " 1" ) == DEFAULT_QUANTITY_TYPE
467+ @test typeof (u " 1f0" ) == DEFAULT_QUANTITY_TYPE
468468 @test typeof (u " s" ^ 2 ) == DEFAULT_QUANTITY_TYPE
469469 @test typeof (u " Ω" ) == DEFAULT_QUANTITY_TYPE
470470 @test typeof (u " Gyr" ) == DEFAULT_QUANTITY_TYPE
471471 @test typeof (u " fm" ) == DEFAULT_QUANTITY_TYPE
472472 @test typeof (u " fm" ^ 2 ) == DEFAULT_QUANTITY_TYPE
473473
474- # Can also use tuples:
475- @test typeof (u " (m, s)" ) == Tuple{DEFAULT_QUANTITY_TYPE, DEFAULT_QUANTITY_TYPE}
474+ @test_throws ErrorException eval (:(u " :x" ))
476475
477- @test_throws LoadError eval (:(u " x" ))
478476 VERSION >= v " 1.9" && @test_throws " Symbol x not found" uparse (" x" )
479477 VERSION >= v " 1.9" && @test_throws " Symbol c found in `Constants` but not `Units`" uparse (" c" )
480478 VERSION >= v " 1.9" && @test_throws " Unexpected expression" uparse (" import ..Units" )
479+ VERSION >= v " 1.9" && @test_throws " Unexpected expression" uparse (" (m, m)" )
481480 @test_throws LoadError eval (:(us " x" ))
482481 VERSION >= v " 1.9" && @test_throws " Symbol x not found" sym_uparse (" x" )
483482 VERSION >= v " 1.9" && @test_throws " Symbol c found in `SymbolicConstants` but not `SymbolicUnits`" sym_uparse (" c" )
484483 VERSION >= v " 1.9" && @test_throws " Unexpected expression" sym_uparse (" import ..Units" )
484+ VERSION >= v " 1.9" && @test_throws " Unexpected expression" sym_uparse (" (m, m)" )
485485end
486486
487487@testset " Constants" begin
0 commit comments