@@ -392,16 +392,26 @@ TEST(int128, literals)
392392
393393TEST (int128, from_string)
394394{
395- constexpr auto ka = from_string<uint128>(" 18446744073709551617" );
396- static_assert (ka == uint128{1 , 1 });
397- const auto * const sa = " 18446744073709551617" ;
398- const auto a = from_string<uint128>(sa);
399- EXPECT_EQ (a, uint128 (1 , 1 ));
400-
401- constexpr auto kb = from_string<uint128>(" 0x300aabbccddeeff99" );
402- static_assert (kb == uint128{0xaabbccddeeff99 , 3 });
403- const auto * const sb = " 0x300aabbccddeeff99" ;
404- EXPECT_EQ (from_string<uint128>(sb), uint128 (0xaabbccddeeff99 , 3 ));
395+ {
396+ constexpr auto k = from_string<uint128>(" 18446744073709551617" );
397+ static_assert (k == uint128{1 , 1 });
398+ const auto * const s = " 18446744073709551617" ;
399+ EXPECT_EQ (from_string<uint128>(s), uint128 (1 , 1 ));
400+ }
401+
402+ {
403+ constexpr auto k = from_string<uint128>(" 0x300aabbccddeeff99" );
404+ static_assert (k == uint128{0xaabbccddeeff99 , 3 });
405+ const auto * const s = " 0x300aabbccddeeff99" ;
406+ EXPECT_EQ (from_string<uint128>(s), uint128 (0xaabbccddeeff99 , 3 ));
407+ }
408+
409+ {
410+ constexpr auto k = from_string<uint128>(" 0X300AABBCCDDEEFF99" );
411+ static_assert (k == uint128{0xaabbccddeeff99 , 3 });
412+ const auto * const s = " 0X300AABBCCDDEEFF99" ;
413+ EXPECT_EQ (from_string<uint128>(s), uint128 (0xaabbccddeeff99 , 3 ));
414+ }
405415}
406416
407417TEST (int128, from_string_exceptions)
0 commit comments