From 83455577d099ab85c7a2d8a8d797767ef7c5632b Mon Sep 17 00:00:00 2001 From: Daniel Sipka Date: Mon, 27 Apr 2015 10:37:11 +0200 Subject: [PATCH] error unit tests --- test/data/error_eof_in_section.hpp | 3 +++ test/data/error_eof_in_section.mustache | 1 + test/data/error_eof_in_section.txt | 1 + test/data/error_eof_in_tag.hpp | 1 + test/data/error_eof_in_tag.mustache | 1 + test/data/error_eof_in_tag.txt | 1 + test/test_main.cpp | 2 ++ 7 files changed, 10 insertions(+) create mode 100644 test/data/error_eof_in_section.hpp create mode 100644 test/data/error_eof_in_section.mustache create mode 100644 test/data/error_eof_in_section.txt create mode 100644 test/data/error_eof_in_tag.hpp create mode 100644 test/data/error_eof_in_tag.mustache create mode 100644 test/data/error_eof_in_tag.txt diff --git a/test/data/error_eof_in_section.hpp b/test/data/error_eof_in_section.hpp new file mode 100644 index 0000000..2e54aab --- /dev/null +++ b/test/data/error_eof_in_section.hpp @@ -0,0 +1,3 @@ +const auto error_eof_in_section_data = mstch::map{ + {"hello", mstch::array{std::string{"a"}, std::string{"b"}}} +}; \ No newline at end of file diff --git a/test/data/error_eof_in_section.mustache b/test/data/error_eof_in_section.mustache new file mode 100644 index 0000000..1035f91 --- /dev/null +++ b/test/data/error_eof_in_section.mustache @@ -0,0 +1 @@ +yay{{#hello}}{{.}} \ No newline at end of file diff --git a/test/data/error_eof_in_section.txt b/test/data/error_eof_in_section.txt new file mode 100644 index 0000000..fc0e7cb --- /dev/null +++ b/test/data/error_eof_in_section.txt @@ -0,0 +1 @@ +yay \ No newline at end of file diff --git a/test/data/error_eof_in_tag.hpp b/test/data/error_eof_in_tag.hpp new file mode 100644 index 0000000..6f3fb1d --- /dev/null +++ b/test/data/error_eof_in_tag.hpp @@ -0,0 +1 @@ +const auto error_eof_in_tag_data = mstch::map{{"hello", std::string{"world"}}}; \ No newline at end of file diff --git a/test/data/error_eof_in_tag.mustache b/test/data/error_eof_in_tag.mustache new file mode 100644 index 0000000..ba4f670 --- /dev/null +++ b/test/data/error_eof_in_tag.mustache @@ -0,0 +1 @@ +{{hello{{hello}}{{hello \ No newline at end of file diff --git a/test/data/error_eof_in_tag.txt b/test/data/error_eof_in_tag.txt new file mode 100644 index 0000000..25e277c --- /dev/null +++ b/test/data/error_eof_in_tag.txt @@ -0,0 +1 @@ +{{hello \ No newline at end of file diff --git a/test/test_main.cpp b/test/test_main.cpp index e9b7a4e..dc0feb4 100644 --- a/test/test_main.cpp +++ b/test/test_main.cpp @@ -32,6 +32,8 @@ MSTCH_TEST(empty_list) MSTCH_TEST(empty_sections) MSTCH_TEST(empty_string) MSTCH_TEST(empty_template) +MSTCH_TEST(error_eof_in_section) +MSTCH_TEST(error_eof_in_tag) MSTCH_TEST(error_not_found) MSTCH_TEST(escaped) MSTCH_TEST(falsy)