Austin Schuh | 9d82300 | 2019-04-14 12:53:17 -0700 | [diff] [blame^] | 1 | |
| 2 | #include "internal/Embedded.h" |
| 3 | #include <catch2/catch.hpp> |
| 4 | |
| 5 | TEST_CASE("findEmbeddedContent returns nullptr if not found", "[EmbeddedContentTests]") { |
| 6 | const auto* content = findEmbeddedContent("/not-included"); |
| 7 | CHECK(content == nullptr); |
| 8 | } |
| 9 | |
| 10 | TEST_CASE("generated content not empty", "[EmbeddedContentTests]") { |
| 11 | const auto* content = findEmbeddedContent("/_404.png"); |
| 12 | CHECK(content != nullptr); |
| 13 | CHECK(content->length > 0); |
| 14 | } |
| 15 | |
| 16 | TEST_CASE("all files generated", "[EmbeddedContentTests]") { |
| 17 | CHECK(findEmbeddedContent("/_404.png") != nullptr); |
| 18 | CHECK(findEmbeddedContent("/_error.css") != nullptr); |
| 19 | CHECK(findEmbeddedContent("/_error.html") != nullptr); |
| 20 | CHECK(findEmbeddedContent("/favicon.ico") != nullptr); |
| 21 | CHECK(findEmbeddedContent("/_jquery.min.js") != nullptr); |
| 22 | CHECK(findEmbeddedContent("/_seasocks.css") != nullptr); |
| 23 | CHECK(findEmbeddedContent("/_stats.html") != nullptr); |
| 24 | } |