Skip to content

Commit 519e190

Browse files
committed
Fix unit test
#977
1 parent 3d74b46 commit 519e190

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

unittests/usfm-html.cpp

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1622,12 +1622,19 @@ TEST_F (usfm_html, get_word_level_attributes_id)
16221622
editor_usfm2html.load (usfm);
16231623
editor_usfm2html.stylesheet (styles_logic_standard_sheet ());
16241624
editor_usfm2html.run ();
1625-
// Todo fix this.
1626-
// const std::map<int,std::string> attributes = editor_usfm2html.get_word_level_attributes();
1627-
// for (const auto& [id, text] : attributes) {
1628-
// EXPECT_TRUE(std::to_string(id).find("0") == std::string::npos);
1629-
// }
1630-
// EXPECT_EQ(id_count, attributes.size());
1625+
std::string html = editor_usfm2html.get();
1626+
int count {};
1627+
do {
1628+
constexpr const std::string_view b_wla{"b-wla"};
1629+
const size_t pos = html.find(b_wla);
1630+
if (pos == std::string::npos)
1631+
break;
1632+
html.erase(0, pos + b_wla.size());
1633+
count++;
1634+
EXPECT_TRUE(html.substr(0, 10).find("0") == std::string::npos);
1635+
}
1636+
while (true);
1637+
EXPECT_EQ(count, id_count);
16311638
}
16321639

16331640

0 commit comments

Comments
 (0)