File tree 2 files changed +23
-1
lines changed
System.Private.CoreLib/src/System
System.Runtime/tests/System
2 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -33,8 +33,8 @@ private static bool IsUtcAlias (string id)
33
33
case 69 : // e
34
34
case 101 : // E
35
35
return string . Equals ( id , "Etc/UTC" , StringComparison . OrdinalIgnoreCase ) ||
36
+ string . Equals ( id , "Etc/UCT" , StringComparison . OrdinalIgnoreCase ) ||
36
37
string . Equals ( id , "Etc/Universal" , StringComparison . OrdinalIgnoreCase ) ||
37
- string . Equals ( id , "Etc/UTC" , StringComparison . OrdinalIgnoreCase ) ||
38
38
string . Equals ( id , "Etc/Zulu" , StringComparison . OrdinalIgnoreCase ) ;
39
39
case 85 : // u
40
40
case 117 : // U
Original file line number Diff line number Diff line change @@ -2334,6 +2334,14 @@ public static IEnumerable<object[]> SystemTimeZonesTestData()
2334
2334
yield return new object [ ] { tz } ;
2335
2335
}
2336
2336
}
2337
+
2338
+ if ( ! PlatformDetection . IsBrowser )
2339
+ {
2340
+ foreach ( string alias in s_UtcAliases )
2341
+ {
2342
+ yield return new object [ ] { TimeZoneInfo . FindSystemTimeZoneById ( alias ) } ;
2343
+ }
2344
+ }
2337
2345
}
2338
2346
}
2339
2347
@@ -2424,6 +2432,20 @@ public static void TimeZoneDisplayNames_Unix(TimeZoneInfo timeZone)
2424
2432
}
2425
2433
}
2426
2434
2435
+ [ Fact ]
2436
+ [ PlatformSpecific ( ~ TestPlatforms . Windows & ~ TestPlatforms . Browser ) ]
2437
+ public static void UtcAliases_MapToUtc ( )
2438
+ {
2439
+ TimeZoneInfo . AdjustmentRule [ ] expectedAdjustmentRules = TimeZoneInfo . Utc . GetAdjustmentRules ( ) ;
2440
+
2441
+ foreach ( var alias in s_UtcAliases )
2442
+ {
2443
+ TimeZoneInfo actualUtc = TimeZoneInfo . FindSystemTimeZoneById ( alias ) ;
2444
+ Assert . Equal ( TimeZoneInfo . Utc . BaseUtcOffset , actualUtc . BaseUtcOffset ) ;
2445
+ Assert . Equal ( expectedAdjustmentRules , actualUtc . GetAdjustmentRules ( ) ) ;
2446
+ }
2447
+ }
2448
+
2427
2449
[ ActiveIssue ( "https://github.com/dotnet/runtime/issues/19794" , TestPlatforms . AnyUnix ) ]
2428
2450
[ Theory ]
2429
2451
[ MemberData ( nameof ( SystemTimeZonesTestData ) ) ]
You can’t perform that action at this time.
0 commit comments