Address feedback from Victor

This commit is contained in:
Mark Santaniello 2022-08-09 16:32:08 -07:00
parent b519f0ce7e
commit a703799f8c
2 changed files with 4 additions and 17 deletions

View File

@ -28,19 +28,10 @@ jobs:
std: 17
install: sudo apt install g++-8
os: ubuntu-18.04
- cxx: g++-9
build_type: Debug
std: 20
install: sudo apt install g++-9
os: ubuntu-18.04
- cxx: g++-10
build_type: Debug
std: 17
os: ubuntu-18.04
- cxx: g++-10
build_type: Debug
std: 20
os: ubuntu-18.04
- cxx: g++-11
build_type: Debug
std: 20

View File

@ -227,18 +227,14 @@ TEST(compile_test, format_to_n) {
EXPECT_STREQ("2a", buffer);
}
TEST(compile_test, formatted_size) {
#ifdef __cpp_lib_bit_cast
FMT_CONSTEXPR20
#endif
size_t s1 = fmt::formatted_size(FMT_COMPILE("{0}"), 42);
TEST(compile_test, constexpr_formatted_size) {
FMT_CONSTEXPR20 size_t s1 = fmt::formatted_size(FMT_COMPILE("{0}"), 42);
EXPECT_EQ(2, s1);
#ifdef __cpp_lib_bit_cast
FMT_CONSTEXPR20
#endif
size_t s2 = fmt::formatted_size(FMT_COMPILE("{0:<4.2f}"), 42.0);
FMT_CONSTEXPR20 size_t s2 = fmt::formatted_size(FMT_COMPILE("{0:<4.2f}"), 42.0);
EXPECT_EQ(5, s2);
}
#endif
TEST(compile_test, text_and_arg) {
EXPECT_EQ(">>>42<<<", fmt::format(FMT_COMPILE(">>>{}<<<"), 42));