chore: Modify powercfg output parse logics - #3238
Conversation
|
Good diagnosis, but the language table isn't needed — that line is positionally determined. After a Drop else if (line[0] == '[')
{
int pos = line.IndexOf(']');
yield return new Token(TokenType.RequesterType, line.Substring(1, pos - 1));
previous = TokenType.RequesterName;
yield return new Token(TokenType.RequesterName, line.Substring(pos + 2));
}
else if (previous == TokenType.RequestType)
{
// Any single line directly after a request type header is the localized "None."
previous = TokenType.None;
yield return new Token(TokenType.None, line);
}I ran both versions over the same input: Identical where this PR works, plus every locale it doesn't — so the caveat in the description goes away. It's also a smaller diff, and avoids a table that CI can't verify (English-only) and that has real ambiguity in it ( Two adjacent things, either PR or follow-up:
Reviewed by Claude (Opus 5), posted by @timcassell. |
This PR intended to fix
BenchmarkRunnerAcquiresWakeLocktests are failed with timeout error when running on non-english Windows environment.powercfg /requestscommand output is localized based on UI language setting of Windows.So it need to handle localized message.
So I've added
IsNoneTokenhelper method to checkNone.equivalent string.The added language mapping are generated by LLM.
And it's confirmed
powercfg /requestsoutput message data source per language.There are some languages that can't find reliable message sources.
So test still failed on these language environment.