Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
lint
  • Loading branch information
lemire committed Dec 4, 2024
commit a373818a7bcfecb12080f96c65d6b16492b2ce94
15 changes: 7 additions & 8 deletions tests/wpt_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -278,20 +278,20 @@ TYPED_TEST(wpt_tests_typed, toascii_encoding) {
// tests.
// @see
// https://github.com/web-platform-tests/wpt/blob/master/url/toascii.window.js
if(output.has_value()) {
if (output.has_value()) {
std::string_view stringified_output = expected_output.get_string();
ASSERT_EQ(output.value(), stringified_output);

std::string url_string = "https://" + std::string(output.value()) + "/x";
auto current =
ada::parse<TypeParam>(url_string);
std::string url_string =
"https://" + std::string(output.value()) + "/x";
auto current = ada::parse<TypeParam>(url_string);

if (expected_output.type() == ondemand::json_type::string) {
std::string_view stringified_output = expected_output.get_string();
if(!current.has_value()) {
if (!current.has_value()) {
std::cerr << "The URL instance could not be created from '";
for(uint8_t c : url_string) {
if(c >= 32 && c <= 126) {
for (uint8_t c : url_string) {
if (c >= 32 && c <= 126) {
std::cerr << (char)c;
} else {
// non-printable characters
Expand Down Expand Up @@ -325,7 +325,6 @@ TYPED_TEST(wpt_tests_typed, toascii_encoding) {
ASSERT_EQ(setter->get_hostname(), "x");
}
}

}
}
} catch (simdjson::simdjson_error &error) {
Expand Down
Loading