Add a test for C++ comments in code passed to RunScript()

This used to be broken, check that it does work now.
This commit is contained in:
Vadim Zeitlin 2020-02-05 15:45:26 +01:00
parent a26e81ccb1
commit f21c7f2d49

View File

@ -338,6 +338,13 @@ TEST_CASE_METHOD(WebViewTestCase, "WebView", "[wxWebView]")
&result));
CHECK(result == "\"2016-10-08T21:30:40.000Z\"");
// Check for C++-style comments which used to be broken.
CHECK(m_browser->RunScript("function f() {\n"
" // A C++ style comment\n"
" return 17;\n"
"}f();", &result));
CHECK(result == "17");
// Check for errors too.
CHECK(!m_browser->RunScript("syntax(error"));
CHECK(!m_browser->RunScript("syntax(error", &result));