Skip to content

Commit f060914

Browse files
committed
Check state for parser error in all tests
1 parent bfc582b commit f060914

33 files changed

+331
-0
lines changed

RubberduckTests/Inspections/AssignedByValParameterInspectionTests.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ public void AssignedByValParameter_ReturnsResult_Sub()
3030
var parser = new RubberduckParser(vbe.Object, new RubberduckParserState());
3131

3232
parser.Parse();
33+
if (parser.State.Status == ParserState.Error) { Assert.Inconclusive("Parser Error"); }
3334

3435
var inspection = new AssignedByValParameterInspection(parser.State);
3536
var inspectionResults = inspection.GetInspectionResults();
@@ -54,6 +55,7 @@ public void AssignedByValParameter_ReturnsResult_Function()
5455
var parser = new RubberduckParser(vbe.Object, new RubberduckParserState());
5556

5657
parser.Parse();
58+
if (parser.State.Status == ParserState.Error) { Assert.Inconclusive("Parser Error"); }
5759

5860
var inspection = new AssignedByValParameterInspection(parser.State);
5961
var inspectionResults = inspection.GetInspectionResults();
@@ -79,6 +81,7 @@ public void AssignedByValParameter_ReturnsResult_MultipleParams()
7981
var parser = new RubberduckParser(vbe.Object, new RubberduckParserState());
8082

8183
parser.Parse();
84+
if (parser.State.Status == ParserState.Error) { Assert.Inconclusive("Parser Error"); }
8285

8386
var inspection = new AssignedByValParameterInspection(parser.State);
8487
var inspectionResults = inspection.GetInspectionResults();
@@ -102,6 +105,7 @@ public void AssignedByValParameter_DoesNotReturnResult()
102105
var parser = new RubberduckParser(vbe.Object, new RubberduckParserState());
103106

104107
parser.Parse();
108+
if (parser.State.Status == ParserState.Error) { Assert.Inconclusive("Parser Error"); }
105109

106110
var inspection = new AssignedByValParameterInspection(parser.State);
107111
var inspectionResults = inspection.GetInspectionResults();
@@ -129,6 +133,7 @@ Dim var1 As Integer
129133
var parser = new RubberduckParser(vbe.Object, new RubberduckParserState());
130134

131135
parser.Parse();
136+
if (parser.State.Status == ParserState.Error) { Assert.Inconclusive("Parser Error"); }
132137

133138
var inspection = new AssignedByValParameterInspection(parser.State);
134139
var inspectionResults = inspection.GetInspectionResults();
@@ -160,6 +165,7 @@ public void AssignedByValParameter_QuickFixWorks()
160165
var parser = new RubberduckParser(vbe.Object, new RubberduckParserState());
161166

162167
parser.Parse();
168+
if (parser.State.Status == ParserState.Error) { Assert.Inconclusive("Parser Error"); }
163169

164170
var inspection = new AssignedByValParameterInspection(parser.State);
165171
var inspectionResults = inspection.GetInspectionResults();

RubberduckTests/Inspections/ConstantNotUsedInspectionTests.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ public void ConstantNotUsed_ReturnsResult()
3030
var parser = new RubberduckParser(vbe.Object, new RubberduckParserState());
3131

3232
parser.Parse();
33+
if (parser.State.Status == ParserState.Error) { Assert.Inconclusive("Parser Error"); }
3334

3435
var inspection = new ConstantNotUsedInspection(parser.State);
3536
var inspectionResults = inspection.GetInspectionResults();
@@ -55,6 +56,7 @@ public void ConstantNotUsed_ReturnsResult_MultipleConsts()
5556
var parser = new RubberduckParser(vbe.Object, new RubberduckParserState());
5657

5758
parser.Parse();
59+
if (parser.State.Status == ParserState.Error) { Assert.Inconclusive("Parser Error"); }
5860

5961
var inspection = new ConstantNotUsedInspection(parser.State);
6062
var inspectionResults = inspection.GetInspectionResults();
@@ -83,6 +85,7 @@ Public Sub Goo(ByVal arg1 As Integer)
8385
var parser = new RubberduckParser(vbe.Object, new RubberduckParserState());
8486

