mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-05 09:06:08 +00:00
Tests: Reduce runtime of TestCharacterTypes
This declares all test cases which compare function outputs over the entire Unicode range as `BENCHMARK_CASE`, to avoid them being run by CI. This reduces runtime of TestCharacterTypes (without benchmarks) by about one third.
This commit is contained in:
parent
ac650d2362
commit
b3c3b78b01
Notes:
sideshowbarker
2024-07-18 11:36:17 +09:00
Author: https://github.com/MaxWipfli
Commit: b3c3b78b01
Pull-request: https://github.com/SerenityOS/serenity/pull/8229
1 changed files with 18 additions and 6 deletions
|
@ -34,10 +34,7 @@ void compare_value_output_over(u32 range, auto& old_function, auto& new_function
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE(is_ascii)
|
// NOTE: Avoid comparing over UNICODE in "TEST_CASE" due to test runtime becoming too long.
|
||||||
{
|
|
||||||
compare_bool_output_over(UNICODE, isascii, is_ascii);
|
|
||||||
}
|
|
||||||
|
|
||||||
TEST_CASE(is_ascii_alphanumeric)
|
TEST_CASE(is_ascii_alphanumeric)
|
||||||
{
|
{
|
||||||
|
@ -101,12 +98,12 @@ TEST_CASE(is_ascii_upper_alpha)
|
||||||
|
|
||||||
TEST_CASE(to_ascii_lowercase)
|
TEST_CASE(to_ascii_lowercase)
|
||||||
{
|
{
|
||||||
compare_value_output_over(UNICODE, tolower, to_ascii_lowercase);
|
compare_value_output_over(ASCII, tolower, to_ascii_lowercase);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE(to_ascii_uppercase)
|
TEST_CASE(to_ascii_uppercase)
|
||||||
{
|
{
|
||||||
compare_value_output_over(UNICODE, toupper, to_ascii_uppercase);
|
compare_value_output_over(ASCII, toupper, to_ascii_uppercase);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE(parse_ascii_digit)
|
TEST_CASE(parse_ascii_digit)
|
||||||
|
@ -133,3 +130,18 @@ TEST_CASE(parse_ascii_hex_digit)
|
||||||
return Test::Crash::Failure::DidNotCrash;
|
return Test::Crash::Failure::DidNotCrash;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BENCHMARK_CASE(is_ascii)
|
||||||
|
{
|
||||||
|
compare_bool_output_over(UNICODE, isascii, is_ascii);
|
||||||
|
}
|
||||||
|
|
||||||
|
BENCHMARK_CASE(to_ascii_lowercase_unicode)
|
||||||
|
{
|
||||||
|
compare_value_output_over(UNICODE, tolower, to_ascii_lowercase);
|
||||||
|
}
|
||||||
|
|
||||||
|
BENCHMARK_CASE(to_ascii_uppercase_unicode)
|
||||||
|
{
|
||||||
|
compare_value_output_over(UNICODE, toupper, to_ascii_uppercase);
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue