ladybird/Tests/LibWeb/TestSourceHighlighter.cpp
Timothy Flynn 87cdeda93c LibSyntax+LibJS+LibWeb+LibWebView: Remove unused syntax highlighter code
A future patch will port LibSyntax away from UTF-32. The less code that
needs to be ported, the easier that will be.
2026-06-06 18:42:18 +02:00

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());
}