8587
parser.Parse();
88+
if (parser.State.Status == ParserState.Error) { Assert.Inconclusive("Parser Error"); }
8689

8790
var inspection = new ConstantNotUsedInspection(parser.State);
8891
var inspectionResults = inspection.GetInspectionResults();
@@ -113,6 +116,7 @@ Public Sub Goo(ByVal arg1 As Integer)
113116
var parser = new RubberduckParser(vbe.Object, new RubberduckParserState());
114117

115118
parser.Parse();
119+
if (parser.State.Status == ParserState.Error) { Assert.Inconclusive("Parser Error"); }
116120

117121
var inspection = new ConstantNotUsedInspection(parser.State);
118122
var inspectionResults = inspection.GetInspectionResults();
@@ -143,6 +147,7 @@ public void ConstantNotUsed_QuickFixWorks()
143147
var parser = new RubberduckParser(vbe.Object, new RubberduckParserState());
144148

145149
parser.Parse();
150+
if (parser.State.Status == ParserState.Error) { Assert.Inconclusive("Parser Error"); }
146151

147152
var inspection = new ConstantNotUsedInspection(parser.State);
148153
var inspectionResults = inspection.GetInspectionResults();

RubberduckTests/Inspections/DefaultProjectNameInspectionTests.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ public void DefaultProjectName_ReturnsResult()
2929
var parser = new RubberduckParser(vbe.Object, new RubberduckParserState());
3030

3131
parser.Parse();
32+
if (parser.State.Status == ParserState.Error) { Assert.Inconclusive("Parser Error"); }
3233

3334
var inspection = new DefaultProjectNameInspection(parser.State);
3435
var inspectionResults = inspection.GetInspectionResults();
@@ -53,6 +54,7 @@ public void DefaultProjectName_DoesNotReturnResult()
5354
var parser = new RubberduckParser(vbe.Object, new RubberduckParserState());
5455

5556
parser.Parse();
57+
if (parser.State.Status == ParserState.Error) { Assert.Inconclusive("Parser Error"); }
5658

5759
var inspection = new DefaultProjectNameInspection(parser.State);
5860
var inspectionResults = inspection.GetInspectionResults();

RubberduckTests/Inspections/EmptyStringLiteralInspectionTests.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ Public Sub Foo(ByRef arg1 As String)
3333
var parser = new RubberduckParser(vbe.Object, new RubberduckParserState());
3434

3535
parser.Parse();
36+
if (parser.State.Status == ParserState.Error) { Assert.Inconclusive("Parser Error"); }
3637

3738
var inspection = new EmptyStringLiteralInspection(parser.State);
3839
var inspectionResults = inspection.GetInspectionResults();
@@ -57,6 +58,7 @@ public void EmptyStringLiteral_ReturnsResult_Assignment()
5758
var parser = new RubberduckParser(vbe.Object, new RubberduckParserState());
5859

5960
parser.Parse();
61+
if (parser.State.Status == ParserState.Error) { Assert.Inconclusive("Parser Error"); }
6062

6163
var inspection = new EmptyStringLiteralInspection(parser.State);
6264
var inspectionResults = inspection.GetInspectionResults();
@@ -81,6 +83,7 @@ public void NotEmptyStringLiteral_DoesNotReturnResult()
8183
var parser = new RubberduckParser(vbe.Object, new RubberduckParserState());
8284

8385
parser.Parse();
86+
if (parser.State.Status == ParserState.Error) { Assert.Inconclusive("Parser Error"); }
8487

8588
var inspection = new EmptyStringLiteralInspection(parser.State);
8689
var inspectionResults = inspection.GetInspectionResults();
@@ -112,6 +115,7 @@ public void EmptyStringLiteral_QuickFixWorks()
112115
var parser = new RubberduckParser(vbe.Object, new RubberduckParserState());
113116

114117
parser.Parse();
118+
if (parser.State.Status == ParserState.Error) { Assert.Inconclusive("Parser Error"); }
115119

