mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 12:28:12 +00:00
AK: Allow trailing '*'s in a glob pattern to match nothing
Fixes part of #4607.
This commit is contained in:
parent
2ad5bfd78e
commit
cbe0a8b403
2 changed files with 16 additions and 0 deletions
|
@ -86,6 +86,14 @@ TEST_CASE(matches_with_positions)
|
|||
EXPECT_EQ(spans, Vector<AK::MaskSpan>({ { 1, 3 } }));
|
||||
}
|
||||
|
||||
// #4607
|
||||
TEST_CASE(matches_trailing)
|
||||
{
|
||||
EXPECT(AK::StringUtils::matches("ab", "ab*"));
|
||||
EXPECT(AK::StringUtils::matches("ab", "ab****"));
|
||||
EXPECT(AK::StringUtils::matches("ab", "*ab****"));
|
||||
}
|
||||
|
||||
TEST_CASE(convert_to_int)
|
||||
{
|
||||
auto value = AK::StringUtils::convert_to_int(StringView());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue