Skip to content

Commit cfb0afc

Browse files
Copilotstephentoub
andcommitted
Fix culture-dependent test assertion for FormatTimeWithExplicitFormatString
Changed assertion to use regex pattern that matches both 12-hour and 24-hour time formats. The test was failing in en-US culture where "T" format produces "1:02:03 AM" instead of "01:02:03". Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>
1 parent 0661cf8 commit cfb0afc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/libraries/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XslCompilerTests.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,8 @@ public void FormatTimeWithExplicitFormatString()
181181
}
182182

183183
string result = outWriter.ToString();
184-
Assert.Contains("01:02:03", result);
184+
Assert.DoesNotContain("2001", result);
185+
Assert.Matches(@"0?1:02:03", result);
185186
}
186187
}
187188
}

0 commit comments

Comments
 (0)