Skip to content

Commit 8d9b537

Browse files
committed
build fix?
1 parent 17a46f7 commit 8d9b537

File tree

1 file changed

+14
-5
lines changed
  • src/libraries/System.Runtime/tests/System.Runtime.Tests/System/Type

1 file changed

+14
-5
lines changed

src/libraries/System.Runtime/tests/System.Runtime.Tests/System/Type/TypeTests.cs

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,19 @@ public void GetTypeByName_ValidType_ReturnsExpected(string typeName, Type expect
513513
Assert.Equal(expectedType, Type.GetType(typeName.ToLower(), throwOnError: false, ignoreCase: true));
514514
}
515515

516+
public static IEnumerable<object[]> GetTypeByName_Invalid_ClrArguments()
517+
{
518+
Type expectedException = PlatformDetection.IsMonoRuntime
519+
? typeof(ArgumentException) // https://github.com/dotnet/runtime/issues/45033
520+
: typeof(TypeLoadException);
521+
522+
yield return new object[] { "System.Int32&&", expectedException, true };
523+
yield return new object[] { "System.Int32&*", expectedException, true };
524+
yield return new object[] { "System.Int32&[]", expectedException, true };
525+
yield return new object[] { "System.Int32&[*]", expectedException, true };
526+
yield return new object[] { "System.Int32&[,]", expectedException, true };
527+
}
528+
516529
[Theory]
517530
[InlineData("system.nullable`1[system.int32]", typeof(TypeLoadException), false)]
518531
[InlineData("System.NonExistingType", typeof(TypeLoadException), false)]
@@ -522,11 +535,7 @@ public void GetTypeByName_ValidType_ReturnsExpected(string typeName, Type expect
522535
[InlineData("Outside`1[System.Boolean, System.Int32]", typeof(ArgumentException), true)]
523536
[InlineData(".System.Int32", typeof(TypeLoadException), false)]
524537
[InlineData("..Outside`1", typeof(TypeLoadException), false)]
525-
[InlineData("System.Int32&&", typeof(TypeLoadException), false)]
526-
[InlineData("System.Int32&*", typeof(TypeLoadException), false)]
527-
[InlineData("System.Int32&[]", typeof(TypeLoadException), false)]
528-
[InlineData("System.Int32&[*]", typeof(TypeLoadException), false)]
529-
[InlineData("System.Int32&[,]", typeof(TypeLoadException), false)]
538+
[MemberData(nameof(GetTypeByName_Invalid_ClrArguments))]
530539
public void GetTypeByName_Invalid(string typeName, Type expectedException, bool alwaysThrowsException)
531540
{
532541
if (!alwaysThrowsException)

0 commit comments

Comments
 (0)