Skip to content

Commit 8612170

Browse files
committed
fix resultiterator_test for extra \n
resultiterator_test.cc
1 parent ec8f02c commit 8612170

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

unittest/resultiterator_test.cc

+4-2
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ class ResultIteratorTest : public testing::Test {
122122
// EXPECTs that the rebuild string exactly matches the truth string.
123123
void VerifyIteratorText(const std::string& truth, PageIteratorLevel level,
124124
ResultIterator* it) {
125-
LOG(INFO) << "Text Test Level " << level;
125+
LOG(INFO) << "Text Test Level " << level << "\n";
126126
it->Begin();
127127
std::string result;
128128
do {
@@ -136,7 +136,9 @@ class ResultIteratorTest : public testing::Test {
136136
} else {
137137
result += ' ';
138138
}
139-
if (it->IsAtFinalElement(tesseract::RIL_PARA, level)) result += '\n';
139+
if (it->IsAtFinalElement(tesseract::RIL_PARA, level) &&
140+
!(it->IsAtFinalElement(tesseract::RIL_BLOCK, level)))
141+
result += '\n';
140142
}
141143
} while (it->Next(level));
142144
EXPECT_STREQ(truth.c_str(), result.c_str())

0 commit comments

Comments
 (0)