Add test for std::bitset<N>::reference

Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
This commit is contained in:
Vladislav Shchapov 2023-08-05 13:41:34 +05:00
parent 7ce9a2e7db
commit 4298687d8b

View File

@ -7,6 +7,7 @@
#include "fmt/std.h"
#include <bitset>
#include <stdexcept>
#include <string>
#include <vector>
@ -222,7 +223,9 @@ TEST(std_test, exception) {
#endif
}
TEST(std_test, format_vector_bool_specialization) {
TEST(std_test, format_bit_reference) {
std::bitset<2> bs(1);
EXPECT_EQ(fmt::format("{} {}", bs[0], bs[1]), "true false");
std::vector<bool> v = {true, false};
EXPECT_EQ(fmt::format("{} {}", v[0], v[1]), "true false");
}