From 6232d13f5321b87ddf12a1aa36b4545da45f173d Mon Sep 17 00:00:00 2001 From: Joel Klinghed Date: Wed, 17 Nov 2021 22:34:57 +0100 Subject: Travel3: Simple image and video display site Reads the images and videos from filesystem and builds a site in memroy. --- test/test_jsutil.cc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 test/test_jsutil.cc (limited to 'test/test_jsutil.cc') diff --git a/test/test_jsutil.cc b/test/test_jsutil.cc new file mode 100644 index 0000000..8bf3140 --- /dev/null +++ b/test/test_jsutil.cc @@ -0,0 +1,15 @@ +#include "common.hh" + +#include "jsutil.hh" + +#include + +TEST(jsutil, quote) { + EXPECT_EQ("\"\"", js::quote("")); + EXPECT_EQ("''", js::quote("", js::QuoteChar::SINGLE)); + EXPECT_EQ("\"foo\"", js::quote("foo")); + EXPECT_EQ("\"\\\"foo\\\"\"", js::quote("\"foo\"")); + EXPECT_EQ("\"\\\\\\\"foo\\\\\\\"\"", js::quote("\\\"foo\\\"")); + EXPECT_EQ("\"\\0\\n\\r\\v\\t\\b\\f\"", js::quote( + std::string_view("\0\n\r\v\t\b\f", 7))); +} -- cgit v1.2.3-70-g09d2