hemplate

Simple XML template engine
git clone git://git.dimitrijedobrota.com/hemplate.git
Log | Files | Refs | README | LICENSE | HACKING | CONTRIBUTING | CODE_OF_CONDUCT | BUILDING

rss_test.cpp (837B)


0 #include "hemplate/rss.hpp" 1 2 #include <catch2/catch_test_macros.hpp> 3 4 using namespace hemplate; // NOLINT 5 6 TEST_CASE("rss", "[rss/rss]") 7 { 8 SECTION("default") 9 { 10 const rss::rss rss; 11 12 REQUIRE(std::string(rss) == "<rss version=\"2.0\" xmlns=\"http://www.w3.org/2005/Atom\">\n</rss>\n"); 13 } 14 15 SECTION("random") 16 { 17 const rss::rss rss {{{"hello", "world"}}}; 18 19 REQUIRE(std::string(rss) == "<rss hello=\"world\">\n</rss>\n"); 20 } 21 } 22 23 TEST_CASE("atomLink", "[rss/atomLink]") 24 { 25 SECTION("href") 26 { 27 const rss::atomLink link {"hi"}; 28 29 REQUIRE( 30 std::string(link) 31 == "<atom:link rel=\"self\" type=\"application/rss+xml\" href=\"hi\" />\n" 32 ); 33 } 34 35 SECTION("random") 36 { 37 const rss::atomLink link {{{"hello", "world"}}}; 38 39 REQUIRE(std::string(link) == "<atom:link hello=\"world\" />\n"); 40 } 41 }