mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 15:17:46 +00:00
AK: Add CharacterTypes::is_ascii_base36_digit()
This can be used to validate the string passed to `parse_ascii_base36_digit()`.
This commit is contained in:
parent
bbdbd71439
commit
65827826fe
2 changed files with 17 additions and 0 deletions
|
@ -67,6 +67,17 @@ TEST_CASE(is_ascii_alphanumeric)
|
|||
compare_bool_output_over(ASCII, isalnum, is_ascii_alphanumeric);
|
||||
}
|
||||
|
||||
TEST_CASE(is_ascii_base36_digit)
|
||||
{
|
||||
constexpr Array valid_base36_digits { '0', '9', 'A', 'Z', 'a', 'z' };
|
||||
for (auto valid_base36_digit : valid_base36_digits)
|
||||
EXPECT_EQ(is_ascii_base36_digit(valid_base36_digit), true);
|
||||
|
||||
constexpr Array invalid_base36_digits { '/', ':', '@', '[', '`', '{' };
|
||||
for (auto invalid_base36_digit : invalid_base36_digits)
|
||||
EXPECT_EQ(is_ascii_base36_digit(invalid_base36_digit), false);
|
||||
}
|
||||
|
||||
TEST_CASE(is_ascii_blank)
|
||||
{
|
||||
compare_bool_output_over(ASCII, isblank, is_ascii_blank);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue