Improve test
This commit is contained in:
parent
4556ea12de
commit
a7d70b5dfd
@ -426,13 +426,6 @@ TEST(ranges_test, container_adaptor) {
|
|||||||
EXPECT_EQ(fmt::format("{}", s), "[1, 2]");
|
EXPECT_EQ(fmt::format("{}", s), "[1, 2]");
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
|
||||||
std::stack<int, std::vector<int>> s;
|
|
||||||
s.push(1);
|
|
||||||
s.push(2);
|
|
||||||
EXPECT_EQ(fmt::format("{}", s), "[1, 2]");
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
{
|
||||||
std::queue<int> q;
|
std::queue<int> q;
|
||||||
q.push(1);
|
q.push(1);
|
||||||
@ -449,6 +442,16 @@ TEST(ranges_test, container_adaptor) {
|
|||||||
EXPECT_EQ(fmt::format("{}", q), "[4, 3, 2, 1]");
|
EXPECT_EQ(fmt::format("{}", q), "[4, 3, 2, 1]");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
std::stack<char, std::string> s;
|
||||||
|
s.push('a');
|
||||||
|
s.push('b');
|
||||||
|
// Note: The output is formatted as a string because the underlying
|
||||||
|
// container is a string. This behavior is conforming to the standard
|
||||||
|
// [container.adaptors.format].
|
||||||
|
EXPECT_EQ(fmt::format("{}", s), "ab");
|
||||||
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
struct my_container_adaptor {
|
struct my_container_adaptor {
|
||||||
using value_type = int;
|
using value_type = int;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user