116120
var inspection = new EmptyStringLiteralInspection(parser.State);
117121
var inspectionResults = inspection.GetInspectionResults();

RubberduckTests/Inspections/EncapsulatePublicFieldInspectionTests.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ public void PublicField_ReturnsResult()
2828
var parser = new RubberduckParser(vbe.Object, new RubberduckParserState());
2929

3030
parser.Parse();
31+
if (parser.State.Status == ParserState.Error) { Assert.Inconclusive("Parser Error"); }
3132

3233
var inspection = new EncapsulatePublicFieldInspection(parser.State);
3334
var inspectionResults = inspection.GetInspectionResults();
@@ -52,6 +53,7 @@ public void MultiplePublicFields_ReturnMultipleResult()
5253
var parser = new RubberduckParser(vbe.Object, new RubberduckParserState());
5354

5455
parser.Parse();
56+
if (parser.State.Status == ParserState.Error) { Assert.Inconclusive("Parser Error"); }
5557

5658
var inspection = new EncapsulatePublicFieldInspection(parser.State);
5759
var inspectionResults = inspection.GetInspectionResults();
@@ -74,6 +76,7 @@ public void PrivateField_DoesNotReturnResult()
7476
var parser = new RubberduckParser(vbe.Object, new RubberduckParserState());
7577

7678
parser.Parse();
79+
if (parser.State.Status == ParserState.Error) { Assert.Inconclusive("Parser Error"); }
7780

7881
var inspection = new EncapsulatePublicFieldInspection(parser.State);
7982
var inspectionResults = inspection.GetInspectionResults();
@@ -97,6 +100,7 @@ public void PublicNonField_DoesNotReturnResult()
97100
var parser = new RubberduckParser(vbe.Object, new RubberduckParserState());
98101

99102
parser.Parse();
103+
if (parser.State.Status == ParserState.Error) { Assert.Inconclusive("Parser Error"); }
100104

101105
var inspection = new EncapsulatePublicFieldInspection(parser.State);
102106
var inspectionResults = inspection.GetInspectionResults();

RubberduckTests/Inspections/ImplicitByRefParameterInspectionTests.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ public void ImplicitByRefParameter_ReturnsResult()
2929
var parser = new RubberduckParser(vbe.Object, new RubberduckParserState());
3030

3131
parser.Parse();
32+
if (parser.State.Status == ParserState.Error) { Assert.Inconclusive("Parser Error"); }
3233

3334
var inspection = new ImplicitByRefParameterInspection(parser.State);
3435
var inspectionResults = inspection.GetInspectionResults();
@@ -52,6 +53,7 @@ public void ImplicitByRefParameter_ReturnsResult_MultipleParams()
5253
var parser = new RubberduckParser(vbe.Object, new RubberduckParserState());
5354

5455
parser.Parse();
56+
if (parser.State.Status == ParserState.Error) { Assert.Inconclusive("Parser Error"); }
5557

5658
var inspection = new ImplicitByRefParameterInspection(parser.State);
5759
var inspectionResults = inspection.GetInspectionResults();
@@ -75,6 +77,7 @@ public void ImplicitByRefParameter_DoesNotReturnResult_ByRef()
7577
var parser = new RubberduckParser(vbe.Object, new RubberduckParserState());
7678

7779
parser.Parse();
80+
if (parser.State.Status == ParserState.Error) { Assert.Inconclusive("Parser Error"); }
7881

7982
var inspection = new ImplicitByRefParameterInspection(parser.State);
8083
var inspectionResults = inspection.GetInspectionResults();
@@ -98,6 +101,7 @@ public void ImplicitByRefParameter_DoesNotReturnResult_ByVal()
98101
var parser = new RubberduckParser(vbe.Object, new RubberduckParserState());
99102

100103
parser.Parse();
104+
if (parser.State.Status == ParserState.Error) { Assert.Inconclusive("Parser Error"); }
101105

102106
var inspection = new ImplicitByRefParameterInspection(parser.State);
103107
var inspectionResults = inspection.GetInspectionResults();
@@ -121,6 +125,7 @@ public void ImplicitByRefParameter_ReturnsResult_SomePassedByRefImplicitely()
121125
var parser = new RubberduckParser(vbe.Object, new RubberduckParserState());
122126

