diff --git a/tests/maddy/test_maddy_strongparser.cpp b/tests/maddy/test_maddy_strongparser.cpp index ad70762..e054aa7 100644 --- a/tests/maddy/test_maddy_strongparser.cpp +++ b/tests/maddy/test_maddy_strongparser.cpp @@ -12,33 +12,87 @@ TEST(MADDY_STRONGPARSER, ItReplacesMarkdownWithStrongHTML) { - std::string text = "some text **bla** text testing **it** out"; - std::string expected = "some text bla text testing it out"; + struct testIt + { + std::string text; + std::string expected; + }; + + std::vector tests + { + { + "some text **bla** text testing **it** out", + "some text bla text testing it out" + }, + { + "some text __bla__ text testing __it__ out", + "some text bla text testing it out" + }, + }; + auto strongParser = std::make_shared(); - strongParser->Parse(text); - - ASSERT_EQ(expected, text); + for (auto& test : tests) + { + strongParser->Parse(test.text); + ASSERT_EQ(test.expected, test.text); + } } TEST(MADDY_STRONGPARSER, ItReplacesEmphasizedMarkdownNotWithStrongHTML) { - std::string text = "some text *bla* text testing **it** out"; - std::string expected = "some text *bla* text testing it out"; + struct testIt + { + std::string text; + std::string expected; + }; + + std::vector tests + { + { + "some text *bla* text testing **it** out", + "some text *bla* text testing it out" + }, + { + "some text _bla_ text testing __it__ out", + "some text _bla_ text testing it out" + }, + }; + auto strongParser = std::make_shared(); - strongParser->Parse(text); - - ASSERT_EQ(expected, text); + for (auto& test : tests) + { + strongParser->Parse(test.text); + ASSERT_EQ(test.expected, test.text); + } } TEST(MADDY_STRONGPARSER, ItDoesNotParseInsideInlineCode) { - std::string text = "some text **bla** `/**text**/` testing `**it**` out"; - std::string expected = "some text **bla** `/**text**/` testing `**it**` out"; + struct testIt + { + std::string text; + std::string expected; + }; + + std::vector tests + { + { + "some text **bla** `/**text**/` testing `**it**` out", + "some text **bla** `/**text**/` testing `**it**` out", + }, + { + "some text _bla_ text testing __it__ out", + "some text _bla_ text testing it out" + }, + }; + auto strongParser = std::make_shared(); - strongParser->Parse(text); - - ASSERT_EQ(expected, text); + for (auto& test : tests) + { + strongParser->Parse(test.text); + ASSERT_EQ(test.expected, test.text); + } }