2023-09-15 13:00:49 +01:00
|
|
|
#include <catch2/catch_test_macros.hpp>
|
2023-09-20 09:09:51 +01:00
|
|
|
#include "../Src/BlogParser.h"
|
2023-09-15 13:00:49 +01:00
|
|
|
|
2023-09-20 09:09:51 +01:00
|
|
|
TEST_CASE("Parser returns basic text")
|
2023-09-15 13:00:49 +01:00
|
|
|
{
|
|
|
|
BlogParser* parser = new BlogParser();
|
2023-09-20 09:09:51 +01:00
|
|
|
REQUIRE(parser->parse("hello") == "<p>hello</p>\n");
|
2023-09-15 13:00:49 +01:00
|
|
|
}
|
|
|
|
|
2023-09-20 09:09:51 +01:00
|
|
|
TEST_CASE("Parser returns valid HTML for headers")
|
2023-09-15 13:00:49 +01:00
|
|
|
{
|
|
|
|
BlogParser* parser = new BlogParser();
|
2023-09-20 09:09:51 +01:00
|
|
|
REQUIRE(parser->parse("# header\nno header") == "<h1>header</h1>\n<p>no header</p>\n");
|
2023-09-15 13:00:49 +01:00
|
|
|
}
|
2023-09-20 09:09:51 +01:00
|
|
|
|