File tree Expand file tree Collapse file tree 1 file changed +37
-0
lines changed
tests/ClangSharp.PInvokeGenerator.UnitTests Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change @@ -54,4 +54,41 @@ public partial struct StructD
54
54
55
55
return ValidateGeneratedCSharpLatestWindowsBindingsAsync ( inputContents , expectedOutputContents , withUsings : withUsings ) ;
56
56
}
57
+
58
+ [ Test ]
59
+ public Task WithAttributes ( )
60
+ {
61
+ var inputContents = @"struct StructA {}; struct StructB {}; struct StructC {}; struct StructD {};" ;
62
+ var expectedOutputContents =
63
+ @"namespace ClangSharp.Test
64
+ {
65
+ [A]
66
+ public partial struct StructA
67
+ {
68
+ }
69
+
70
+ [B]
71
+ public partial struct StructB
72
+ {
73
+ }
74
+
75
+ [Star]
76
+ public partial struct StructC
77
+ {
78
+ }
79
+
80
+ [Star]
81
+ public partial struct StructD
82
+ {
83
+ }
84
+ }
85
+ " ;
86
+ var withAttributes = new Dictionary < string , IReadOnlyList < string > > {
87
+ [ "StructA" ] = [ @"A" ] ,
88
+ [ "StructB" ] = [ @"B" ] ,
89
+ [ "*" ] = [ @"Star" ] ,
90
+ } ;
91
+
92
+ return ValidateGeneratedCSharpLatestWindowsBindingsAsync ( inputContents , expectedOutputContents , withAttributes : withAttributes ) ;
93
+ }
57
94
}
You can’t perform that action at this time.
0 commit comments