diff --git a/CMakeLists.txt b/CMakeLists.txt index 0516ca4..cd72f2f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.1...3.29) project(docpp VERSION 0.0.1 - DESCRIPTION "Simple C++ library for generating XML, HTML and CSS." + DESCRIPTION "C++ library for generating XML, HTML and CSS." HOMEPAGE_URL "https://speedie.site/docpp" LANGUAGES CXX ) diff --git a/tests/test.cpp b/tests/test.cpp index 2e96dd4..80a7cdb 100644 --- a/tests/test.cpp +++ b/tests/test.cpp @@ -40,8 +40,8 @@ SCENARIO("Test HTML", "[HTML]") { const std::string expected_html{"
Test Paragraph
Test Paragraph With ID
Test Paragraph In Div
Test Paragraph With ID And Class
"}; - REQUIRE(doc.get() == expected_html); - REQUIRE(doc.get(docpp::HTML::FORMATTING_NEWLINE) == "\n\n\nTest Paragraph
\nTest Paragraph With ID
\nTest Paragraph In Div
\nTest Paragraph With ID And Class
\n\n\n"); + REQUIRE(doc.getTest Paragraph
\nTest Paragraph With ID
\nTest Paragraph In Div
\nTest Paragraph With ID And Class
\n\n\n"); }; const auto test2 = []() { @@ -53,8 +53,8 @@ SCENARIO("Test HTML", "[HTML]") { section.erase(docpp::HTML::Element("p", {}, "Test 2")); - REQUIRE(section.get() == "Test 1
Test 3
"); - REQUIRE(section.get(docpp::HTML::FORMATTING_NEWLINE) == "\nTest 1
\nTest 3
\n"); + REQUIRE(section.getTest 1
Test 3
"); + REQUIRE(section.getTest 1
\nTest 3
\n"); }; const auto test3 = []() { @@ -67,8 +67,8 @@ SCENARIO("Test HTML", "[HTML]") { std::size_t pos = section.find(docpp::HTML::Element("p", {}, "Test 2")); section.insert(pos, docpp::HTML::Element("p", {}, "Test 2.5")); - REQUIRE(section.get() == "Test 1
Test 2.5
Test 3
"); - REQUIRE(section.get(docpp::HTML::FORMATTING_NEWLINE) == "\nTest 1
\nTest 2.5
\nTest 3
\n"); + REQUIRE(section.getTest 1
Test 2.5
Test 3
"); + REQUIRE(section.getTest 1
\nTest 2.5
\nTest 3
\n"); }; const auto test4 = []() { @@ -82,8 +82,8 @@ SCENARIO("Test HTML", "[HTML]") { section.erase(pos); - REQUIRE(section.get() == "Test 1
Test 3
"); - REQUIRE(section.get(docpp::HTML::FORMATTING_NEWLINE) == "\nTest 1
\nTest 3
\n"); + REQUIRE(section.getTest 1
Test 3
"); + REQUIRE(section.getTest 1
\nTest 3
\n"); }; const auto test5 = []() { @@ -102,8 +102,8 @@ SCENARIO("Test HTML", "[HTML]") { docpp::HTML::Document doc{}; doc.set(section); - REQUIRE(doc.get() == "Test 1
Test 2
Test 1
\nTest 2
\nTest 1
Test 2
Test 1
\nTest 2
\nTest 1
Test 3
Test 2
"); + REQUIRE(section.getTest 1
Test 3
Test 2
"); }; const auto test11 = []() { @@ -181,7 +181,7 @@ SCENARIO("Test HTML", "[HTML]") { section.swap(docpp::HTML::Element("p", {}, "Test 2"), docpp::HTML::Element("p", {}, "Test 3")); - REQUIRE(section.get() == "Test 1
Test 3
Test 2
"); + REQUIRE(section.getTest 1
Test 3
Test 2
"); }; const auto test12 = []() { @@ -193,7 +193,7 @@ SCENARIO("Test HTML", "[HTML]") { section.push_front(docpp::HTML::Element("p", {}, "Test 0")); - REQUIRE(section.get() == "Test 0
Test 1
Test 2
Test 3
"); + REQUIRE(section.getTest 0
Test 1
Test 2
Test 3
"); }; const auto test13 = []() { @@ -215,7 +215,7 @@ SCENARIO("Test HTML", "[HTML]") { section.erase(pos); section.erase(pos2); - REQUIRE(section.get() == "Test 1
Test 3
Test 4
Test 5
"); + REQUIRE(section.getTest 1
Test 3
Test 4
Test 5
"); }; const auto test14 = []() { @@ -231,11 +231,11 @@ SCENARIO("Test HTML", "[HTML]") { element.erase(red); - REQUIRE(element.get() == "p {font-size: 16px;font-family: Arial;}"); + REQUIRE(element.getTest 4
Test 5
Test 6
Test 7
"); + REQUIRE(doc.getTest 4
Test 5
Test 6
Test 7
"); }; const auto test17 = []() { @@ -293,7 +293,7 @@ SCENARIO("Test HTML", "[HTML]") { docpp::HTML::Document doc{section}; - REQUIRE(doc.get(docpp::HTML::FORMATTING_PRETTY) == "\n\n\tTest 1
\n\tTest 2
\n\tTest 3
\n"); + REQUIRE(doc.getTest 1
\n\tTest 2
\n\tTest 3
\n"); }; const auto test18 = []() { @@ -303,7 +303,7 @@ SCENARIO("Test HTML", "[HTML]") { section.push_back(docpp::HTML::Element("p", {}, "Test 2")); section.push_back(docpp::HTML::Element("p", {}, "Test 3")); - REQUIRE(section.get() == "Test 1
Test 2
Test 3
"); + REQUIRE(section.getTest 1
Test 2
Test 3
"); }; const auto test19 = []() { @@ -313,8 +313,8 @@ SCENARIO("Test HTML", "[HTML]") { section.push_back(docpp::HTML::Element("p", {}, "Test 2")); section.push_back(docpp::HTML::Element("p", {}, "Test 3")); - REQUIRE(section.front().get() == "Test 1
"); - REQUIRE(section.back().get() == "Test 3
"); + REQUIRE(section.front().getTest 1
"); + REQUIRE(section.back().getTest 3
"); }; const auto test20 = []() { @@ -325,14 +325,14 @@ SCENARIO("Test HTML", "[HTML]") { prop.push_back(docpp::HTML::Property(std::pairTest 1
"); + REQUIRE(elem.getTest 1
"); break; } for (docpp::HTML::Section::iterator it = ++sect.begin(); it != sect.end(); ++it) { docpp::HTML::Element elem = *it; - REQUIRE(elem.get() == "Test 2
"); + REQUIRE(elem.getTest 2
"); break; } };