@@ -33,6 +33,15 @@ unsafe void TestMethod()
3333 *x += 1;
3434 int*[] y;
3535 y = new int*[5];
36+
37+ // The following cases are all regression tests for DotNetAnalyzers/StyleCopAnalyzers#1457
38+ x = (int*)null;
39+ x = *(int**)null;
40+ var t = typeof(char*);
41+ t = typeof(char**);
42+ var d1 = default(char*);
43+ var d2 = default(char**);
44+ a = *x * *x;
3645 }
3746}
3847" ;
@@ -60,6 +69,15 @@ unsafe void TestMethod()
6069* z = x;
6170 a = *
6271x;
72+
73+ // The following cases are all regression tests for DotNetAnalyzers/StyleCopAnalyzers#1457
74+ x = (int * )null;
75+ x = * (int* * )null;
76+ var t = typeof(char *);
77+ t = typeof(char* *);
78+ var d1 = default(char* );
79+ var d2 = default(char** );
80+ a = * x** x;
6381 }
6482}
6583" ;
@@ -75,6 +93,15 @@ unsafe void TestMethod()
7593 y = new int*[5];
7694 int* z = x;
7795 a = *x;
96+
97+ // The following cases are all regression tests for DotNetAnalyzers/StyleCopAnalyzers#1457
98+ x = (int*)null;
99+ x = *(int**)null;
100+ var t = typeof(char*);
101+ t = typeof(char**);
102+ var d1 = default(char*);
103+ var d2 = default(char**);
104+ a = *x**x;
78105 }
79106}
80107" ;
@@ -87,7 +114,20 @@ unsafe void TestMethod()
87114 this . CSharpDiagnostic ( ) . WithLocation ( 9 , 21 ) . WithArguments ( "not be preceded by a space" ) ,
88115 this . CSharpDiagnostic ( ) . WithLocation ( 9 , 21 ) . WithArguments ( "not be followed by a space" ) ,
89116 this . CSharpDiagnostic ( ) . WithLocation ( 11 , 0 ) . WithArguments ( "not appear at the beginning of a line" ) ,
90- this . CSharpDiagnostic ( ) . WithLocation ( 12 , 13 ) . WithArguments ( "not appear at the end of a line" )
117+ this . CSharpDiagnostic ( ) . WithLocation ( 12 , 13 ) . WithArguments ( "not appear at the end of a line" ) ,
118+ this . CSharpDiagnostic ( ) . WithLocation ( 16 , 18 ) . WithArguments ( "not be preceded by a space" ) ,
119+ this . CSharpDiagnostic ( ) . WithLocation ( 16 , 18 ) . WithArguments ( "not be followed by a space" ) ,
120+ this . CSharpDiagnostic ( ) . WithLocation ( 17 , 13 ) . WithArguments ( "not be followed by a space" ) ,
121+ this . CSharpDiagnostic ( ) . WithLocation ( 17 , 19 ) . WithArguments ( "not be followed by a space" ) ,
122+ this . CSharpDiagnostic ( ) . WithLocation ( 17 , 21 ) . WithArguments ( "not be preceded by a space" ) ,
123+ this . CSharpDiagnostic ( ) . WithLocation ( 17 , 21 ) . WithArguments ( "not be followed by a space" ) ,
124+ this . CSharpDiagnostic ( ) . WithLocation ( 18 , 29 ) . WithArguments ( "not be preceded by a space" ) ,
125+ this . CSharpDiagnostic ( ) . WithLocation ( 19 , 24 ) . WithArguments ( "not be followed by a space" ) ,
126+ this . CSharpDiagnostic ( ) . WithLocation ( 19 , 26 ) . WithArguments ( "not be preceded by a space" ) ,
127+ this . CSharpDiagnostic ( ) . WithLocation ( 20 , 30 ) . WithArguments ( "not be followed by a space" ) ,
128+ this . CSharpDiagnostic ( ) . WithLocation ( 21 , 31 ) . WithArguments ( "not be followed by a space" ) ,
129+ this . CSharpDiagnostic ( ) . WithLocation ( 22 , 13 ) . WithArguments ( "not be followed by a space" ) ,
130+ this . CSharpDiagnostic ( ) . WithLocation ( 22 , 17 ) . WithArguments ( "not be followed by a space" ) ,
91131 } ;
92132
93133 await this . VerifyCSharpDiagnosticAsync ( testCode , expected , CancellationToken . None ) . ConfigureAwait ( false ) ;
0 commit comments