diff --git a/src/tests.cpp b/src/tests.cpp index e0ad3f1..ac5d076 100644 --- a/src/tests.cpp +++ b/src/tests.cpp @@ -47,3 +47,44 @@ TEST_CASE("get_metadata function test with a file that doesn't have metadata") { std::optional result = get_metadata(FILE_NAME); REQUIRE(result == std::nullopt); } + +/* theres to much testing stuff in examples + * i need to move tests to some other directory with testing files + */ +TEST_CASE("get_html function parsing test") { + const std::string INPUT = "../examples/post.md"; + const std::string EXPECTED_OUTPUT = R"HTML(

This is an example post

+

In this example we will do a couple of cool markdown things.

+

This is a h2 header

+

This text is written in italic!

+

Look at this!

+

This text is BOLD!

+

Hello world!

+
#include <iostream>
+
+int main() {
+    std::cout << "Hello world!" << std::endl;
+}
+
+

This is super cool!

+

Time to link some random website!

+

This should be clickable

+

Image test

+

this should show an image

+

This is an ordered list

+
    +
  1. one
  2. +
  3. six
  4. +
  5. seven
  6. +
+

This is an unordered one

+ +)HTML"; + + REQUIRE(get_html(INPUT) == EXPECTED_OUTPUT); +}