@@ -697,13 +697,13 @@ TEST(core_test, format_to_c_array) {
697
697
char buffer[4 ];
698
698
auto result = fmt::format_to (buffer, " {}" , 12345 );
699
699
EXPECT_EQ (4 , std::distance (&buffer[0 ], result.out ));
700
- EXPECT_EQ ( 0 , std::distance ( result.out , result. out_last ) );
700
+ EXPECT_TRUE ( result.truncated );
701
701
EXPECT_EQ (buffer + 4 , result.out );
702
702
EXPECT_EQ (" 1234" , fmt::string_view (buffer, 4 ));
703
703
704
704
result = fmt::format_to (buffer, " {:s}" , " foobar" );
705
705
EXPECT_EQ (4 , std::distance (&buffer[0 ], result.out ));
706
- EXPECT_EQ ( 0 , std::distance ( result.out , result. out_last ) );
706
+ EXPECT_TRUE ( result.truncated );
707
707
EXPECT_EQ (buffer + 4 , result.out );
708
708
EXPECT_EQ (" foob" , fmt::string_view (buffer, 4 ));
709
709
@@ -713,24 +713,24 @@ TEST(core_test, format_to_c_array) {
713
713
buffer[3 ] = ' x' ;
714
714
result = fmt::format_to (buffer, " {}" , ' A' );
715
715
EXPECT_EQ (1 , std::distance (&buffer[0 ], result.out ));
716
- EXPECT_EQ ( 3 , std::distance ( result.out , result. out_last ) );
716
+ EXPECT_FALSE ( result.truncated );
717
717
EXPECT_EQ (buffer + 1 , result.out );
718
718
EXPECT_EQ (" Axxx" , fmt::string_view (buffer, 4 ));
719
719
720
720
result = fmt::format_to (buffer, " {}{} " , ' B' , ' C' );
721
721
EXPECT_EQ (3 , std::distance (&buffer[0 ], result.out ));
722
- EXPECT_EQ ( 1 , std::distance ( result.out , result. out_last ) );
722
+ EXPECT_FALSE ( result.truncated );
723
723
EXPECT_EQ (buffer + 3 , result.out );
724
724
EXPECT_EQ (" BC x" , fmt::string_view (buffer, 4 ));
725
725
726
726
result = fmt::format_to (buffer, " {}" , " ABCDE" );
727
727
EXPECT_EQ (4 , std::distance (&buffer[0 ], result.out ));
728
- EXPECT_EQ ( 0 , std::distance ( result.out , result. out_last ) );
728
+ EXPECT_TRUE ( result.truncated );
729
729
EXPECT_EQ (" ABCD" , fmt::string_view (buffer, 4 ));
730
730
731
731
result = fmt::format_to (buffer, " {}" , std::string (1000 , ' *' ));
732
732
EXPECT_EQ (4 , std::distance (&buffer[0 ], result.out ));
733
- EXPECT_EQ ( 0 , std::distance ( result.out , result. out_last ) );
733
+ EXPECT_TRUE ( result.truncated );
734
734
EXPECT_EQ (" ****" , fmt::string_view (buffer, 4 ));
735
735
}
736
736
0 commit comments