Test "move".
This commit is contained in:
parent
e00409c517
commit
48be5c22a2
@ -1521,6 +1521,19 @@ TEST(FormatterTest, Sink) {
|
||||
EXPECT_EQ(1, num_writes);
|
||||
}
|
||||
|
||||
TEST(FormatterTest, Move) {
|
||||
// Test if formatting is performed once if we "move" a formatter.
|
||||
int num_writes = 0;
|
||||
{
|
||||
typedef fmt::Formatter<CountingSink> TestFormatter;
|
||||
TestFormatter *f = new TestFormatter("test", CountingSink(num_writes));
|
||||
TestFormatter f2(*f);
|
||||
delete f;
|
||||
EXPECT_EQ(0, num_writes);
|
||||
}
|
||||
EXPECT_EQ(1, num_writes);
|
||||
}
|
||||
|
||||
TEST(FormatterTest, OutputNotWrittenOnError) {
|
||||
int num_writes = 0;
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user