[test] Account for C.UTF-8 in locale test.

Change-Id: I9fda623aca715ac4209335676b30e4191e791c4b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350658
Reviewed-by: Brian Quinlan <bquinlan@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
This commit is contained in:
Ryan Macnak 2024-02-07 21:30:29 +00:00 committed by Commit Queue
parent 7a9ea2f696
commit b7e2327fe3

View file

@ -8,12 +8,12 @@ import "package:expect/expect.dart";
main() {
// Match patterns like:
// "en" (MacOS)
// "en-US" (Android, iOS, Windows)
// "en_US", "en_US.UTF-8" (Linux)
// "ESP-USA" (theoretically possible)
// "en" (MacOS)
// "en-US" (Android, iOS, Windows)
// "en_US", "en_US.UTF-8", "C.UTF-8" (Linux)
// "ESP-USA" (theoretically possible)
// Assumes that the platform has a reasonably configured locale.
var localePattern = RegExp(r"[A-Za-z]{2,4}([_-][A-Za-z]{2})?");
var localePattern = RegExp(r"([A-Za-z]{2,4}([_-][A-Za-z]{2})?)|(C\.)");
var localeName = Platform.localeName;
Expect.isNotNull(
localePattern.matchAsPrefix(localeName),