PrintTo functions for google test and valgrind

This commit is contained in:
Matthew Barr
2016-03-08 14:53:03 +11:00
parent 4a482b07ea
commit e10d2eb269
3 changed files with 22 additions and 0 deletions

View File

@@ -84,3 +84,14 @@ TEST_P(NFAWidthTest, Check) {
ASSERT_EQ(t.minWidth, findMinWidth(*w));
ASSERT_EQ(t.maxWidth, findMaxWidth(*w));
}
// for google test
void PrintTo(const WidthTest &w, ::std::ostream *os) {
*os << "WidthTest: " << w.pattern << "{" << w.minWidth << ',';
if (w.maxWidth == depth::infinity()) {
*os << "inf";
} else {
*os << w.maxWidth;
}
*os << '}';
}