Skip to content

Commit 3dad432

Browse files
committed
add test cases for record types
1 parent 8f72762 commit 3dad432

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

tests/Smdn.Reflection.ReverseGenerating/Smdn.Reflection.ReverseGenerating/Generator.TypeDeclaration.cs

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,38 @@ public class CCloseNested<U> { }
447447
}
448448
}
449449
}
450+
451+
namespace Records {
452+
namespace RecordClasses {
453+
[SkipTestCase("`record` types are not supported currently")]
454+
[TypeDeclarationTestCase("public record RExpected(int X, string Y);")]
455+
public record RExpected(int X, string Y);
456+
457+
[TypeDeclarationTestCase("public class R0")]
458+
public record R0(int X, string Y);
459+
460+
[TypeDeclarationTestCase("public class R1")]
461+
public record class R1(int X, string Y);
462+
}
463+
464+
namespace RecordStructs {
465+
[SkipTestCase("`record` types are not supported currently")]
466+
[TypeDeclarationTestCase("public record struct RSExpected(int X, string Y);")]
467+
public record struct RSExpected(int X, string Y);
468+
469+
[TypeDeclarationTestCase("public struct RS0")]
470+
public record struct RS0(int X, string Y);
471+
472+
namespace ReadOnlyRecordStructs {
473+
[SkipTestCase("`record` types are not supported currently")]
474+
[TypeDeclarationTestCase("public readonly record struct RRSExpected(int X, string Y);")]
475+
public readonly record struct RRSExpected(int X, string Y);
476+
477+
[TypeDeclarationTestCase("public readonly struct RRS0")]
478+
public readonly record struct RRS0(int X, string Y);
479+
}
480+
}
481+
}
450482
}
451483
}
452484

0 commit comments

Comments
 (0)