123127
parser.Parse();
128+
if (parser.State.Status == ParserState.Error) { Assert.Inconclusive("Parser Error"); }
124129

125130
var inspection = new ImplicitByRefParameterInspection(parser.State);
126131
var inspectionResults = inspection.GetInspectionResults();
@@ -154,6 +159,7 @@ Sub IClass1_Foo(arg1 As Integer)
154159
var parser = new RubberduckParser(vbe.Object, new RubberduckParserState());
155160

156161
parser.Parse();
162+
if (parser.State.Status == ParserState.Error) { Assert.Inconclusive("Parser Error"); }
157163

158164
var inspection = new ImplicitByRefParameterInspection(parser.State);
159165
var inspectionResults = inspection.GetInspectionResults();
@@ -183,6 +189,7 @@ public void ImplicitByRefParameter_QuickFixWorks_PassByRef()
183189
var parser = new RubberduckParser(vbe.Object, new RubberduckParserState());
184190

185191
parser.Parse();
192+
if (parser.State.Status == ParserState.Error) { Assert.Inconclusive("Parser Error"); }
186193

187194
var inspection = new ImplicitByRefParameterInspection(parser.State);
188195
var inspectionResults = inspection.GetInspectionResults();
@@ -208,6 +215,7 @@ public void ImplicitByRefParameter_QuickFixWorks_ParamArrayMustBePassedByRef()
208215
var parser = new RubberduckParser(vbe.Object, new RubberduckParserState());
209216

210217
parser.Parse();
218+
if (parser.State.Status == ParserState.Error) { Assert.Inconclusive("Parser Error"); }
211219

212220
var inspection = new ImplicitByRefParameterInspection(parser.State);
213221
var inspectionResults = inspection.GetInspectionResults();

RubberduckTests/Inspections/ImplicitPublicMemberInspectionTests.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ public void ImplicitPublicMember_ReturnsResult_Sub()
2929
var parser = new RubberduckParser(vbe.Object, new RubberduckParserState());
3030

3131
parser.Parse();
32+
if (parser.State.Status == ParserState.Error) { Assert.Inconclusive("Parser Error"); }
3233

3334
var inspection = new ImplicitPublicMemberInspection(parser.State);
3435
var inspectionResults = inspection.GetInspectionResults();
@@ -53,6 +54,7 @@ public void ImplicitPublicMember_ReturnsResult_Function()
5354
var parser = new RubberduckParser(vbe.Object, new RubberduckParserState());
5455

5556
parser.Parse();
57+
if (parser.State.Status == ParserState.Error) { Assert.Inconclusive("Parser Error"); }
5658

5759
var inspection = new ImplicitPublicMemberInspection(parser.State);
5860
var inspectionResults = inspection.GetInspectionResults();
@@ -79,6 +81,7 @@ Sub Goo()
7981
var parser = new RubberduckParser(vbe.Object, new RubberduckParserState());
8082

8183
parser.Parse();
84+
if (parser.State.Status == ParserState.Error) { Assert.Inconclusive("Parser Error"); }
8285

8386
var inspection = new ImplicitPublicMemberInspection(parser.State);
8487
var inspectionResults = inspection.GetInspectionResults();
@@ -102,6 +105,7 @@ public void ImplicitPublicMember_DoesNotReturnResult()
102105
var parser = new RubberduckParser(vbe.Object, new RubberduckParserState());
103106

104107
parser.Parse();
108+
if (parser.State.Status == ParserState.Error) { Assert.Inconclusive("Parser Error"); }
105109

106110
var inspection = new ImplicitPublicMemberInspection(parser.State);
107111
var inspectionResults = inspection.GetInspectionResults();
@@ -128,6 +132,7 @@ Sub Goo()
128132
var parser = new RubberduckParser(vbe.Object, new RubberduckParserState());
129133

130134
parser.Parse();
135+
if (parser.State.Status == ParserState.Error) { Assert.Inconclusive("Parser Error"); }
131136

