1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 12:17:45 +00:00

LibTimeZone: Perform time-zone-from-string lookups case insensitively

Time zone names in the TZDB are defined to be case insensitive.
This commit is contained in:
Timothy Flynn 2022-01-10 12:23:22 -05:00 committed by Linus Groh
parent b493c2ca90
commit 14535fb67a
2 changed files with 19 additions and 5 deletions

View file

@ -46,4 +46,11 @@ TEST_CASE(time_zone_from_string_link)
test_link("Universal"sv, "UTC"sv);
}
TEST_CASE(case_insensitive_time_zone_from_string)
{
EXPECT_EQ(TimeZone::time_zone_from_string("UTC"sv), TimeZone::TimeZone::UTC);
EXPECT_EQ(TimeZone::time_zone_from_string("utc"sv), TimeZone::TimeZone::UTC);
EXPECT_EQ(TimeZone::time_zone_from_string("uTc"sv), TimeZone::TimeZone::UTC);
}
#endif