Skip to content

Commit 1d88ca2

Browse files
committed
C#: Add more InlineArray test cases.
1 parent 70e7c92 commit 1d88ca2

File tree

3 files changed

+45
-0
lines changed

3 files changed

+45
-0
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
| types.cs:60:19:60:31 | MyInlineArray | Int32 | 1 | 10 |
22
| types.cs:66:19:66:47 | MyMultiDimensionalInlineArray | MyInlineArray | 2 | 5 |
3+
| types.cs:72:19:72:48 | MyMultiDimensionalInlineArray2 | String[] | 2 | 7 |
4+
| types.cs:78:19:78:48 | MyMultiDimensionalInlineArray3 | Object[,] | 2 | 4 |
5+
| types.cs:84:19:84:48 | MyMultiDimensionalInlineArray4 | Object[][] | 3 | 11 |

csharp/ql/test/library-tests/types/PrintAst.expected

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,3 +121,27 @@ types.cs:
121121
# 65| 0: [IntLiteral] 5
122122
# 68| 5: [Field] myMultiDimentionalInlineArrayElements
123123
# 68| -1: [TypeMention] MyInlineArray
124+
# 72| 12: [InlineArrayType] MyMultiDimensionalInlineArray2
125+
#-----| 0: (Attributes)
126+
# 71| 1: [DefaultAttribute] [InlineArray(...)]
127+
# 71| -1: [TypeMention] InlineArrayAttribute
128+
# 71| 0: [IntLiteral] 7
129+
# 74| 5: [Field] myMultiDimentionalInlineArrayElements
130+
# 74| -1: [TypeMention] String[]
131+
# 74| 1: [TypeMention] string
132+
# 78| 13: [InlineArrayType] MyMultiDimensionalInlineArray3
133+
#-----| 0: (Attributes)
134+
# 77| 1: [DefaultAttribute] [InlineArray(...)]
135+
# 77| -1: [TypeMention] InlineArrayAttribute
136+
# 77| 0: [IntLiteral] 4
137+
# 80| 5: [Field] myMultiDimentionalInlineArrayElements
138+
# 80| -1: [TypeMention] Object[,]
139+
# 80| 1: [TypeMention] object
140+
# 84| 14: [InlineArrayType] MyMultiDimensionalInlineArray4
141+
#-----| 0: (Attributes)
142+
# 83| 1: [DefaultAttribute] [InlineArray(...)]
143+
# 83| -1: [TypeMention] InlineArrayAttribute
144+
# 83| 0: [IntLiteral] 11
145+
# 86| 5: [Field] myMultiDimentionalInlineArrayElements
146+
# 86| -1: [TypeMention] Object[][]
147+
# 86| 1: [TypeMention] object

csharp/ql/test/library-tests/types/types.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,22 @@ public struct MyMultiDimensionalInlineArray
6767
{
6868
private MyInlineArray myMultiDimentionalInlineArrayElements;
6969
}
70+
71+
[System.Runtime.CompilerServices.InlineArray(7)]
72+
public struct MyMultiDimensionalInlineArray2
73+
{
74+
private string[] myMultiDimentionalInlineArrayElements;
75+
}
76+
77+
[System.Runtime.CompilerServices.InlineArray(4)]
78+
public struct MyMultiDimensionalInlineArray3
79+
{
80+
private object[,] myMultiDimentionalInlineArrayElements;
81+
}
82+
83+
[System.Runtime.CompilerServices.InlineArray(11)]
84+
public struct MyMultiDimensionalInlineArray4
85+
{
86+
private object[][] myMultiDimentionalInlineArrayElements;
87+
}
7088
}

0 commit comments

Comments
 (0)