132137
var inspection = new ImplicitPublicMemberInspection(parser.State);
133138
var inspectionResults = inspection.GetInspectionResults();
@@ -157,6 +162,7 @@ public void ImplicitPublicMember_QuickFixWorks()
157162
var parser = new RubberduckParser(vbe.Object, new RubberduckParserState());
158163

159164
parser.Parse();
165+
if (parser.State.Status == ParserState.Error) { Assert.Inconclusive("Parser Error"); }
160166

161167
var inspection = new ImplicitPublicMemberInspection(parser.State);
162168
var inspectionResults = inspection.GetInspectionResults();

RubberduckTests/Inspections/ImplicitVariantReturnTypeInspectionTests.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ public void ImplicitVariantReturnType_ReturnsResult_Function()
2929
var parser = new RubberduckParser(vbe.Object, new RubberduckParserState());
3030

3131
parser.Parse();
32+
if (parser.State.Status == ParserState.Error) { Assert.Inconclusive("Parser Error"); }
3233

3334
var inspection = new ImplicitVariantReturnTypeInspection(parser.State);
3435
var inspectionResults = inspection.GetInspectionResults();
@@ -52,6 +53,7 @@ public void ImplicitVariantReturnType_ReturnsResult_PropertyGet()
5253
var parser = new RubberduckParser(vbe.Object, new RubberduckParserState());
5354

5455
parser.Parse();
56+
if (parser.State.Status == ParserState.Error) { Assert.Inconclusive("Parser Error"); }
5557

5658
var inspection = new ImplicitVariantReturnTypeInspection(parser.State);
5759
var inspectionResults = inspection.GetInspectionResults();
@@ -78,6 +80,7 @@ Function Goo()
7880
var parser = new RubberduckParser(vbe.Object, new RubberduckParserState());
7981

8082
parser.Parse();
83+
if (parser.State.Status == ParserState.Error) { Assert.Inconclusive("Parser Error"); }
8184

8285
var inspection = new ImplicitVariantReturnTypeInspection(parser.State);
8386
var inspectionResults = inspection.GetInspectionResults();
@@ -101,6 +104,7 @@ public void ImplicitVariantReturnType_DoesNotReturnResult()
101104
var parser = new RubberduckParser(vbe.Object, new RubberduckParserState());
102105

103106
parser.Parse();
107+
if (parser.State.Status == ParserState.Error) { Assert.Inconclusive("Parser Error"); }
104108

105109
var inspection = new ImplicitVariantReturnTypeInspection(parser.State);
106110
var inspectionResults = inspection.GetInspectionResults();
@@ -127,6 +131,7 @@ Function Goo() As String
127131
var parser = new RubberduckParser(vbe.Object, new RubberduckParserState());
128132

129133
parser.Parse();
134+
if (parser.State.Status == ParserState.Error) { Assert.Inconclusive("Parser Error"); }
130135

131136
var inspection = new ImplicitVariantReturnTypeInspection(parser.State);
132137
var inspectionResults = inspection.GetInspectionResults();
@@ -156,6 +161,7 @@ public void ImplicitVariantReturnType_QuickFixWorks_Function()
156161
var parser = new RubberduckParser(vbe.Object, new RubberduckParserState());
157162

158163
parser.Parse();
164+
if (parser.State.Status == ParserState.Error) { Assert.Inconclusive("Parser Error"); }
159165

160166
var inspection = new ImplicitVariantReturnTypeInspection(parser.State);
161167
var inspectionResults = inspection.GetInspectionResults();
@@ -187,6 +193,7 @@ public void ImplicitVariantReturnType_QuickFixWorks_PropertyGet()
187193
var parser = new RubberduckParser(vbe.Object, new RubberduckParserState());
188194

189195
parser.Parse();
196+
if (parser.State.Status == ParserState.Error) { Assert.Inconclusive("Parser Error"); }
190197

191198
var inspection = new ImplicitVariantReturnTypeInspection(parser.State);
192199
var inspectionResults = inspection.GetInspectionResults();

0 commit comments

Comments
 (0)