mirror of
https://github.com/RGBCube/serenity
synced 2025-05-30 22:38:12 +00:00
AK: Add String{,View}::is_whitespace()
+Tests!
This commit is contained in:
parent
b795f582cf
commit
f3ecea1fb3
5 changed files with 28 additions and 11 deletions
|
@ -287,4 +287,15 @@ TEST_CASE(contains)
|
|||
EXPECT(!AK::StringUtils::contains(test_string, "L", CaseSensitivity::CaseInsensitive));
|
||||
}
|
||||
|
||||
TEST_CASE(is_whitespace)
|
||||
{
|
||||
EXPECT(AK::StringUtils::is_whitespace(""));
|
||||
EXPECT(AK::StringUtils::is_whitespace(" "));
|
||||
EXPECT(AK::StringUtils::is_whitespace(" \t"));
|
||||
EXPECT(AK::StringUtils::is_whitespace(" \t\n"));
|
||||
EXPECT(AK::StringUtils::is_whitespace(" \t\n\r\v"));
|
||||
EXPECT(!AK::StringUtils::is_whitespace(" a "));
|
||||
EXPECT(!AK::StringUtils::is_whitespace("a\t"));
|
||||
}
|
||||
|
||||
TEST_MAIN(StringUtils)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue