#include #include #include "html_util.h" static void test_html_escape_basic() { TEST_ASSERT_EQUAL_STRING("", html_escape("").c_str()); TEST_ASSERT_EQUAL_STRING("plain", html_escape("plain").c_str()); TEST_ASSERT_EQUAL_STRING("a&b", html_escape("a&b").c_str()); TEST_ASSERT_EQUAL_STRING("<tag>", html_escape("").c_str()); TEST_ASSERT_EQUAL_STRING(""hi"", html_escape("\"hi\"").c_str()); TEST_ASSERT_EQUAL_STRING("it's", html_escape("it's").c_str()); TEST_ASSERT_EQUAL_STRING("&<>"'", html_escape("&<>\"'").c_str()); } void setup() { UNITY_BEGIN(); RUN_TEST(test_html_escape_basic); UNITY_END(); } void loop() {}