A future patch will port LibSyntax away from UTF-32. The less code that needs to be ported, the easier that will be.
18 lines
565 B
C++
18 lines
565 B
C++
/*
|
|
* Copyright (c) 2026-present, the Ladybird developers.
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#include <LibTest/TestCase.h>
|
|
#include <LibURL/URL.h>
|
|
#include <LibWebView/SourceHighlighter.h>
|
|
|
|
TEST_CASE(highlight_script_with_braces)
|
|
{
|
|
// Regression test for https://github.com/LadybirdBrowser/ladybird/issues/8529
|
|
auto source = "<script>\nfunction foo() {\n return 1;\n}\n</script>"_string;
|
|
URL::URL base_url {};
|
|
auto result = WebView::highlight_source({}, base_url, source, Syntax::Language::HTML);
|
|
EXPECT(!result.is_empty());
|
|
}
|