diff --git a/src/libraries/System.ComponentModel.Annotations/tests/System/ComponentModel/DataAnnotations/RegularExpressionAttributeTests.cs b/src/libraries/System.ComponentModel.Annotations/tests/System/ComponentModel/DataAnnotations/RegularExpressionAttributeTests.cs index 45a9da9712f262..99a9831a3e6f9e 100644 --- a/src/libraries/System.ComponentModel.Annotations/tests/System/ComponentModel/DataAnnotations/RegularExpressionAttributeTests.cs +++ b/src/libraries/System.ComponentModel.Annotations/tests/System/ComponentModel/DataAnnotations/RegularExpressionAttributeTests.cs @@ -78,7 +78,7 @@ public static void Validate_InvalidMatchTimeoutInMilliseconds_ThrowsArgumentOutO public static void Validate_MatchingTimesOut_ThrowsRegexMatchTimeoutException() { RegularExpressionAttribute attribute = new RegularExpressionAttribute("(a[ab]+)+$") { MatchTimeoutInMilliseconds = 1 }; - Assert.Throws(() => attribute.Validate("aaaaaaaaaaaaaaaaaaaaaaaaaaaa>", new ValidationContext(new object()))); + Assert.Throws(() => attribute.Validate(new string('a', 100) + ">", new ValidationContext(new object()))); } [Fact]