| OLD | NEW |
| 1 // This code was auto-generated, is not intended to be edited, and is subject to | 1 // This code was auto-generated, is not intended to be edited, and is subject to |
| 2 // significant change. Please see the README file for more information. | 2 // significant change. Please see the README file for more information. |
| 3 | 3 |
| 4 library engine.parser_test; | 4 library engine.parser_test; |
| 5 | 5 |
| 6 import 'dart:collection'; | 6 import 'dart:collection'; |
| 7 import 'package:analyzer-experimental/src/generated/java_core.dart'; | 7 import 'package:analyzer-experimental/src/generated/java_core.dart'; |
| 8 import 'package:analyzer-experimental/src/generated/java_engine.dart'; | 8 import 'package:analyzer-experimental/src/generated/java_engine.dart'; |
| 9 import 'package:analyzer-experimental/src/generated/java_junit.dart'; | 9 import 'package:analyzer-experimental/src/generated/java_junit.dart'; |
| 10 import 'package:analyzer-experimental/src/generated/source.dart'; | 10 import 'package:analyzer-experimental/src/generated/source.dart'; |
| 11 import 'package:analyzer-experimental/src/generated/error.dart'; | 11 import 'package:analyzer-experimental/src/generated/error.dart'; |
| 12 import 'package:analyzer-experimental/src/generated/scanner.dart'; | 12 import 'package:analyzer-experimental/src/generated/scanner.dart'; |
| 13 import 'package:analyzer-experimental/src/generated/ast.dart'; | 13 import 'package:analyzer-experimental/src/generated/ast.dart'; |
| 14 import 'package:analyzer-experimental/src/generated/parser.dart'; | 14 import 'package:analyzer-experimental/src/generated/parser.dart'; |
| 15 import 'package:analyzer-experimental/src/generated/utilities_dart.dart'; | 15 import 'package:analyzer-experimental/src/generated/utilities_dart.dart'; |
| 16 import 'package:unittest/unittest.dart' as _ut; | 16 import 'package:unittest/unittest.dart' as _ut; |
| 17 import 'test_support.dart'; | 17 import 'test_support.dart'; |
| 18 import 'scanner_test.dart' show TokenFactory; | 18 import 'scanner_test.dart' show TokenFactory; |
| 19 | 19 |
| 20 class ParserTestCase extends EngineTestCase { | |
| 21 /** | |
| 22 * An empty array of objects used as arguments to zero-argument methods. | |
| 23 */ | |
| 24 static List<Object> _EMPTY_ARGUMENTS = new List<Object>(0); | |
| 25 /** | |
| 26 * Invoke a parse method in {@link Parser}. The method is assumed to have the
given number and | |
| 27 * type of parameters and will be invoked with the given arguments. | |
| 28 * <p> | |
| 29 * The given source is scanned and the parser is initialized to start with the
first token in the | |
| 30 * source before the parse method is invoked. | |
| 31 * @param methodName the name of the parse method that should be invoked to pa
rse the source | |
| 32 * @param objects the values of the arguments to the method | |
| 33 * @param source the source to be parsed by the parse method | |
| 34 * @return the result of invoking the method | |
| 35 * @throws Exception if the method could not be invoked or throws an exception | |
| 36 * @throws AssertionFailedError if the result is {@code null} or if any errors
are produced | |
| 37 */ | |
| 38 static Object parse(String methodName, List<Object> objects, String source) =>
parse3(methodName, objects, source, new List<AnalysisError>(0)); | |
| 39 /** | |
| 40 * Invoke a parse method in {@link Parser}. The method is assumed to have the
given number and | |
| 41 * type of parameters and will be invoked with the given arguments. | |
| 42 * <p> | |
| 43 * The given source is scanned and the parser is initialized to start with the
first token in the | |
| 44 * source before the parse method is invoked. | |
| 45 * @param methodName the name of the parse method that should be invoked to pa
rse the source | |
| 46 * @param objects the values of the arguments to the method | |
| 47 * @param source the source to be parsed by the parse method | |
| 48 * @param errorCodes the error codes of the errors that should be generated | |
| 49 * @return the result of invoking the method | |
| 50 * @throws Exception if the method could not be invoked or throws an exception | |
| 51 * @throws AssertionFailedError if the result is {@code null} or the errors pr
oduced while | |
| 52 * scanning and parsing the source do not match the expected errors | |
| 53 */ | |
| 54 static Object parse3(String methodName, List<Object> objects, String source, L
ist<AnalysisError> errors) { | |
| 55 GatheringErrorListener listener = new GatheringErrorListener(); | |
| 56 Object result = invokeParserMethod(methodName, objects, source, listener); | |
| 57 listener.assertErrors(errors); | |
| 58 return result; | |
| 59 } | |
| 60 /** | |
| 61 * Invoke a parse method in {@link Parser}. The method is assumed to have the
given number and | |
| 62 * type of parameters and will be invoked with the given arguments. | |
| 63 * <p> | |
| 64 * The given source is scanned and the parser is initialized to start with the
first token in the | |
| 65 * source before the parse method is invoked. | |
| 66 * @param methodName the name of the parse method that should be invoked to pa
rse the source | |
| 67 * @param objects the values of the arguments to the method | |
| 68 * @param source the source to be parsed by the parse method | |
| 69 * @param errorCodes the error codes of the errors that should be generated | |
| 70 * @return the result of invoking the method | |
| 71 * @throws Exception if the method could not be invoked or throws an exception | |
| 72 * @throws AssertionFailedError if the result is {@code null} or the errors pr
oduced while | |
| 73 * scanning and parsing the source do not match the expected errors | |
| 74 */ | |
| 75 static Object parse4(String methodName, List<Object> objects, String source, L
ist<ErrorCode> errorCodes) { | |
| 76 GatheringErrorListener listener = new GatheringErrorListener(); | |
| 77 Object result = invokeParserMethod(methodName, objects, source, listener); | |
| 78 listener.assertErrors2(errorCodes); | |
| 79 return result; | |
| 80 } | |
| 81 /** | |
| 82 * Invoke a parse method in {@link Parser}. The method is assumed to have no a
rguments. | |
| 83 * <p> | |
| 84 * The given source is scanned and the parser is initialized to start with the
first token in the | |
| 85 * source before the parse method is invoked. | |
| 86 * @param methodName the name of the parse method that should be invoked to pa
rse the source | |
| 87 * @param source the source to be parsed by the parse method | |
| 88 * @param errorCodes the error codes of the errors that should be generated | |
| 89 * @return the result of invoking the method | |
| 90 * @throws Exception if the method could not be invoked or throws an exception | |
| 91 * @throws AssertionFailedError if the result is {@code null} or the errors pr
oduced while | |
| 92 * scanning and parsing the source do not match the expected errors | |
| 93 */ | |
| 94 static Object parse5(String methodName, String source, List<ErrorCode> errorCo
des) => parse4(methodName, _EMPTY_ARGUMENTS, source, errorCodes); | |
| 95 /** | |
| 96 * Parse the given source as a compilation unit. | |
| 97 * @param source the source to be parsed | |
| 98 * @param errorCodes the error codes of the errors that are expected to be fou
nd | |
| 99 * @return the compilation unit that was parsed | |
| 100 * @throws Exception if the source could not be parsed, if the compilation err
ors in the source do | |
| 101 * not match those that are expected, or if the result would have been {@code
null} | |
| 102 */ | |
| 103 static CompilationUnit parseCompilationUnit(String source, List<ErrorCode> err
orCodes) { | |
| 104 GatheringErrorListener listener = new GatheringErrorListener(); | |
| 105 StringScanner scanner = new StringScanner(null, source, listener); | |
| 106 listener.setLineInfo(new TestSource(), scanner.lineStarts); | |
| 107 Token token = scanner.tokenize(); | |
| 108 Parser parser = new Parser(null, listener); | |
| 109 CompilationUnit unit = parser.parseCompilationUnit(token); | |
| 110 JUnitTestCase.assertNotNull(unit); | |
| 111 listener.assertErrors2(errorCodes); | |
| 112 return unit; | |
| 113 } | |
| 114 /** | |
| 115 * Parse the given source as an expression. | |
| 116 * @param source the source to be parsed | |
| 117 * @param errorCodes the error codes of the errors that are expected to be fou
nd | |
| 118 * @return the expression that was parsed | |
| 119 * @throws Exception if the source could not be parsed, if the compilation err
ors in the source do | |
| 120 * not match those that are expected, or if the result would have been {@code
null} | |
| 121 */ | |
| 122 static Expression parseExpression(String source, List<ErrorCode> errorCodes) { | |
| 123 GatheringErrorListener listener = new GatheringErrorListener(); | |
| 124 StringScanner scanner = new StringScanner(null, source, listener); | |
| 125 listener.setLineInfo(new TestSource(), scanner.lineStarts); | |
| 126 Token token = scanner.tokenize(); | |
| 127 Parser parser = new Parser(null, listener); | |
| 128 Expression expression = parser.parseExpression(token); | |
| 129 JUnitTestCase.assertNotNull(expression); | |
| 130 listener.assertErrors2(errorCodes); | |
| 131 return (expression as Expression); | |
| 132 } | |
| 133 /** | |
| 134 * Parse the given source as a statement. | |
| 135 * @param source the source to be parsed | |
| 136 * @param errorCodes the error codes of the errors that are expected to be fou
nd | |
| 137 * @return the statement that was parsed | |
| 138 * @throws Exception if the source could not be parsed, if the compilation err
ors in the source do | |
| 139 * not match those that are expected, or if the result would have been {@code
null} | |
| 140 */ | |
| 141 static Statement parseStatement(String source, List<ErrorCode> errorCodes) { | |
| 142 GatheringErrorListener listener = new GatheringErrorListener(); | |
| 143 StringScanner scanner = new StringScanner(null, source, listener); | |
| 144 listener.setLineInfo(new TestSource(), scanner.lineStarts); | |
| 145 Token token = scanner.tokenize(); | |
| 146 Parser parser = new Parser(null, listener); | |
| 147 Statement statement = parser.parseStatement(token); | |
| 148 JUnitTestCase.assertNotNull(statement); | |
| 149 listener.assertErrors2(errorCodes); | |
| 150 return (statement as Statement); | |
| 151 } | |
| 152 /** | |
| 153 * Parse the given source as a sequence of statements. | |
| 154 * @param source the source to be parsed | |
| 155 * @param expectedCount the number of statements that are expected | |
| 156 * @param errorCodes the error codes of the errors that are expected to be fou
nd | |
| 157 * @return the statements that were parsed | |
| 158 * @throws Exception if the source could not be parsed, if the number of state
ments does not match | |
| 159 * the expected count, if the compilation errors in the source do not match th
ose that | |
| 160 * are expected, or if the result would have been {@code null} | |
| 161 */ | |
| 162 static List<Statement> parseStatements(String source, int expectedCount, List<
ErrorCode> errorCodes) { | |
| 163 GatheringErrorListener listener = new GatheringErrorListener(); | |
| 164 StringScanner scanner = new StringScanner(null, source, listener); | |
| 165 listener.setLineInfo(new TestSource(), scanner.lineStarts); | |
| 166 Token token = scanner.tokenize(); | |
| 167 Parser parser = new Parser(null, listener); | |
| 168 List<Statement> statements = parser.parseStatements(token); | |
| 169 EngineTestCase.assertSize(expectedCount, statements); | |
| 170 listener.assertErrors2(errorCodes); | |
| 171 return statements; | |
| 172 } | |
| 173 /** | |
| 174 * Invoke a method in {@link Parser}. The method is assumed to have the given
number and type of | |
| 175 * parameters and will be invoked with the given arguments. | |
| 176 * <p> | |
| 177 * The given source is scanned and the parser is initialized to start with the
first token in the | |
| 178 * source before the method is invoked. | |
| 179 * @param methodName the name of the method that should be invoked | |
| 180 * @param objects the values of the arguments to the method | |
| 181 * @param source the source to be processed by the parse method | |
| 182 * @param listener the error listener that will be used for both scanning and
parsing | |
| 183 * @return the result of invoking the method | |
| 184 * @throws Exception if the method could not be invoked or throws an exception | |
| 185 * @throws AssertionFailedError if the result is {@code null} or the errors pr
oduced while | |
| 186 * scanning and parsing the source do not match the expected errors | |
| 187 */ | |
| 188 static Object invokeParserMethod(String methodName, List<Object> objects, Stri
ng source, GatheringErrorListener listener) { | |
| 189 StringScanner scanner = new StringScanner(null, source, listener); | |
| 190 Token tokenStream = scanner.tokenize(); | |
| 191 listener.setLineInfo(new TestSource(), scanner.lineStarts); | |
| 192 Parser parser = new Parser(null, listener); | |
| 193 Object result = invokeParserMethodImpl(parser, methodName, objects, tokenStr
eam); | |
| 194 JUnitTestCase.assertNotNull(result); | |
| 195 return (result as Object); | |
| 196 } | |
| 197 /** | |
| 198 * Invoke a method in {@link Parser}. The method is assumed to have no argumen
ts. | |
| 199 * <p> | |
| 200 * The given source is scanned and the parser is initialized to start with the
first token in the | |
| 201 * source before the method is invoked. | |
| 202 * @param methodName the name of the method that should be invoked | |
| 203 * @param source the source to be processed by the parse method | |
| 204 * @param listener the error listener that will be used for both scanning and
parsing | |
| 205 * @return the result of invoking the method | |
| 206 * @throws Exception if the method could not be invoked or throws an exception | |
| 207 * @throws AssertionFailedError if the result is {@code null} or the errors pr
oduced while | |
| 208 * scanning and parsing the source do not match the expected errors | |
| 209 */ | |
| 210 static Object invokeParserMethod2(String methodName, String source, GatheringE
rrorListener listener) => invokeParserMethod(methodName, _EMPTY_ARGUMENTS, sourc
e, listener); | |
| 211 /** | |
| 212 * Return a CommentAndMetadata object with the given values that can be used f
or testing. | |
| 213 * @param comment the comment to be wrapped in the object | |
| 214 * @param annotations the annotations to be wrapped in the object | |
| 215 * @return a CommentAndMetadata object that can be used for testing | |
| 216 */ | |
| 217 CommentAndMetadata commentAndMetadata(Comment comment, List<Annotation> annota
tions) { | |
| 218 List<Annotation> metadata = new List<Annotation>(); | |
| 219 for (Annotation annotation in annotations) { | |
| 220 metadata.add(annotation); | |
| 221 } | |
| 222 return new CommentAndMetadata(comment, metadata); | |
| 223 } | |
| 224 /** | |
| 225 * Return an empty CommentAndMetadata object that can be used for testing. | |
| 226 * @return an empty CommentAndMetadata object that can be used for testing | |
| 227 */ | |
| 228 CommentAndMetadata emptyCommentAndMetadata() => new CommentAndMetadata(null, n
ew List<Annotation>()); | |
| 229 static dartSuite() { | |
| 230 _ut.group('ParserTestCase', () { | |
| 231 }); | |
| 232 } | |
| 233 } | |
| 234 /** | |
| 235 * Instances of the class {@code ASTValidator} are used to validate the correct
construction of an | |
| 236 * AST structure. | |
| 237 */ | |
| 238 class ASTValidator extends GeneralizingASTVisitor<Object> { | |
| 239 /** | |
| 240 * A list containing the errors found while traversing the AST structure. | |
| 241 */ | |
| 242 List<String> _errors = new List<String>(); | |
| 243 /** | |
| 244 * Assert that no errors were found while traversing any of the AST structures
that have been | |
| 245 * visited. | |
| 246 */ | |
| 247 void assertValid() { | |
| 248 if (!_errors.isEmpty) { | |
| 249 StringBuffer builder = new StringBuffer(); | |
| 250 builder.add("Invalid AST structure:"); | |
| 251 for (String message in _errors) { | |
| 252 builder.add("\r\n "); | |
| 253 builder.add(message); | |
| 254 } | |
| 255 JUnitTestCase.fail(builder.toString()); | |
| 256 } | |
| 257 } | |
| 258 Object visitNode(ASTNode node) { | |
| 259 validate(node); | |
| 260 return super.visitNode(node); | |
| 261 } | |
| 262 /** | |
| 263 * Validate that the given AST node is correctly constructed. | |
| 264 * @param node the AST node being validated | |
| 265 */ | |
| 266 void validate(ASTNode node) { | |
| 267 ASTNode parent11 = node.parent; | |
| 268 if (node is CompilationUnit) { | |
| 269 if (parent11 != null) { | |
| 270 _errors.add("Compilation units should not have a parent"); | |
| 271 } | |
| 272 } else { | |
| 273 if (parent11 == null) { | |
| 274 _errors.add("No parent for ${node.runtimeType.toString()}"); | |
| 275 } | |
| 276 } | |
| 277 if (node.beginToken == null) { | |
| 278 _errors.add("No begin token for ${node.runtimeType.toString()}"); | |
| 279 } | |
| 280 if (node.endToken == null) { | |
| 281 _errors.add("No end token for ${node.runtimeType.toString()}"); | |
| 282 } | |
| 283 int nodeStart = node.offset; | |
| 284 int nodeLength = node.length; | |
| 285 if (nodeStart < 0 || nodeLength < 0) { | |
| 286 _errors.add("No source info for ${node.runtimeType.toString()}"); | |
| 287 } | |
| 288 if (parent11 != null) { | |
| 289 int nodeEnd = nodeStart + nodeLength; | |
| 290 int parentStart = parent11.offset; | |
| 291 int parentEnd = parentStart + parent11.length; | |
| 292 if (nodeStart < parentStart) { | |
| 293 _errors.add("Invalid source start (${nodeStart}) for ${node.runtimeType.
toString()} inside ${parent11.runtimeType.toString()} (${parentStart})"); | |
| 294 } | |
| 295 if (nodeEnd > parentEnd) { | |
| 296 _errors.add("Invalid source end (${nodeEnd}) for ${node.runtimeType.toSt
ring()} inside ${parent11.runtimeType.toString()} (${parentStart})"); | |
| 297 } | |
| 298 } | |
| 299 } | |
| 300 } | |
| 301 /** | |
| 302 * The class {@code RecoveryParserTest} defines parser tests that test the parsi
ng of invalid code | |
| 303 * sequences to ensure that the correct recovery steps are taken in the parser. | |
| 304 */ | |
| 305 class RecoveryParserTest extends ParserTestCase { | |
| 306 void test_additiveExpression_missing_LHS() { | |
| 307 BinaryExpression expression = ParserTestCase.parseExpression("+ y", [ParserE
rrorCode.USE_OF_UNARY_PLUS_OPERATOR]); | |
| 308 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand); | |
| 309 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic()); | |
| 310 } | |
| 311 void test_additiveExpression_missing_LHS_RHS() { | |
| 312 BinaryExpression expression = ParserTestCase.parseExpression("+", [ParserErr
orCode.USE_OF_UNARY_PLUS_OPERATOR]); | |
| 313 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand); | |
| 314 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic()); | |
| 315 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); | |
| 316 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); | |
| 317 } | |
| 318 void test_additiveExpression_missing_RHS() { | |
| 319 BinaryExpression expression = ParserTestCase.parseExpression("x +", []); | |
| 320 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); | |
| 321 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); | |
| 322 } | |
| 323 void test_additiveExpression_missing_RHS_super() { | |
| 324 BinaryExpression expression = ParserTestCase.parseExpression("super +", []); | |
| 325 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); | |
| 326 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); | |
| 327 } | |
| 328 void test_additiveExpression_precedence_multiplicative_left() { | |
| 329 BinaryExpression expression = ParserTestCase.parseExpression("* +", [ParserE
rrorCode.USE_OF_UNARY_PLUS_OPERATOR]); | |
| 330 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); | |
| 331 } | |
| 332 void test_additiveExpression_precedence_multiplicative_right() { | |
| 333 BinaryExpression expression = ParserTestCase.parseExpression("+ *", [ParserE
rrorCode.USE_OF_UNARY_PLUS_OPERATOR]); | |
| 334 EngineTestCase.assertInstanceOf(BinaryExpression, expression.rightOperand); | |
| 335 } | |
| 336 void test_additiveExpression_super() { | |
| 337 BinaryExpression expression = ParserTestCase.parseExpression("super + +", [P
arserErrorCode.USE_OF_UNARY_PLUS_OPERATOR]); | |
| 338 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); | |
| 339 } | |
| 340 void test_argumentDefinitionTest_missing_identifier() { | |
| 341 ArgumentDefinitionTest expression = ParserTestCase.parseExpression("?", [Par
serErrorCode.MISSING_IDENTIFIER]); | |
| 342 JUnitTestCase.assertTrue(expression.identifier.isSynthetic()); | |
| 343 } | |
| 344 void test_assignmentExpression_missing_compound1() { | |
| 345 AssignmentExpression expression = ParserTestCase.parseExpression("= y = 0",
[]); | |
| 346 Expression syntheticExpression = expression.leftHandSide; | |
| 347 EngineTestCase.assertInstanceOf(SimpleIdentifier, syntheticExpression); | |
| 348 JUnitTestCase.assertTrue(syntheticExpression.isSynthetic()); | |
| 349 } | |
| 350 void test_assignmentExpression_missing_compound2() { | |
| 351 AssignmentExpression expression = ParserTestCase.parseExpression("x = = 0",
[]); | |
| 352 Expression syntheticExpression = ((expression.rightHandSide as AssignmentExp
ression)).leftHandSide; | |
| 353 EngineTestCase.assertInstanceOf(SimpleIdentifier, syntheticExpression); | |
| 354 JUnitTestCase.assertTrue(syntheticExpression.isSynthetic()); | |
| 355 } | |
| 356 void test_assignmentExpression_missing_compound3() { | |
| 357 AssignmentExpression expression = ParserTestCase.parseExpression("x = y =",
[]); | |
| 358 Expression syntheticExpression = ((expression.rightHandSide as AssignmentExp
ression)).rightHandSide; | |
| 359 EngineTestCase.assertInstanceOf(SimpleIdentifier, syntheticExpression); | |
| 360 JUnitTestCase.assertTrue(syntheticExpression.isSynthetic()); | |
| 361 } | |
| 362 void test_assignmentExpression_missing_LHS() { | |
| 363 AssignmentExpression expression = ParserTestCase.parseExpression("= 0", []); | |
| 364 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftHandSide); | |
| 365 JUnitTestCase.assertTrue(expression.leftHandSide.isSynthetic()); | |
| 366 } | |
| 367 void test_assignmentExpression_missing_RHS() { | |
| 368 AssignmentExpression expression = ParserTestCase.parseExpression("x =", []); | |
| 369 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftHandSide); | |
| 370 JUnitTestCase.assertTrue(expression.rightHandSide.isSynthetic()); | |
| 371 } | |
| 372 void test_bitwiseAndExpression_missing_LHS() { | |
| 373 BinaryExpression expression = ParserTestCase.parseExpression("& y", []); | |
| 374 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand); | |
| 375 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic()); | |
| 376 } | |
| 377 void test_bitwiseAndExpression_missing_LHS_RHS() { | |
| 378 BinaryExpression expression = ParserTestCase.parseExpression("&", []); | |
| 379 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand); | |
| 380 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic()); | |
| 381 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); | |
| 382 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); | |
| 383 } | |
| 384 void test_bitwiseAndExpression_missing_RHS() { | |
| 385 BinaryExpression expression = ParserTestCase.parseExpression("x &", []); | |
| 386 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); | |
| 387 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); | |
| 388 } | |
| 389 void test_bitwiseAndExpression_missing_RHS_super() { | |
| 390 BinaryExpression expression = ParserTestCase.parseExpression("super &", []); | |
| 391 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); | |
| 392 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); | |
| 393 } | |
| 394 void test_bitwiseAndExpression_precedence_equality_left() { | |
| 395 BinaryExpression expression = ParserTestCase.parseExpression("== &", []); | |
| 396 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); | |
| 397 } | |
| 398 void test_bitwiseAndExpression_precedence_equality_right() { | |
| 399 BinaryExpression expression = ParserTestCase.parseExpression("& ==", []); | |
| 400 EngineTestCase.assertInstanceOf(BinaryExpression, expression.rightOperand); | |
| 401 } | |
| 402 void test_bitwiseAndExpression_super() { | |
| 403 BinaryExpression expression = ParserTestCase.parseExpression("super & &", [
]); | |
| 404 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); | |
| 405 } | |
| 406 void test_bitwiseOrExpression_missing_LHS() { | |
| 407 BinaryExpression expression = ParserTestCase.parseExpression("| y", []); | |
| 408 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand); | |
| 409 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic()); | |
| 410 } | |
| 411 void test_bitwiseOrExpression_missing_LHS_RHS() { | |
| 412 BinaryExpression expression = ParserTestCase.parseExpression("|", []); | |
| 413 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand); | |
| 414 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic()); | |
| 415 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); | |
| 416 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); | |
| 417 } | |
| 418 void test_bitwiseOrExpression_missing_RHS() { | |
| 419 BinaryExpression expression = ParserTestCase.parseExpression("x |", []); | |
| 420 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); | |
| 421 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); | |
| 422 } | |
| 423 void test_bitwiseOrExpression_missing_RHS_super() { | |
| 424 BinaryExpression expression = ParserTestCase.parseExpression("super |", []); | |
| 425 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); | |
| 426 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); | |
| 427 } | |
| 428 void test_bitwiseOrExpression_precedence_xor_left() { | |
| 429 BinaryExpression expression = ParserTestCase.parseExpression("^ |", []); | |
| 430 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); | |
| 431 } | |
| 432 void test_bitwiseOrExpression_precedence_xor_right() { | |
| 433 BinaryExpression expression = ParserTestCase.parseExpression("| ^", []); | |
| 434 EngineTestCase.assertInstanceOf(BinaryExpression, expression.rightOperand); | |
| 435 } | |
| 436 void test_bitwiseOrExpression_super() { | |
| 437 BinaryExpression expression = ParserTestCase.parseExpression("super | |", [
]); | |
| 438 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); | |
| 439 } | |
| 440 void test_bitwiseXorExpression_missing_LHS() { | |
| 441 BinaryExpression expression = ParserTestCase.parseExpression("^ y", []); | |
| 442 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand); | |
| 443 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic()); | |
| 444 } | |
| 445 void test_bitwiseXorExpression_missing_LHS_RHS() { | |
| 446 BinaryExpression expression = ParserTestCase.parseExpression("^", []); | |
| 447 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand); | |
| 448 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic()); | |
| 449 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); | |
| 450 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); | |
| 451 } | |
| 452 void test_bitwiseXorExpression_missing_RHS() { | |
| 453 BinaryExpression expression = ParserTestCase.parseExpression("x ^", []); | |
| 454 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); | |
| 455 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); | |
| 456 } | |
| 457 void test_bitwiseXorExpression_missing_RHS_super() { | |
| 458 BinaryExpression expression = ParserTestCase.parseExpression("super ^", []); | |
| 459 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); | |
| 460 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); | |
| 461 } | |
| 462 void test_bitwiseXorExpression_precedence_and_left() { | |
| 463 BinaryExpression expression = ParserTestCase.parseExpression("& ^", []); | |
| 464 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); | |
| 465 } | |
| 466 void test_bitwiseXorExpression_precedence_and_right() { | |
| 467 BinaryExpression expression = ParserTestCase.parseExpression("^ &", []); | |
| 468 EngineTestCase.assertInstanceOf(BinaryExpression, expression.rightOperand); | |
| 469 } | |
| 470 void test_bitwiseXorExpression_super() { | |
| 471 BinaryExpression expression = ParserTestCase.parseExpression("super ^ ^", [
]); | |
| 472 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); | |
| 473 } | |
| 474 void test_conditionalExpression_missingElse() { | |
| 475 ConditionalExpression expression = ParserTestCase.parse5("parseConditionalEx
pression", "x ? y :", []); | |
| 476 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.elseExpression)
; | |
| 477 JUnitTestCase.assertTrue(expression.elseExpression.isSynthetic()); | |
| 478 } | |
| 479 void test_conditionalExpression_missingThen() { | |
| 480 ConditionalExpression expression = ParserTestCase.parse5("parseConditionalEx
pression", "x ? : z", []); | |
| 481 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.thenExpression)
; | |
| 482 JUnitTestCase.assertTrue(expression.thenExpression.isSynthetic()); | |
| 483 } | |
| 484 void test_equalityExpression_missing_LHS() { | |
| 485 BinaryExpression expression = ParserTestCase.parseExpression("== y", []); | |
| 486 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand); | |
| 487 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic()); | |
| 488 } | |
| 489 void test_equalityExpression_missing_LHS_RHS() { | |
| 490 BinaryExpression expression = ParserTestCase.parseExpression("==", []); | |
| 491 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand); | |
| 492 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic()); | |
| 493 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); | |
| 494 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); | |
| 495 } | |
| 496 void test_equalityExpression_missing_RHS() { | |
| 497 BinaryExpression expression = ParserTestCase.parseExpression("x ==", []); | |
| 498 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); | |
| 499 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); | |
| 500 } | |
| 501 void test_equalityExpression_missing_RHS_super() { | |
| 502 BinaryExpression expression = ParserTestCase.parseExpression("super ==", [])
; | |
| 503 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); | |
| 504 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); | |
| 505 } | |
| 506 void test_equalityExpression_precedence_relational_left() { | |
| 507 BinaryExpression expression = ParserTestCase.parseExpression("is ==", [Parse
rErrorCode.MISSING_IDENTIFIER]); | |
| 508 EngineTestCase.assertInstanceOf(IsExpression, expression.leftOperand); | |
| 509 } | |
| 510 void test_equalityExpression_precedence_relational_right() { | |
| 511 BinaryExpression expression = ParserTestCase.parseExpression("== is", [Parse
rErrorCode.MISSING_IDENTIFIER]); | |
| 512 EngineTestCase.assertInstanceOf(IsExpression, expression.rightOperand); | |
| 513 } | |
| 514 void test_equalityExpression_super() { | |
| 515 BinaryExpression expression = ParserTestCase.parseExpression("super == ==",
[]); | |
| 516 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); | |
| 517 } | |
| 518 void test_expressionList_multiple_end() { | |
| 519 List<Expression> result = ParserTestCase.parse5("parseExpressionList", ", 2,
3, 4", []); | |
| 520 EngineTestCase.assertSize(4, result); | |
| 521 Expression syntheticExpression = result[0]; | |
| 522 EngineTestCase.assertInstanceOf(SimpleIdentifier, syntheticExpression); | |
| 523 JUnitTestCase.assertTrue(syntheticExpression.isSynthetic()); | |
| 524 } | |
| 525 void test_expressionList_multiple_middle() { | |
| 526 List<Expression> result = ParserTestCase.parse5("parseExpressionList", "1, 2
, , 4", []); | |
| 527 EngineTestCase.assertSize(4, result); | |
| 528 Expression syntheticExpression = result[2]; | |
| 529 EngineTestCase.assertInstanceOf(SimpleIdentifier, syntheticExpression); | |
| 530 JUnitTestCase.assertTrue(syntheticExpression.isSynthetic()); | |
| 531 } | |
| 532 void test_expressionList_multiple_start() { | |
| 533 List<Expression> result = ParserTestCase.parse5("parseExpressionList", "1, 2
, 3,", []); | |
| 534 EngineTestCase.assertSize(4, result); | |
| 535 Expression syntheticExpression = result[3]; | |
| 536 EngineTestCase.assertInstanceOf(SimpleIdentifier, syntheticExpression); | |
| 537 JUnitTestCase.assertTrue(syntheticExpression.isSynthetic()); | |
| 538 } | |
| 539 void test_logicalAndExpression_missing_LHS() { | |
| 540 BinaryExpression expression = ParserTestCase.parseExpression("&& y", []); | |
| 541 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand); | |
| 542 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic()); | |
| 543 } | |
| 544 void test_logicalAndExpression_missing_LHS_RHS() { | |
| 545 BinaryExpression expression = ParserTestCase.parseExpression("&&", []); | |
| 546 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand); | |
| 547 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic()); | |
| 548 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); | |
| 549 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); | |
| 550 } | |
| 551 void test_logicalAndExpression_missing_RHS() { | |
| 552 BinaryExpression expression = ParserTestCase.parseExpression("x &&", []); | |
| 553 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); | |
| 554 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); | |
| 555 } | |
| 556 void test_logicalAndExpression_precedence_bitwiseOr_left() { | |
| 557 BinaryExpression expression = ParserTestCase.parseExpression("| &&", []); | |
| 558 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); | |
| 559 } | |
| 560 void test_logicalAndExpression_precedence_bitwiseOr_right() { | |
| 561 BinaryExpression expression = ParserTestCase.parseExpression("&& |", []); | |
| 562 EngineTestCase.assertInstanceOf(BinaryExpression, expression.rightOperand); | |
| 563 } | |
| 564 void test_logicalOrExpression_missing_LHS() { | |
| 565 BinaryExpression expression = ParserTestCase.parseExpression("|| y", []); | |
| 566 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand); | |
| 567 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic()); | |
| 568 } | |
| 569 void test_logicalOrExpression_missing_LHS_RHS() { | |
| 570 BinaryExpression expression = ParserTestCase.parseExpression("||", []); | |
| 571 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand); | |
| 572 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic()); | |
| 573 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); | |
| 574 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); | |
| 575 } | |
| 576 void test_logicalOrExpression_missing_RHS() { | |
| 577 BinaryExpression expression = ParserTestCase.parseExpression("x ||", []); | |
| 578 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); | |
| 579 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); | |
| 580 } | |
| 581 void test_logicalOrExpression_precedence_logicalAnd_left() { | |
| 582 BinaryExpression expression = ParserTestCase.parseExpression("&& ||", []); | |
| 583 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); | |
| 584 } | |
| 585 void test_logicalOrExpression_precedence_logicalAnd_right() { | |
| 586 BinaryExpression expression = ParserTestCase.parseExpression("|| &&", []); | |
| 587 EngineTestCase.assertInstanceOf(BinaryExpression, expression.rightOperand); | |
| 588 } | |
| 589 void test_multiplicativeExpression_missing_LHS() { | |
| 590 BinaryExpression expression = ParserTestCase.parseExpression("* y", []); | |
| 591 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand); | |
| 592 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic()); | |
| 593 } | |
| 594 void test_multiplicativeExpression_missing_LHS_RHS() { | |
| 595 BinaryExpression expression = ParserTestCase.parseExpression("*", []); | |
| 596 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand); | |
| 597 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic()); | |
| 598 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); | |
| 599 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); | |
| 600 } | |
| 601 void test_multiplicativeExpression_missing_RHS() { | |
| 602 BinaryExpression expression = ParserTestCase.parseExpression("x *", []); | |
| 603 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); | |
| 604 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); | |
| 605 } | |
| 606 void test_multiplicativeExpression_missing_RHS_super() { | |
| 607 BinaryExpression expression = ParserTestCase.parseExpression("super *", []); | |
| 608 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); | |
| 609 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); | |
| 610 } | |
| 611 void test_multiplicativeExpression_precedence_unary_left() { | |
| 612 BinaryExpression expression = ParserTestCase.parseExpression("-x *", []); | |
| 613 EngineTestCase.assertInstanceOf(PrefixExpression, expression.leftOperand); | |
| 614 } | |
| 615 void test_multiplicativeExpression_precedence_unary_right() { | |
| 616 BinaryExpression expression = ParserTestCase.parseExpression("* -y", []); | |
| 617 EngineTestCase.assertInstanceOf(PrefixExpression, expression.rightOperand); | |
| 618 } | |
| 619 void test_multiplicativeExpression_super() { | |
| 620 BinaryExpression expression = ParserTestCase.parseExpression("super == ==",
[]); | |
| 621 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); | |
| 622 } | |
| 623 void test_prefixExpression_missing_operand_minus() { | |
| 624 PrefixExpression expression = ParserTestCase.parseExpression("-", []); | |
| 625 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.operand); | |
| 626 JUnitTestCase.assertTrue(expression.operand.isSynthetic()); | |
| 627 JUnitTestCase.assertEquals(TokenType.MINUS, expression.operator.type); | |
| 628 } | |
| 629 void test_relationalExpression_missing_LHS() { | |
| 630 IsExpression expression = ParserTestCase.parseExpression("is y", []); | |
| 631 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.expression); | |
| 632 JUnitTestCase.assertTrue(expression.expression.isSynthetic()); | |
| 633 } | |
| 634 void test_relationalExpression_missing_LHS_RHS() { | |
| 635 IsExpression expression = ParserTestCase.parseExpression("is", [ParserErrorC
ode.MISSING_IDENTIFIER]); | |
| 636 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.expression); | |
| 637 JUnitTestCase.assertTrue(expression.expression.isSynthetic()); | |
| 638 EngineTestCase.assertInstanceOf(TypeName, expression.type); | |
| 639 JUnitTestCase.assertTrue(expression.type.isSynthetic()); | |
| 640 } | |
| 641 void test_relationalExpression_missing_RHS() { | |
| 642 IsExpression expression = ParserTestCase.parseExpression("x is", [ParserErro
rCode.MISSING_IDENTIFIER]); | |
| 643 EngineTestCase.assertInstanceOf(TypeName, expression.type); | |
| 644 JUnitTestCase.assertTrue(expression.type.isSynthetic()); | |
| 645 } | |
| 646 void test_relationalExpression_precedence_shift_right() { | |
| 647 IsExpression expression = ParserTestCase.parseExpression("<< is", [ParserErr
orCode.MISSING_IDENTIFIER]); | |
| 648 EngineTestCase.assertInstanceOf(BinaryExpression, expression.expression); | |
| 649 } | |
| 650 void test_shiftExpression_missing_LHS() { | |
| 651 BinaryExpression expression = ParserTestCase.parseExpression("<< y", []); | |
| 652 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand); | |
| 653 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic()); | |
| 654 } | |
| 655 void test_shiftExpression_missing_LHS_RHS() { | |
| 656 BinaryExpression expression = ParserTestCase.parseExpression("<<", []); | |
| 657 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand); | |
| 658 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic()); | |
| 659 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); | |
| 660 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); | |
| 661 } | |
| 662 void test_shiftExpression_missing_RHS() { | |
| 663 BinaryExpression expression = ParserTestCase.parseExpression("x <<", []); | |
| 664 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); | |
| 665 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); | |
| 666 } | |
| 667 void test_shiftExpression_missing_RHS_super() { | |
| 668 BinaryExpression expression = ParserTestCase.parseExpression("super <<", [])
; | |
| 669 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); | |
| 670 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); | |
| 671 } | |
| 672 void test_shiftExpression_precedence_unary_left() { | |
| 673 BinaryExpression expression = ParserTestCase.parseExpression("+ <<", [Parser
ErrorCode.USE_OF_UNARY_PLUS_OPERATOR]); | |
| 674 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); | |
| 675 } | |
| 676 void test_shiftExpression_precedence_unary_right() { | |
| 677 BinaryExpression expression = ParserTestCase.parseExpression("<< +", [Parser
ErrorCode.USE_OF_UNARY_PLUS_OPERATOR]); | |
| 678 EngineTestCase.assertInstanceOf(BinaryExpression, expression.rightOperand); | |
| 679 } | |
| 680 void test_shiftExpression_super() { | |
| 681 BinaryExpression expression = ParserTestCase.parseExpression("super << <<",
[]); | |
| 682 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); | |
| 683 } | |
| 684 void test_topLevelExternalFunction_extraSemicolon() { | |
| 685 CompilationUnit unit = ParserTestCase.parseCompilationUnit("external void f(
A a);", [ParserErrorCode.UNEXPECTED_TOKEN]); | |
| 686 NodeList<CompilationUnitMember> declarations3 = unit.declarations; | |
| 687 EngineTestCase.assertSize(1, declarations3); | |
| 688 FunctionDeclaration declaration = (declarations3[0] as FunctionDeclaration); | |
| 689 JUnitTestCase.assertNotNull(declaration); | |
| 690 } | |
| 691 static dartSuite() { | |
| 692 _ut.group('RecoveryParserTest', () { | |
| 693 _ut.test('test_additiveExpression_missing_LHS', () { | |
| 694 final __test = new RecoveryParserTest(); | |
| 695 runJUnitTest(__test, __test.test_additiveExpression_missing_LHS); | |
| 696 }); | |
| 697 _ut.test('test_additiveExpression_missing_LHS_RHS', () { | |
| 698 final __test = new RecoveryParserTest(); | |
| 699 runJUnitTest(__test, __test.test_additiveExpression_missing_LHS_RHS); | |
| 700 }); | |
| 701 _ut.test('test_additiveExpression_missing_RHS', () { | |
| 702 final __test = new RecoveryParserTest(); | |
| 703 runJUnitTest(__test, __test.test_additiveExpression_missing_RHS); | |
| 704 }); | |
| 705 _ut.test('test_additiveExpression_missing_RHS_super', () { | |
| 706 final __test = new RecoveryParserTest(); | |
| 707 runJUnitTest(__test, __test.test_additiveExpression_missing_RHS_super); | |
| 708 }); | |
| 709 _ut.test('test_additiveExpression_precedence_multiplicative_left', () { | |
| 710 final __test = new RecoveryParserTest(); | |
| 711 runJUnitTest(__test, __test.test_additiveExpression_precedence_multiplic
ative_left); | |
| 712 }); | |
| 713 _ut.test('test_additiveExpression_precedence_multiplicative_right', () { | |
| 714 final __test = new RecoveryParserTest(); | |
| 715 runJUnitTest(__test, __test.test_additiveExpression_precedence_multiplic
ative_right); | |
| 716 }); | |
| 717 _ut.test('test_additiveExpression_super', () { | |
| 718 final __test = new RecoveryParserTest(); | |
| 719 runJUnitTest(__test, __test.test_additiveExpression_super); | |
| 720 }); | |
| 721 _ut.test('test_argumentDefinitionTest_missing_identifier', () { | |
| 722 final __test = new RecoveryParserTest(); | |
| 723 runJUnitTest(__test, __test.test_argumentDefinitionTest_missing_identifi
er); | |
| 724 }); | |
| 725 _ut.test('test_assignmentExpression_missing_LHS', () { | |
| 726 final __test = new RecoveryParserTest(); | |
| 727 runJUnitTest(__test, __test.test_assignmentExpression_missing_LHS); | |
| 728 }); | |
| 729 _ut.test('test_assignmentExpression_missing_RHS', () { | |
| 730 final __test = new RecoveryParserTest(); | |
| 731 runJUnitTest(__test, __test.test_assignmentExpression_missing_RHS); | |
| 732 }); | |
| 733 _ut.test('test_assignmentExpression_missing_compound1', () { | |
| 734 final __test = new RecoveryParserTest(); | |
| 735 runJUnitTest(__test, __test.test_assignmentExpression_missing_compound1)
; | |
| 736 }); | |
| 737 _ut.test('test_assignmentExpression_missing_compound2', () { | |
| 738 final __test = new RecoveryParserTest(); | |
| 739 runJUnitTest(__test, __test.test_assignmentExpression_missing_compound2)
; | |
| 740 }); | |
| 741 _ut.test('test_assignmentExpression_missing_compound3', () { | |
| 742 final __test = new RecoveryParserTest(); | |
| 743 runJUnitTest(__test, __test.test_assignmentExpression_missing_compound3)
; | |
| 744 }); | |
| 745 _ut.test('test_bitwiseAndExpression_missing_LHS', () { | |
| 746 final __test = new RecoveryParserTest(); | |
| 747 runJUnitTest(__test, __test.test_bitwiseAndExpression_missing_LHS); | |
| 748 }); | |
| 749 _ut.test('test_bitwiseAndExpression_missing_LHS_RHS', () { | |
| 750 final __test = new RecoveryParserTest(); | |
| 751 runJUnitTest(__test, __test.test_bitwiseAndExpression_missing_LHS_RHS); | |
| 752 }); | |
| 753 _ut.test('test_bitwiseAndExpression_missing_RHS', () { | |
| 754 final __test = new RecoveryParserTest(); | |
| 755 runJUnitTest(__test, __test.test_bitwiseAndExpression_missing_RHS); | |
| 756 }); | |
| 757 _ut.test('test_bitwiseAndExpression_missing_RHS_super', () { | |
| 758 final __test = new RecoveryParserTest(); | |
| 759 runJUnitTest(__test, __test.test_bitwiseAndExpression_missing_RHS_super)
; | |
| 760 }); | |
| 761 _ut.test('test_bitwiseAndExpression_precedence_equality_left', () { | |
| 762 final __test = new RecoveryParserTest(); | |
| 763 runJUnitTest(__test, __test.test_bitwiseAndExpression_precedence_equalit
y_left); | |
| 764 }); | |
| 765 _ut.test('test_bitwiseAndExpression_precedence_equality_right', () { | |
| 766 final __test = new RecoveryParserTest(); | |
| 767 runJUnitTest(__test, __test.test_bitwiseAndExpression_precedence_equalit
y_right); | |
| 768 }); | |
| 769 _ut.test('test_bitwiseAndExpression_super', () { | |
| 770 final __test = new RecoveryParserTest(); | |
| 771 runJUnitTest(__test, __test.test_bitwiseAndExpression_super); | |
| 772 }); | |
| 773 _ut.test('test_bitwiseOrExpression_missing_LHS', () { | |
| 774 final __test = new RecoveryParserTest(); | |
| 775 runJUnitTest(__test, __test.test_bitwiseOrExpression_missing_LHS); | |
| 776 }); | |
| 777 _ut.test('test_bitwiseOrExpression_missing_LHS_RHS', () { | |
| 778 final __test = new RecoveryParserTest(); | |
| 779 runJUnitTest(__test, __test.test_bitwiseOrExpression_missing_LHS_RHS); | |
| 780 }); | |
| 781 _ut.test('test_bitwiseOrExpression_missing_RHS', () { | |
| 782 final __test = new RecoveryParserTest(); | |
| 783 runJUnitTest(__test, __test.test_bitwiseOrExpression_missing_RHS); | |
| 784 }); | |
| 785 _ut.test('test_bitwiseOrExpression_missing_RHS_super', () { | |
| 786 final __test = new RecoveryParserTest(); | |
| 787 runJUnitTest(__test, __test.test_bitwiseOrExpression_missing_RHS_super); | |
| 788 }); | |
| 789 _ut.test('test_bitwiseOrExpression_precedence_xor_left', () { | |
| 790 final __test = new RecoveryParserTest(); | |
| 791 runJUnitTest(__test, __test.test_bitwiseOrExpression_precedence_xor_left
); | |
| 792 }); | |
| 793 _ut.test('test_bitwiseOrExpression_precedence_xor_right', () { | |
| 794 final __test = new RecoveryParserTest(); | |
| 795 runJUnitTest(__test, __test.test_bitwiseOrExpression_precedence_xor_righ
t); | |
| 796 }); | |
| 797 _ut.test('test_bitwiseOrExpression_super', () { | |
| 798 final __test = new RecoveryParserTest(); | |
| 799 runJUnitTest(__test, __test.test_bitwiseOrExpression_super); | |
| 800 }); | |
| 801 _ut.test('test_bitwiseXorExpression_missing_LHS', () { | |
| 802 final __test = new RecoveryParserTest(); | |
| 803 runJUnitTest(__test, __test.test_bitwiseXorExpression_missing_LHS); | |
| 804 }); | |
| 805 _ut.test('test_bitwiseXorExpression_missing_LHS_RHS', () { | |
| 806 final __test = new RecoveryParserTest(); | |
| 807 runJUnitTest(__test, __test.test_bitwiseXorExpression_missing_LHS_RHS); | |
| 808 }); | |
| 809 _ut.test('test_bitwiseXorExpression_missing_RHS', () { | |
| 810 final __test = new RecoveryParserTest(); | |
| 811 runJUnitTest(__test, __test.test_bitwiseXorExpression_missing_RHS); | |
| 812 }); | |
| 813 _ut.test('test_bitwiseXorExpression_missing_RHS_super', () { | |
| 814 final __test = new RecoveryParserTest(); | |
| 815 runJUnitTest(__test, __test.test_bitwiseXorExpression_missing_RHS_super)
; | |
| 816 }); | |
| 817 _ut.test('test_bitwiseXorExpression_precedence_and_left', () { | |
| 818 final __test = new RecoveryParserTest(); | |
| 819 runJUnitTest(__test, __test.test_bitwiseXorExpression_precedence_and_lef
t); | |
| 820 }); | |
| 821 _ut.test('test_bitwiseXorExpression_precedence_and_right', () { | |
| 822 final __test = new RecoveryParserTest(); | |
| 823 runJUnitTest(__test, __test.test_bitwiseXorExpression_precedence_and_rig
ht); | |
| 824 }); | |
| 825 _ut.test('test_bitwiseXorExpression_super', () { | |
| 826 final __test = new RecoveryParserTest(); | |
| 827 runJUnitTest(__test, __test.test_bitwiseXorExpression_super); | |
| 828 }); | |
| 829 _ut.test('test_conditionalExpression_missingElse', () { | |
| 830 final __test = new RecoveryParserTest(); | |
| 831 runJUnitTest(__test, __test.test_conditionalExpression_missingElse); | |
| 832 }); | |
| 833 _ut.test('test_conditionalExpression_missingThen', () { | |
| 834 final __test = new RecoveryParserTest(); | |
| 835 runJUnitTest(__test, __test.test_conditionalExpression_missingThen); | |
| 836 }); | |
| 837 _ut.test('test_equalityExpression_missing_LHS', () { | |
| 838 final __test = new RecoveryParserTest(); | |
| 839 runJUnitTest(__test, __test.test_equalityExpression_missing_LHS); | |
| 840 }); | |
| 841 _ut.test('test_equalityExpression_missing_LHS_RHS', () { | |
| 842 final __test = new RecoveryParserTest(); | |
| 843 runJUnitTest(__test, __test.test_equalityExpression_missing_LHS_RHS); | |
| 844 }); | |
| 845 _ut.test('test_equalityExpression_missing_RHS', () { | |
| 846 final __test = new RecoveryParserTest(); | |
| 847 runJUnitTest(__test, __test.test_equalityExpression_missing_RHS); | |
| 848 }); | |
| 849 _ut.test('test_equalityExpression_missing_RHS_super', () { | |
| 850 final __test = new RecoveryParserTest(); | |
| 851 runJUnitTest(__test, __test.test_equalityExpression_missing_RHS_super); | |
| 852 }); | |
| 853 _ut.test('test_equalityExpression_precedence_relational_left', () { | |
| 854 final __test = new RecoveryParserTest(); | |
| 855 runJUnitTest(__test, __test.test_equalityExpression_precedence_relationa
l_left); | |
| 856 }); | |
| 857 _ut.test('test_equalityExpression_precedence_relational_right', () { | |
| 858 final __test = new RecoveryParserTest(); | |
| 859 runJUnitTest(__test, __test.test_equalityExpression_precedence_relationa
l_right); | |
| 860 }); | |
| 861 _ut.test('test_equalityExpression_super', () { | |
| 862 final __test = new RecoveryParserTest(); | |
| 863 runJUnitTest(__test, __test.test_equalityExpression_super); | |
| 864 }); | |
| 865 _ut.test('test_expressionList_multiple_end', () { | |
| 866 final __test = new RecoveryParserTest(); | |
| 867 runJUnitTest(__test, __test.test_expressionList_multiple_end); | |
| 868 }); | |
| 869 _ut.test('test_expressionList_multiple_middle', () { | |
| 870 final __test = new RecoveryParserTest(); | |
| 871 runJUnitTest(__test, __test.test_expressionList_multiple_middle); | |
| 872 }); | |
| 873 _ut.test('test_expressionList_multiple_start', () { | |
| 874 final __test = new RecoveryParserTest(); | |
| 875 runJUnitTest(__test, __test.test_expressionList_multiple_start); | |
| 876 }); | |
| 877 _ut.test('test_logicalAndExpression_missing_LHS', () { | |
| 878 final __test = new RecoveryParserTest(); | |
| 879 runJUnitTest(__test, __test.test_logicalAndExpression_missing_LHS); | |
| 880 }); | |
| 881 _ut.test('test_logicalAndExpression_missing_LHS_RHS', () { | |
| 882 final __test = new RecoveryParserTest(); | |
| 883 runJUnitTest(__test, __test.test_logicalAndExpression_missing_LHS_RHS); | |
| 884 }); | |
| 885 _ut.test('test_logicalAndExpression_missing_RHS', () { | |
| 886 final __test = new RecoveryParserTest(); | |
| 887 runJUnitTest(__test, __test.test_logicalAndExpression_missing_RHS); | |
| 888 }); | |
| 889 _ut.test('test_logicalAndExpression_precedence_bitwiseOr_left', () { | |
| 890 final __test = new RecoveryParserTest(); | |
| 891 runJUnitTest(__test, __test.test_logicalAndExpression_precedence_bitwise
Or_left); | |
| 892 }); | |
| 893 _ut.test('test_logicalAndExpression_precedence_bitwiseOr_right', () { | |
| 894 final __test = new RecoveryParserTest(); | |
| 895 runJUnitTest(__test, __test.test_logicalAndExpression_precedence_bitwise
Or_right); | |
| 896 }); | |
| 897 _ut.test('test_logicalOrExpression_missing_LHS', () { | |
| 898 final __test = new RecoveryParserTest(); | |
| 899 runJUnitTest(__test, __test.test_logicalOrExpression_missing_LHS); | |
| 900 }); | |
| 901 _ut.test('test_logicalOrExpression_missing_LHS_RHS', () { | |
| 902 final __test = new RecoveryParserTest(); | |
| 903 runJUnitTest(__test, __test.test_logicalOrExpression_missing_LHS_RHS); | |
| 904 }); | |
| 905 _ut.test('test_logicalOrExpression_missing_RHS', () { | |
| 906 final __test = new RecoveryParserTest(); | |
| 907 runJUnitTest(__test, __test.test_logicalOrExpression_missing_RHS); | |
| 908 }); | |
| 909 _ut.test('test_logicalOrExpression_precedence_logicalAnd_left', () { | |
| 910 final __test = new RecoveryParserTest(); | |
| 911 runJUnitTest(__test, __test.test_logicalOrExpression_precedence_logicalA
nd_left); | |
| 912 }); | |
| 913 _ut.test('test_logicalOrExpression_precedence_logicalAnd_right', () { | |
| 914 final __test = new RecoveryParserTest(); | |
| 915 runJUnitTest(__test, __test.test_logicalOrExpression_precedence_logicalA
nd_right); | |
| 916 }); | |
| 917 _ut.test('test_multiplicativeExpression_missing_LHS', () { | |
| 918 final __test = new RecoveryParserTest(); | |
| 919 runJUnitTest(__test, __test.test_multiplicativeExpression_missing_LHS); | |
| 920 }); | |
| 921 _ut.test('test_multiplicativeExpression_missing_LHS_RHS', () { | |
| 922 final __test = new RecoveryParserTest(); | |
| 923 runJUnitTest(__test, __test.test_multiplicativeExpression_missing_LHS_RH
S); | |
| 924 }); | |
| 925 _ut.test('test_multiplicativeExpression_missing_RHS', () { | |
| 926 final __test = new RecoveryParserTest(); | |
| 927 runJUnitTest(__test, __test.test_multiplicativeExpression_missing_RHS); | |
| 928 }); | |
| 929 _ut.test('test_multiplicativeExpression_missing_RHS_super', () { | |
| 930 final __test = new RecoveryParserTest(); | |
| 931 runJUnitTest(__test, __test.test_multiplicativeExpression_missing_RHS_su
per); | |
| 932 }); | |
| 933 _ut.test('test_multiplicativeExpression_precedence_unary_left', () { | |
| 934 final __test = new RecoveryParserTest(); | |
| 935 runJUnitTest(__test, __test.test_multiplicativeExpression_precedence_una
ry_left); | |
| 936 }); | |
| 937 _ut.test('test_multiplicativeExpression_precedence_unary_right', () { | |
| 938 final __test = new RecoveryParserTest(); | |
| 939 runJUnitTest(__test, __test.test_multiplicativeExpression_precedence_una
ry_right); | |
| 940 }); | |
| 941 _ut.test('test_multiplicativeExpression_super', () { | |
| 942 final __test = new RecoveryParserTest(); | |
| 943 runJUnitTest(__test, __test.test_multiplicativeExpression_super); | |
| 944 }); | |
| 945 _ut.test('test_prefixExpression_missing_operand_minus', () { | |
| 946 final __test = new RecoveryParserTest(); | |
| 947 runJUnitTest(__test, __test.test_prefixExpression_missing_operand_minus)
; | |
| 948 }); | |
| 949 _ut.test('test_relationalExpression_missing_LHS', () { | |
| 950 final __test = new RecoveryParserTest(); | |
| 951 runJUnitTest(__test, __test.test_relationalExpression_missing_LHS); | |
| 952 }); | |
| 953 _ut.test('test_relationalExpression_missing_LHS_RHS', () { | |
| 954 final __test = new RecoveryParserTest(); | |
| 955 runJUnitTest(__test, __test.test_relationalExpression_missing_LHS_RHS); | |
| 956 }); | |
| 957 _ut.test('test_relationalExpression_missing_RHS', () { | |
| 958 final __test = new RecoveryParserTest(); | |
| 959 runJUnitTest(__test, __test.test_relationalExpression_missing_RHS); | |
| 960 }); | |
| 961 _ut.test('test_relationalExpression_precedence_shift_right', () { | |
| 962 final __test = new RecoveryParserTest(); | |
| 963 runJUnitTest(__test, __test.test_relationalExpression_precedence_shift_r
ight); | |
| 964 }); | |
| 965 _ut.test('test_shiftExpression_missing_LHS', () { | |
| 966 final __test = new RecoveryParserTest(); | |
| 967 runJUnitTest(__test, __test.test_shiftExpression_missing_LHS); | |
| 968 }); | |
| 969 _ut.test('test_shiftExpression_missing_LHS_RHS', () { | |
| 970 final __test = new RecoveryParserTest(); | |
| 971 runJUnitTest(__test, __test.test_shiftExpression_missing_LHS_RHS); | |
| 972 }); | |
| 973 _ut.test('test_shiftExpression_missing_RHS', () { | |
| 974 final __test = new RecoveryParserTest(); | |
| 975 runJUnitTest(__test, __test.test_shiftExpression_missing_RHS); | |
| 976 }); | |
| 977 _ut.test('test_shiftExpression_missing_RHS_super', () { | |
| 978 final __test = new RecoveryParserTest(); | |
| 979 runJUnitTest(__test, __test.test_shiftExpression_missing_RHS_super); | |
| 980 }); | |
| 981 _ut.test('test_shiftExpression_precedence_unary_left', () { | |
| 982 final __test = new RecoveryParserTest(); | |
| 983 runJUnitTest(__test, __test.test_shiftExpression_precedence_unary_left); | |
| 984 }); | |
| 985 _ut.test('test_shiftExpression_precedence_unary_right', () { | |
| 986 final __test = new RecoveryParserTest(); | |
| 987 runJUnitTest(__test, __test.test_shiftExpression_precedence_unary_right)
; | |
| 988 }); | |
| 989 _ut.test('test_shiftExpression_super', () { | |
| 990 final __test = new RecoveryParserTest(); | |
| 991 runJUnitTest(__test, __test.test_shiftExpression_super); | |
| 992 }); | |
| 993 _ut.test('test_topLevelExternalFunction_extraSemicolon', () { | |
| 994 final __test = new RecoveryParserTest(); | |
| 995 runJUnitTest(__test, __test.test_topLevelExternalFunction_extraSemicolon
); | |
| 996 }); | |
| 997 }); | |
| 998 } | |
| 999 } | |
| 1000 /** | 20 /** |
| 1001 * The class {@code SimpleParserTest} defines parser tests that test individual
parsing method. The | 21 * The class {@code SimpleParserTest} defines parser tests that test individual
parsing method. The |
| 1002 * code fragments should be as minimal as possible in order to test the method,
but should not test | 22 * code fragments should be as minimal as possible in order to test the method,
but should not test |
| 1003 * the interactions between the method under test and other methods. | 23 * the interactions between the method under test and other methods. |
| 1004 * <p> | 24 * <p> |
| 1005 * More complex tests should be defined in the class {@link ComplexParserTest}. | 25 * More complex tests should be defined in the class {@link ComplexParserTest}. |
| 1006 */ | 26 */ |
| 1007 class SimpleParserTest extends ParserTestCase { | 27 class SimpleParserTest extends ParserTestCase { |
| 1008 void fail_parseCommentReference_this() { | 28 void fail_parseCommentReference_this() { |
| 1009 CommentReference reference = ParserTestCase.parse("parseCommentReference", <
Object> ["this", 5], ""); | 29 CommentReference reference = ParserTestCase.parse("parseCommentReference", <
Object> ["this", 5], ""); |
| 1010 SimpleIdentifier identifier13 = EngineTestCase.assertInstanceOf(SimpleIdenti
fier, reference.identifier); | 30 SimpleIdentifier identifier18 = EngineTestCase.assertInstanceOf(SimpleIdenti
fier, reference.identifier); |
| 1011 JUnitTestCase.assertNotNull(identifier13.token); | 31 JUnitTestCase.assertNotNull(identifier18.token); |
| 1012 JUnitTestCase.assertEquals("a", identifier13.name); | 32 JUnitTestCase.assertEquals("a", identifier18.name); |
| 1013 JUnitTestCase.assertEquals(5, identifier13.offset); | 33 JUnitTestCase.assertEquals(5, identifier18.offset); |
| 1014 } | 34 } |
| 1015 void test_computeStringValue_emptyInterpolationPrefix() { | 35 void test_computeStringValue_emptyInterpolationPrefix() { |
| 1016 JUnitTestCase.assertEquals("", computeStringValue("'''")); | 36 JUnitTestCase.assertEquals("", computeStringValue("'''")); |
| 1017 } | 37 } |
| 1018 void test_computeStringValue_escape_b() { | 38 void test_computeStringValue_escape_b() { |
| 1019 JUnitTestCase.assertEquals("\b", computeStringValue("'\\b'")); | 39 JUnitTestCase.assertEquals("\b", computeStringValue("'\\b'")); |
| 1020 } | 40 } |
| 1021 void test_computeStringValue_escape_f() { | 41 void test_computeStringValue_escape_f() { |
| 1022 JUnitTestCase.assertEquals("\f", computeStringValue("'\\f'")); | 42 JUnitTestCase.assertEquals("\f", computeStringValue("'\\f'")); |
| 1023 } | 43 } |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1173 void test_isSwitchMember_default_labeled() { | 193 void test_isSwitchMember_default_labeled() { |
| 1174 JUnitTestCase.assertTrue(isSwitchMember("l1: l2: default")); | 194 JUnitTestCase.assertTrue(isSwitchMember("l1: l2: default")); |
| 1175 } | 195 } |
| 1176 void test_isSwitchMember_default_unlabeled() { | 196 void test_isSwitchMember_default_unlabeled() { |
| 1177 JUnitTestCase.assertTrue(isSwitchMember("default")); | 197 JUnitTestCase.assertTrue(isSwitchMember("default")); |
| 1178 } | 198 } |
| 1179 void test_isSwitchMember_false() { | 199 void test_isSwitchMember_false() { |
| 1180 JUnitTestCase.assertFalse(isSwitchMember("break;")); | 200 JUnitTestCase.assertFalse(isSwitchMember("break;")); |
| 1181 } | 201 } |
| 1182 void test_parseAdditiveExpression_normal() { | 202 void test_parseAdditiveExpression_normal() { |
| 1183 BinaryExpression expression = ParserTestCase.parse5("parseAdditiveExpression
", "x + y", []); | 203 BinaryExpression expression = ParserTestCase.parse6("parseAdditiveExpression
", "x + y", []); |
| 1184 JUnitTestCase.assertNotNull(expression.leftOperand); | 204 JUnitTestCase.assertNotNull(expression.leftOperand); |
| 1185 JUnitTestCase.assertNotNull(expression.operator); | 205 JUnitTestCase.assertNotNull(expression.operator); |
| 1186 JUnitTestCase.assertEquals(TokenType.PLUS, expression.operator.type); | 206 JUnitTestCase.assertEquals(TokenType.PLUS, expression.operator.type); |
| 1187 JUnitTestCase.assertNotNull(expression.rightOperand); | 207 JUnitTestCase.assertNotNull(expression.rightOperand); |
| 1188 } | 208 } |
| 1189 void test_parseAdditiveExpression_super() { | 209 void test_parseAdditiveExpression_super() { |
| 1190 BinaryExpression expression = ParserTestCase.parse5("parseAdditiveExpression
", "super + y", []); | 210 BinaryExpression expression = ParserTestCase.parse6("parseAdditiveExpression
", "super + y", []); |
| 1191 EngineTestCase.assertInstanceOf(SuperExpression, expression.leftOperand); | 211 EngineTestCase.assertInstanceOf(SuperExpression, expression.leftOperand); |
| 1192 JUnitTestCase.assertNotNull(expression.operator); | 212 JUnitTestCase.assertNotNull(expression.operator); |
| 1193 JUnitTestCase.assertEquals(TokenType.PLUS, expression.operator.type); | 213 JUnitTestCase.assertEquals(TokenType.PLUS, expression.operator.type); |
| 1194 JUnitTestCase.assertNotNull(expression.rightOperand); | 214 JUnitTestCase.assertNotNull(expression.rightOperand); |
| 1195 } | 215 } |
| 1196 void test_parseAnnotation_n1() { | 216 void test_parseAnnotation_n1() { |
| 1197 Annotation annotation = ParserTestCase.parse5("parseAnnotation", "@A", []); | 217 Annotation annotation = ParserTestCase.parse6("parseAnnotation", "@A", []); |
| 1198 JUnitTestCase.assertNotNull(annotation.atSign); | 218 JUnitTestCase.assertNotNull(annotation.atSign); |
| 1199 JUnitTestCase.assertNotNull(annotation.name); | 219 JUnitTestCase.assertNotNull(annotation.name); |
| 1200 JUnitTestCase.assertNull(annotation.period); | 220 JUnitTestCase.assertNull(annotation.period); |
| 1201 JUnitTestCase.assertNull(annotation.constructorName); | 221 JUnitTestCase.assertNull(annotation.constructorName); |
| 1202 JUnitTestCase.assertNull(annotation.arguments); | 222 JUnitTestCase.assertNull(annotation.arguments); |
| 1203 } | 223 } |
| 1204 void test_parseAnnotation_n1_a() { | 224 void test_parseAnnotation_n1_a() { |
| 1205 Annotation annotation = ParserTestCase.parse5("parseAnnotation", "@A(x,y)",
[]); | 225 Annotation annotation = ParserTestCase.parse6("parseAnnotation", "@A(x,y)",
[]); |
| 1206 JUnitTestCase.assertNotNull(annotation.atSign); | 226 JUnitTestCase.assertNotNull(annotation.atSign); |
| 1207 JUnitTestCase.assertNotNull(annotation.name); | 227 JUnitTestCase.assertNotNull(annotation.name); |
| 1208 JUnitTestCase.assertNull(annotation.period); | 228 JUnitTestCase.assertNull(annotation.period); |
| 1209 JUnitTestCase.assertNull(annotation.constructorName); | 229 JUnitTestCase.assertNull(annotation.constructorName); |
| 1210 JUnitTestCase.assertNotNull(annotation.arguments); | 230 JUnitTestCase.assertNotNull(annotation.arguments); |
| 1211 } | 231 } |
| 1212 void test_parseAnnotation_n2() { | 232 void test_parseAnnotation_n2() { |
| 1213 Annotation annotation = ParserTestCase.parse5("parseAnnotation", "@A.B", [])
; | 233 Annotation annotation = ParserTestCase.parse6("parseAnnotation", "@A.B", [])
; |
| 1214 JUnitTestCase.assertNotNull(annotation.atSign); | 234 JUnitTestCase.assertNotNull(annotation.atSign); |
| 1215 JUnitTestCase.assertNotNull(annotation.name); | 235 JUnitTestCase.assertNotNull(annotation.name); |
| 1216 JUnitTestCase.assertNull(annotation.period); | 236 JUnitTestCase.assertNull(annotation.period); |
| 1217 JUnitTestCase.assertNull(annotation.constructorName); | 237 JUnitTestCase.assertNull(annotation.constructorName); |
| 1218 JUnitTestCase.assertNull(annotation.arguments); | 238 JUnitTestCase.assertNull(annotation.arguments); |
| 1219 } | 239 } |
| 1220 void test_parseAnnotation_n2_a() { | 240 void test_parseAnnotation_n2_a() { |
| 1221 Annotation annotation = ParserTestCase.parse5("parseAnnotation", "@A.B(x,y)"
, []); | 241 Annotation annotation = ParserTestCase.parse6("parseAnnotation", "@A.B(x,y)"
, []); |
| 1222 JUnitTestCase.assertNotNull(annotation.atSign); | 242 JUnitTestCase.assertNotNull(annotation.atSign); |
| 1223 JUnitTestCase.assertNotNull(annotation.name); | 243 JUnitTestCase.assertNotNull(annotation.name); |
| 1224 JUnitTestCase.assertNull(annotation.period); | 244 JUnitTestCase.assertNull(annotation.period); |
| 1225 JUnitTestCase.assertNull(annotation.constructorName); | 245 JUnitTestCase.assertNull(annotation.constructorName); |
| 1226 JUnitTestCase.assertNotNull(annotation.arguments); | 246 JUnitTestCase.assertNotNull(annotation.arguments); |
| 1227 } | 247 } |
| 1228 void test_parseAnnotation_n3() { | 248 void test_parseAnnotation_n3() { |
| 1229 Annotation annotation = ParserTestCase.parse5("parseAnnotation", "@A.B.C", [
]); | 249 Annotation annotation = ParserTestCase.parse6("parseAnnotation", "@A.B.C", [
]); |
| 1230 JUnitTestCase.assertNotNull(annotation.atSign); | 250 JUnitTestCase.assertNotNull(annotation.atSign); |
| 1231 JUnitTestCase.assertNotNull(annotation.name); | 251 JUnitTestCase.assertNotNull(annotation.name); |
| 1232 JUnitTestCase.assertNotNull(annotation.period); | 252 JUnitTestCase.assertNotNull(annotation.period); |
| 1233 JUnitTestCase.assertNotNull(annotation.constructorName); | 253 JUnitTestCase.assertNotNull(annotation.constructorName); |
| 1234 JUnitTestCase.assertNull(annotation.arguments); | 254 JUnitTestCase.assertNull(annotation.arguments); |
| 1235 } | 255 } |
| 1236 void test_parseAnnotation_n3_a() { | 256 void test_parseAnnotation_n3_a() { |
| 1237 Annotation annotation = ParserTestCase.parse5("parseAnnotation", "@A.B.C(x,y
)", []); | 257 Annotation annotation = ParserTestCase.parse6("parseAnnotation", "@A.B.C(x,y
)", []); |
| 1238 JUnitTestCase.assertNotNull(annotation.atSign); | 258 JUnitTestCase.assertNotNull(annotation.atSign); |
| 1239 JUnitTestCase.assertNotNull(annotation.name); | 259 JUnitTestCase.assertNotNull(annotation.name); |
| 1240 JUnitTestCase.assertNotNull(annotation.period); | 260 JUnitTestCase.assertNotNull(annotation.period); |
| 1241 JUnitTestCase.assertNotNull(annotation.constructorName); | 261 JUnitTestCase.assertNotNull(annotation.constructorName); |
| 1242 JUnitTestCase.assertNotNull(annotation.arguments); | 262 JUnitTestCase.assertNotNull(annotation.arguments); |
| 1243 } | 263 } |
| 1244 void test_parseArgument_named() { | 264 void test_parseArgument_named() { |
| 1245 NamedExpression expression = ParserTestCase.parse5("parseArgument", "n: x",
[]); | 265 NamedExpression expression = ParserTestCase.parse6("parseArgument", "n: x",
[]); |
| 1246 Label name20 = expression.name; | 266 Label name21 = expression.name; |
| 1247 JUnitTestCase.assertNotNull(name20); | 267 JUnitTestCase.assertNotNull(name21); |
| 1248 JUnitTestCase.assertNotNull(name20.label); | 268 JUnitTestCase.assertNotNull(name21.label); |
| 1249 JUnitTestCase.assertNotNull(name20.colon); | 269 JUnitTestCase.assertNotNull(name21.colon); |
| 1250 JUnitTestCase.assertNotNull(expression.expression); | 270 JUnitTestCase.assertNotNull(expression.expression); |
| 1251 } | 271 } |
| 1252 void test_parseArgument_unnamed() { | 272 void test_parseArgument_unnamed() { |
| 1253 String lexeme = "x"; | 273 String lexeme = "x"; |
| 1254 SimpleIdentifier identifier = ParserTestCase.parse5("parseArgument", lexeme,
[]); | 274 SimpleIdentifier identifier = ParserTestCase.parse6("parseArgument", lexeme,
[]); |
| 1255 JUnitTestCase.assertEquals(lexeme, identifier.name); | 275 JUnitTestCase.assertEquals(lexeme, identifier.name); |
| 1256 } | 276 } |
| 1257 void test_parseArgumentDefinitionTest() { | 277 void test_parseArgumentDefinitionTest() { |
| 1258 ArgumentDefinitionTest test = ParserTestCase.parse5("parseArgumentDefinition
Test", "?x", []); | 278 ArgumentDefinitionTest test = ParserTestCase.parse6("parseArgumentDefinition
Test", "?x", []); |
| 1259 JUnitTestCase.assertNotNull(test.question); | 279 JUnitTestCase.assertNotNull(test.question); |
| 1260 JUnitTestCase.assertNotNull(test.identifier); | 280 JUnitTestCase.assertNotNull(test.identifier); |
| 1261 } | 281 } |
| 1262 void test_parseArgumentList_empty() { | 282 void test_parseArgumentList_empty() { |
| 1263 ArgumentList argumentList = ParserTestCase.parse5("parseArgumentList", "()",
[]); | 283 ArgumentList argumentList = ParserTestCase.parse6("parseArgumentList", "()",
[]); |
| 1264 NodeList<Expression> arguments7 = argumentList.arguments; | 284 NodeList<Expression> arguments7 = argumentList.arguments; |
| 1265 EngineTestCase.assertSize(0, arguments7); | 285 EngineTestCase.assertSize(0, arguments7); |
| 1266 } | 286 } |
| 1267 void test_parseArgumentList_mixed() { | 287 void test_parseArgumentList_mixed() { |
| 1268 ArgumentList argumentList = ParserTestCase.parse5("parseArgumentList", "(w,
x, y: y, z: z)", []); | 288 ArgumentList argumentList = ParserTestCase.parse6("parseArgumentList", "(w,
x, y: y, z: z)", []); |
| 1269 NodeList<Expression> arguments8 = argumentList.arguments; | 289 NodeList<Expression> arguments8 = argumentList.arguments; |
| 1270 EngineTestCase.assertSize(4, arguments8); | 290 EngineTestCase.assertSize(4, arguments8); |
| 1271 } | 291 } |
| 1272 void test_parseArgumentList_noNamed() { | 292 void test_parseArgumentList_noNamed() { |
| 1273 ArgumentList argumentList = ParserTestCase.parse5("parseArgumentList", "(x,
y, z)", []); | 293 ArgumentList argumentList = ParserTestCase.parse6("parseArgumentList", "(x,
y, z)", []); |
| 1274 NodeList<Expression> arguments9 = argumentList.arguments; | 294 NodeList<Expression> arguments9 = argumentList.arguments; |
| 1275 EngineTestCase.assertSize(3, arguments9); | 295 EngineTestCase.assertSize(3, arguments9); |
| 1276 } | 296 } |
| 1277 void test_parseArgumentList_onlyNamed() { | 297 void test_parseArgumentList_onlyNamed() { |
| 1278 ArgumentList argumentList = ParserTestCase.parse5("parseArgumentList", "(x:
x, y: y)", []); | 298 ArgumentList argumentList = ParserTestCase.parse6("parseArgumentList", "(x:
x, y: y)", []); |
| 1279 NodeList<Expression> arguments10 = argumentList.arguments; | 299 NodeList<Expression> arguments10 = argumentList.arguments; |
| 1280 EngineTestCase.assertSize(2, arguments10); | 300 EngineTestCase.assertSize(2, arguments10); |
| 1281 } | 301 } |
| 1282 void test_parseAssertStatement() { | 302 void test_parseAssertStatement() { |
| 1283 AssertStatement statement = ParserTestCase.parse5("parseAssertStatement", "a
ssert (x);", []); | 303 AssertStatement statement = ParserTestCase.parse6("parseAssertStatement", "a
ssert (x);", []); |
| 1284 JUnitTestCase.assertNotNull(statement.keyword); | 304 JUnitTestCase.assertNotNull(statement.keyword); |
| 1285 JUnitTestCase.assertNotNull(statement.leftParenthesis); | 305 JUnitTestCase.assertNotNull(statement.leftParenthesis); |
| 1286 JUnitTestCase.assertNotNull(statement.condition); | 306 JUnitTestCase.assertNotNull(statement.condition); |
| 1287 JUnitTestCase.assertNotNull(statement.rightParenthesis); | 307 JUnitTestCase.assertNotNull(statement.rightParenthesis); |
| 1288 JUnitTestCase.assertNotNull(statement.semicolon); | 308 JUnitTestCase.assertNotNull(statement.semicolon); |
| 1289 } | 309 } |
| 1290 void test_parseAssignableExpression_expression_args_dot() { | 310 void test_parseAssignableExpression_expression_args_dot() { |
| 1291 PropertyAccess propertyAccess = ParserTestCase.parse("parseAssignableExpress
ion", <Object> [false], "(x)(y).z"); | 311 PropertyAccess propertyAccess = ParserTestCase.parse("parseAssignableExpress
ion", <Object> [false], "(x)(y).z"); |
| 1292 FunctionExpressionInvocation invocation = (propertyAccess.target as Function
ExpressionInvocation); | 312 FunctionExpressionInvocation invocation = propertyAccess.target as FunctionE
xpressionInvocation; |
| 1293 JUnitTestCase.assertNotNull(invocation.function); | 313 JUnitTestCase.assertNotNull(invocation.function); |
| 1294 ArgumentList argumentList13 = invocation.argumentList; | 314 ArgumentList argumentList12 = invocation.argumentList; |
| 1295 JUnitTestCase.assertNotNull(argumentList13); | 315 JUnitTestCase.assertNotNull(argumentList12); |
| 1296 EngineTestCase.assertSize(1, argumentList13.arguments); | 316 EngineTestCase.assertSize(1, argumentList12.arguments); |
| 1297 JUnitTestCase.assertNotNull(propertyAccess.operator); | 317 JUnitTestCase.assertNotNull(propertyAccess.operator); |
| 1298 JUnitTestCase.assertNotNull(propertyAccess.propertyName); | 318 JUnitTestCase.assertNotNull(propertyAccess.propertyName); |
| 1299 } | 319 } |
| 1300 void test_parseAssignableExpression_expression_dot() { | 320 void test_parseAssignableExpression_expression_dot() { |
| 1301 PropertyAccess propertyAccess = ParserTestCase.parse("parseAssignableExpress
ion", <Object> [false], "(x).y"); | 321 PropertyAccess propertyAccess = ParserTestCase.parse("parseAssignableExpress
ion", <Object> [false], "(x).y"); |
| 1302 JUnitTestCase.assertNotNull(propertyAccess.target); | 322 JUnitTestCase.assertNotNull(propertyAccess.target); |
| 1303 JUnitTestCase.assertNotNull(propertyAccess.operator); | 323 JUnitTestCase.assertNotNull(propertyAccess.operator); |
| 1304 JUnitTestCase.assertNotNull(propertyAccess.propertyName); | 324 JUnitTestCase.assertNotNull(propertyAccess.propertyName); |
| 1305 } | 325 } |
| 1306 void test_parseAssignableExpression_expression_index() { | 326 void test_parseAssignableExpression_expression_index() { |
| 1307 IndexExpression expression = ParserTestCase.parse("parseAssignableExpression
", <Object> [false], "(x)[y]"); | 327 IndexExpression expression = ParserTestCase.parse("parseAssignableExpression
", <Object> [false], "(x)[y]"); |
| 1308 JUnitTestCase.assertNotNull(expression.array); | 328 JUnitTestCase.assertNotNull(expression.array); |
| 1309 JUnitTestCase.assertNotNull(expression.leftBracket); | 329 JUnitTestCase.assertNotNull(expression.leftBracket); |
| 1310 JUnitTestCase.assertNotNull(expression.index); | 330 JUnitTestCase.assertNotNull(expression.index); |
| 1311 JUnitTestCase.assertNotNull(expression.rightBracket); | 331 JUnitTestCase.assertNotNull(expression.rightBracket); |
| 1312 } | 332 } |
| 1313 void test_parseAssignableExpression_identifier() { | 333 void test_parseAssignableExpression_identifier() { |
| 1314 SimpleIdentifier identifier = ParserTestCase.parse("parseAssignableExpressio
n", <Object> [false], "x"); | 334 SimpleIdentifier identifier = ParserTestCase.parse("parseAssignableExpressio
n", <Object> [false], "x"); |
| 1315 JUnitTestCase.assertNotNull(identifier); | 335 JUnitTestCase.assertNotNull(identifier); |
| 1316 } | 336 } |
| 1317 void test_parseAssignableExpression_identifier_args_dot() { | 337 void test_parseAssignableExpression_identifier_args_dot() { |
| 1318 PropertyAccess propertyAccess = ParserTestCase.parse("parseAssignableExpress
ion", <Object> [false], "x(y).z"); | 338 PropertyAccess propertyAccess = ParserTestCase.parse("parseAssignableExpress
ion", <Object> [false], "x(y).z"); |
| 1319 MethodInvocation invocation = (propertyAccess.target as MethodInvocation); | 339 MethodInvocation invocation = propertyAccess.target as MethodInvocation; |
| 1320 JUnitTestCase.assertEquals("x", invocation.methodName.name); | 340 JUnitTestCase.assertEquals("x", invocation.methodName.name); |
| 1321 ArgumentList argumentList14 = invocation.argumentList; | 341 ArgumentList argumentList13 = invocation.argumentList; |
| 1322 JUnitTestCase.assertNotNull(argumentList14); | 342 JUnitTestCase.assertNotNull(argumentList13); |
| 1323 EngineTestCase.assertSize(1, argumentList14.arguments); | 343 EngineTestCase.assertSize(1, argumentList13.arguments); |
| 1324 JUnitTestCase.assertNotNull(propertyAccess.operator); | 344 JUnitTestCase.assertNotNull(propertyAccess.operator); |
| 1325 JUnitTestCase.assertNotNull(propertyAccess.propertyName); | 345 JUnitTestCase.assertNotNull(propertyAccess.propertyName); |
| 1326 } | 346 } |
| 1327 void test_parseAssignableExpression_identifier_dot() { | 347 void test_parseAssignableExpression_identifier_dot() { |
| 1328 PropertyAccess propertyAccess = ParserTestCase.parse("parseAssignableExpress
ion", <Object> [false], "x.y"); | 348 PropertyAccess propertyAccess = ParserTestCase.parse("parseAssignableExpress
ion", <Object> [false], "x.y"); |
| 1329 JUnitTestCase.assertNotNull(propertyAccess.target); | 349 JUnitTestCase.assertNotNull(propertyAccess.target); |
| 1330 JUnitTestCase.assertNotNull(propertyAccess.operator); | 350 JUnitTestCase.assertNotNull(propertyAccess.operator); |
| 1331 JUnitTestCase.assertNotNull(propertyAccess.propertyName); | 351 JUnitTestCase.assertNotNull(propertyAccess.propertyName); |
| 1332 } | 352 } |
| 1333 void test_parseAssignableExpression_identifier_index() { | 353 void test_parseAssignableExpression_identifier_index() { |
| (...skipping 25 matching lines...) Expand all Loading... |
| 1359 IndexExpression selector = ParserTestCase.parse("parseAssignableSelector", <
Object> [null, true], "[x]"); | 379 IndexExpression selector = ParserTestCase.parse("parseAssignableSelector", <
Object> [null, true], "[x]"); |
| 1360 JUnitTestCase.assertNotNull(selector.leftBracket); | 380 JUnitTestCase.assertNotNull(selector.leftBracket); |
| 1361 JUnitTestCase.assertNotNull(selector.index); | 381 JUnitTestCase.assertNotNull(selector.index); |
| 1362 JUnitTestCase.assertNotNull(selector.rightBracket); | 382 JUnitTestCase.assertNotNull(selector.rightBracket); |
| 1363 } | 383 } |
| 1364 void test_parseAssignableSelector_none() { | 384 void test_parseAssignableSelector_none() { |
| 1365 SimpleIdentifier selector = ParserTestCase.parse("parseAssignableSelector",
<Object> [new SimpleIdentifier.full(null), true], ";"); | 385 SimpleIdentifier selector = ParserTestCase.parse("parseAssignableSelector",
<Object> [new SimpleIdentifier.full(null), true], ";"); |
| 1366 JUnitTestCase.assertNotNull(selector); | 386 JUnitTestCase.assertNotNull(selector); |
| 1367 } | 387 } |
| 1368 void test_parseBitwiseAndExpression_normal() { | 388 void test_parseBitwiseAndExpression_normal() { |
| 1369 BinaryExpression expression = ParserTestCase.parse5("parseBitwiseAndExpressi
on", "x & y", []); | 389 BinaryExpression expression = ParserTestCase.parse6("parseBitwiseAndExpressi
on", "x & y", []); |
| 1370 JUnitTestCase.assertNotNull(expression.leftOperand); | 390 JUnitTestCase.assertNotNull(expression.leftOperand); |
| 1371 JUnitTestCase.assertNotNull(expression.operator); | 391 JUnitTestCase.assertNotNull(expression.operator); |
| 1372 JUnitTestCase.assertEquals(TokenType.AMPERSAND, expression.operator.type); | 392 JUnitTestCase.assertEquals(TokenType.AMPERSAND, expression.operator.type); |
| 1373 JUnitTestCase.assertNotNull(expression.rightOperand); | 393 JUnitTestCase.assertNotNull(expression.rightOperand); |
| 1374 } | 394 } |
| 1375 void test_parseBitwiseAndExpression_super() { | 395 void test_parseBitwiseAndExpression_super() { |
| 1376 BinaryExpression expression = ParserTestCase.parse5("parseBitwiseAndExpressi
on", "super & y", []); | 396 BinaryExpression expression = ParserTestCase.parse6("parseBitwiseAndExpressi
on", "super & y", []); |
| 1377 EngineTestCase.assertInstanceOf(SuperExpression, expression.leftOperand); | 397 EngineTestCase.assertInstanceOf(SuperExpression, expression.leftOperand); |
| 1378 JUnitTestCase.assertNotNull(expression.operator); | 398 JUnitTestCase.assertNotNull(expression.operator); |
| 1379 JUnitTestCase.assertEquals(TokenType.AMPERSAND, expression.operator.type); | 399 JUnitTestCase.assertEquals(TokenType.AMPERSAND, expression.operator.type); |
| 1380 JUnitTestCase.assertNotNull(expression.rightOperand); | 400 JUnitTestCase.assertNotNull(expression.rightOperand); |
| 1381 } | 401 } |
| 1382 void test_parseBitwiseOrExpression_normal() { | 402 void test_parseBitwiseOrExpression_normal() { |
| 1383 BinaryExpression expression = ParserTestCase.parse5("parseBitwiseOrExpressio
n", "x | y", []); | 403 BinaryExpression expression = ParserTestCase.parse6("parseBitwiseOrExpressio
n", "x | y", []); |
| 1384 JUnitTestCase.assertNotNull(expression.leftOperand); | 404 JUnitTestCase.assertNotNull(expression.leftOperand); |
| 1385 JUnitTestCase.assertNotNull(expression.operator); | 405 JUnitTestCase.assertNotNull(expression.operator); |
| 1386 JUnitTestCase.assertEquals(TokenType.BAR, expression.operator.type); | 406 JUnitTestCase.assertEquals(TokenType.BAR, expression.operator.type); |
| 1387 JUnitTestCase.assertNotNull(expression.rightOperand); | 407 JUnitTestCase.assertNotNull(expression.rightOperand); |
| 1388 } | 408 } |
| 1389 void test_parseBitwiseOrExpression_super() { | 409 void test_parseBitwiseOrExpression_super() { |
| 1390 BinaryExpression expression = ParserTestCase.parse5("parseBitwiseOrExpressio
n", "super | y", []); | 410 BinaryExpression expression = ParserTestCase.parse6("parseBitwiseOrExpressio
n", "super | y", []); |
| 1391 EngineTestCase.assertInstanceOf(SuperExpression, expression.leftOperand); | 411 EngineTestCase.assertInstanceOf(SuperExpression, expression.leftOperand); |
| 1392 JUnitTestCase.assertNotNull(expression.operator); | 412 JUnitTestCase.assertNotNull(expression.operator); |
| 1393 JUnitTestCase.assertEquals(TokenType.BAR, expression.operator.type); | 413 JUnitTestCase.assertEquals(TokenType.BAR, expression.operator.type); |
| 1394 JUnitTestCase.assertNotNull(expression.rightOperand); | 414 JUnitTestCase.assertNotNull(expression.rightOperand); |
| 1395 } | 415 } |
| 1396 void test_parseBitwiseXorExpression_normal() { | 416 void test_parseBitwiseXorExpression_normal() { |
| 1397 BinaryExpression expression = ParserTestCase.parse5("parseBitwiseXorExpressi
on", "x ^ y", []); | 417 BinaryExpression expression = ParserTestCase.parse6("parseBitwiseXorExpressi
on", "x ^ y", []); |
| 1398 JUnitTestCase.assertNotNull(expression.leftOperand); | 418 JUnitTestCase.assertNotNull(expression.leftOperand); |
| 1399 JUnitTestCase.assertNotNull(expression.operator); | 419 JUnitTestCase.assertNotNull(expression.operator); |
| 1400 JUnitTestCase.assertEquals(TokenType.CARET, expression.operator.type); | 420 JUnitTestCase.assertEquals(TokenType.CARET, expression.operator.type); |
| 1401 JUnitTestCase.assertNotNull(expression.rightOperand); | 421 JUnitTestCase.assertNotNull(expression.rightOperand); |
| 1402 } | 422 } |
| 1403 void test_parseBitwiseXorExpression_super() { | 423 void test_parseBitwiseXorExpression_super() { |
| 1404 BinaryExpression expression = ParserTestCase.parse5("parseBitwiseXorExpressi
on", "super ^ y", []); | 424 BinaryExpression expression = ParserTestCase.parse6("parseBitwiseXorExpressi
on", "super ^ y", []); |
| 1405 EngineTestCase.assertInstanceOf(SuperExpression, expression.leftOperand); | 425 EngineTestCase.assertInstanceOf(SuperExpression, expression.leftOperand); |
| 1406 JUnitTestCase.assertNotNull(expression.operator); | 426 JUnitTestCase.assertNotNull(expression.operator); |
| 1407 JUnitTestCase.assertEquals(TokenType.CARET, expression.operator.type); | 427 JUnitTestCase.assertEquals(TokenType.CARET, expression.operator.type); |
| 1408 JUnitTestCase.assertNotNull(expression.rightOperand); | 428 JUnitTestCase.assertNotNull(expression.rightOperand); |
| 1409 } | 429 } |
| 1410 void test_parseBlock_empty() { | 430 void test_parseBlock_empty() { |
| 1411 Block block = ParserTestCase.parse5("parseBlock", "{}", []); | 431 Block block = ParserTestCase.parse6("parseBlock", "{}", []); |
| 1412 JUnitTestCase.assertNotNull(block.leftBracket); | 432 JUnitTestCase.assertNotNull(block.leftBracket); |
| 1413 EngineTestCase.assertSize(0, block.statements); | 433 EngineTestCase.assertSize(0, block.statements); |
| 1414 JUnitTestCase.assertNotNull(block.rightBracket); | 434 JUnitTestCase.assertNotNull(block.rightBracket); |
| 1415 } | 435 } |
| 1416 void test_parseBlock_nonEmpty() { | 436 void test_parseBlock_nonEmpty() { |
| 1417 Block block = ParserTestCase.parse5("parseBlock", "{;}", []); | 437 Block block = ParserTestCase.parse6("parseBlock", "{;}", []); |
| 1418 JUnitTestCase.assertNotNull(block.leftBracket); | 438 JUnitTestCase.assertNotNull(block.leftBracket); |
| 1419 EngineTestCase.assertSize(1, block.statements); | 439 EngineTestCase.assertSize(1, block.statements); |
| 1420 JUnitTestCase.assertNotNull(block.rightBracket); | 440 JUnitTestCase.assertNotNull(block.rightBracket); |
| 1421 } | 441 } |
| 1422 void test_parseBreakStatement_label() { | 442 void test_parseBreakStatement_label() { |
| 1423 BreakStatement statement = ParserTestCase.parse5("parseBreakStatement", "bre
ak foo;", []); | 443 BreakStatement statement = ParserTestCase.parse6("parseBreakStatement", "bre
ak foo;", []); |
| 1424 JUnitTestCase.assertNotNull(statement.keyword); | 444 JUnitTestCase.assertNotNull(statement.keyword); |
| 1425 JUnitTestCase.assertNotNull(statement.label); | 445 JUnitTestCase.assertNotNull(statement.label); |
| 1426 JUnitTestCase.assertNotNull(statement.semicolon); | 446 JUnitTestCase.assertNotNull(statement.semicolon); |
| 1427 } | 447 } |
| 1428 void test_parseBreakStatement_noLabel() { | 448 void test_parseBreakStatement_noLabel() { |
| 1429 BreakStatement statement = ParserTestCase.parse5("parseBreakStatement", "bre
ak;", [ParserErrorCode.BREAK_OUTSIDE_OF_LOOP]); | 449 BreakStatement statement = ParserTestCase.parse6("parseBreakStatement", "bre
ak;", [ParserErrorCode.BREAK_OUTSIDE_OF_LOOP]); |
| 1430 JUnitTestCase.assertNotNull(statement.keyword); | 450 JUnitTestCase.assertNotNull(statement.keyword); |
| 1431 JUnitTestCase.assertNull(statement.label); | 451 JUnitTestCase.assertNull(statement.label); |
| 1432 JUnitTestCase.assertNotNull(statement.semicolon); | 452 JUnitTestCase.assertNotNull(statement.semicolon); |
| 1433 } | 453 } |
| 1434 void test_parseCascadeSection_i() { | 454 void test_parseCascadeSection_i() { |
| 1435 IndexExpression section = ParserTestCase.parse5("parseCascadeSection", "..[i
]", []); | 455 IndexExpression section = ParserTestCase.parse6("parseCascadeSection", "..[i
]", []); |
| 1436 JUnitTestCase.assertNull(section.array); | 456 JUnitTestCase.assertNull(section.array); |
| 1437 JUnitTestCase.assertNotNull(section.leftBracket); | 457 JUnitTestCase.assertNotNull(section.leftBracket); |
| 1438 JUnitTestCase.assertNotNull(section.index); | 458 JUnitTestCase.assertNotNull(section.index); |
| 1439 JUnitTestCase.assertNotNull(section.rightBracket); | 459 JUnitTestCase.assertNotNull(section.rightBracket); |
| 1440 } | 460 } |
| 1441 void test_parseCascadeSection_ia() { | 461 void test_parseCascadeSection_ia() { |
| 1442 FunctionExpressionInvocation section = ParserTestCase.parse5("parseCascadeSe
ction", "..[i](b)", []); | 462 FunctionExpressionInvocation section = ParserTestCase.parse6("parseCascadeSe
ction", "..[i](b)", []); |
| 1443 EngineTestCase.assertInstanceOf(IndexExpression, section.function); | 463 EngineTestCase.assertInstanceOf(IndexExpression, section.function); |
| 1444 JUnitTestCase.assertNotNull(section.argumentList); | 464 JUnitTestCase.assertNotNull(section.argumentList); |
| 1445 } | 465 } |
| 1446 void test_parseCascadeSection_p() { | 466 void test_parseCascadeSection_p() { |
| 1447 PropertyAccess section = ParserTestCase.parse5("parseCascadeSection", "..a",
[]); | 467 PropertyAccess section = ParserTestCase.parse6("parseCascadeSection", "..a",
[]); |
| 1448 JUnitTestCase.assertNull(section.target); | 468 JUnitTestCase.assertNull(section.target); |
| 1449 JUnitTestCase.assertNotNull(section.operator); | 469 JUnitTestCase.assertNotNull(section.operator); |
| 1450 JUnitTestCase.assertNotNull(section.propertyName); | 470 JUnitTestCase.assertNotNull(section.propertyName); |
| 1451 } | 471 } |
| 1452 void test_parseCascadeSection_p_assign() { | 472 void test_parseCascadeSection_p_assign() { |
| 1453 AssignmentExpression section = ParserTestCase.parse5("parseCascadeSection",
"..a = 3", []); | 473 AssignmentExpression section = ParserTestCase.parse6("parseCascadeSection",
"..a = 3", []); |
| 1454 JUnitTestCase.assertNotNull(section.leftHandSide); | 474 JUnitTestCase.assertNotNull(section.leftHandSide); |
| 1455 JUnitTestCase.assertNotNull(section.operator); | 475 JUnitTestCase.assertNotNull(section.operator); |
| 1456 JUnitTestCase.assertNotNull(section.rightHandSide); | 476 Expression rhs = section.rightHandSide; |
| 477 JUnitTestCase.assertNotNull(rhs); |
| 478 } |
| 479 void test_parseCascadeSection_p_assign_withCascade() { |
| 480 AssignmentExpression section = ParserTestCase.parse6("parseCascadeSection",
"..a = 3..m()", []); |
| 481 JUnitTestCase.assertNotNull(section.leftHandSide); |
| 482 JUnitTestCase.assertNotNull(section.operator); |
| 483 Expression rhs = section.rightHandSide; |
| 484 EngineTestCase.assertInstanceOf(IntegerLiteral, rhs); |
| 1457 } | 485 } |
| 1458 void test_parseCascadeSection_p_builtIn() { | 486 void test_parseCascadeSection_p_builtIn() { |
| 1459 PropertyAccess section = ParserTestCase.parse5("parseCascadeSection", "..as"
, []); | 487 PropertyAccess section = ParserTestCase.parse6("parseCascadeSection", "..as"
, []); |
| 1460 JUnitTestCase.assertNull(section.target); | 488 JUnitTestCase.assertNull(section.target); |
| 1461 JUnitTestCase.assertNotNull(section.operator); | 489 JUnitTestCase.assertNotNull(section.operator); |
| 1462 JUnitTestCase.assertNotNull(section.propertyName); | 490 JUnitTestCase.assertNotNull(section.propertyName); |
| 1463 } | 491 } |
| 1464 void test_parseCascadeSection_pa() { | 492 void test_parseCascadeSection_pa() { |
| 1465 MethodInvocation section = ParserTestCase.parse5("parseCascadeSection", "..a
(b)", []); | 493 MethodInvocation section = ParserTestCase.parse6("parseCascadeSection", "..a
(b)", []); |
| 1466 JUnitTestCase.assertNull(section.target); | 494 JUnitTestCase.assertNull(section.target); |
| 1467 JUnitTestCase.assertNotNull(section.period); | 495 JUnitTestCase.assertNotNull(section.period); |
| 1468 JUnitTestCase.assertNotNull(section.methodName); | 496 JUnitTestCase.assertNotNull(section.methodName); |
| 1469 JUnitTestCase.assertNotNull(section.argumentList); | 497 JUnitTestCase.assertNotNull(section.argumentList); |
| 1470 EngineTestCase.assertSize(1, section.argumentList.arguments); | 498 EngineTestCase.assertSize(1, section.argumentList.arguments); |
| 1471 } | 499 } |
| 1472 void test_parseCascadeSection_paa() { | 500 void test_parseCascadeSection_paa() { |
| 1473 FunctionExpressionInvocation section = ParserTestCase.parse5("parseCascadeSe
ction", "..a(b)(c)", []); | 501 FunctionExpressionInvocation section = ParserTestCase.parse6("parseCascadeSe
ction", "..a(b)(c)", []); |
| 1474 EngineTestCase.assertInstanceOf(MethodInvocation, section.function); | 502 EngineTestCase.assertInstanceOf(MethodInvocation, section.function); |
| 1475 JUnitTestCase.assertNotNull(section.argumentList); | 503 JUnitTestCase.assertNotNull(section.argumentList); |
| 1476 EngineTestCase.assertSize(1, section.argumentList.arguments); | 504 EngineTestCase.assertSize(1, section.argumentList.arguments); |
| 1477 } | 505 } |
| 1478 void test_parseCascadeSection_paapaa() { | 506 void test_parseCascadeSection_paapaa() { |
| 1479 FunctionExpressionInvocation section = ParserTestCase.parse5("parseCascadeSe
ction", "..a(b)(c).d(e)(f)", []); | 507 FunctionExpressionInvocation section = ParserTestCase.parse6("parseCascadeSe
ction", "..a(b)(c).d(e)(f)", []); |
| 1480 EngineTestCase.assertInstanceOf(FunctionExpressionInvocation, section.functi
on); | 508 EngineTestCase.assertInstanceOf(FunctionExpressionInvocation, section.functi
on); |
| 1481 JUnitTestCase.assertNotNull(section.argumentList); | 509 JUnitTestCase.assertNotNull(section.argumentList); |
| 1482 EngineTestCase.assertSize(1, section.argumentList.arguments); | 510 EngineTestCase.assertSize(1, section.argumentList.arguments); |
| 1483 } | 511 } |
| 1484 void test_parseCascadeSection_pap() { | 512 void test_parseCascadeSection_pap() { |
| 1485 PropertyAccess section = ParserTestCase.parse5("parseCascadeSection", "..a(b
).c", []); | 513 PropertyAccess section = ParserTestCase.parse6("parseCascadeSection", "..a(b
).c", []); |
| 1486 JUnitTestCase.assertNotNull(section.target); | 514 JUnitTestCase.assertNotNull(section.target); |
| 1487 JUnitTestCase.assertNotNull(section.operator); | 515 JUnitTestCase.assertNotNull(section.operator); |
| 1488 JUnitTestCase.assertNotNull(section.propertyName); | 516 JUnitTestCase.assertNotNull(section.propertyName); |
| 1489 } | 517 } |
| 1490 void test_parseClassDeclaration_abstract() { | 518 void test_parseClassDeclaration_abstract() { |
| 1491 ClassDeclaration declaration = ParserTestCase.parse("parseClassDeclaration",
<Object> [emptyCommentAndMetadata(), TokenFactory.token(Keyword.ABSTRACT)], "cl
ass A {}"); | 519 ClassDeclaration declaration = ParserTestCase.parse("parseClassDeclaration",
<Object> [emptyCommentAndMetadata(), TokenFactory.token(Keyword.ABSTRACT)], "cl
ass A {}"); |
| 1492 JUnitTestCase.assertNull(declaration.documentationComment); | 520 JUnitTestCase.assertNull(declaration.documentationComment); |
| 1493 JUnitTestCase.assertNotNull(declaration.abstractKeyword); | 521 JUnitTestCase.assertNotNull(declaration.abstractKeyword); |
| 1494 JUnitTestCase.assertNull(declaration.extendsClause); | 522 JUnitTestCase.assertNull(declaration.extendsClause); |
| 1495 JUnitTestCase.assertNull(declaration.implementsClause); | 523 JUnitTestCase.assertNull(declaration.implementsClause); |
| (...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1869 JUnitTestCase.assertNotNull(constructor.returnType); | 897 JUnitTestCase.assertNotNull(constructor.returnType); |
| 1870 JUnitTestCase.assertNull(constructor.period); | 898 JUnitTestCase.assertNull(constructor.period); |
| 1871 JUnitTestCase.assertNull(constructor.name); | 899 JUnitTestCase.assertNull(constructor.name); |
| 1872 JUnitTestCase.assertNotNull(constructor.parameters); | 900 JUnitTestCase.assertNotNull(constructor.parameters); |
| 1873 JUnitTestCase.assertNotNull(constructor.separator); | 901 JUnitTestCase.assertNotNull(constructor.separator); |
| 1874 EngineTestCase.assertSize(0, constructor.initializers); | 902 EngineTestCase.assertSize(0, constructor.initializers); |
| 1875 JUnitTestCase.assertNotNull(constructor.redirectedConstructor); | 903 JUnitTestCase.assertNotNull(constructor.redirectedConstructor); |
| 1876 JUnitTestCase.assertNotNull(constructor.body); | 904 JUnitTestCase.assertNotNull(constructor.body); |
| 1877 } | 905 } |
| 1878 void test_parseCombinators_h() { | 906 void test_parseCombinators_h() { |
| 1879 List<Combinator> combinators = ParserTestCase.parse5("parseCombinators", "hi
de a;", []); | 907 List<Combinator> combinators = ParserTestCase.parse6("parseCombinators", "hi
de a;", []); |
| 1880 EngineTestCase.assertSize(1, combinators); | 908 EngineTestCase.assertSize(1, combinators); |
| 1881 HideCombinator combinator = (combinators[0] as HideCombinator); | 909 HideCombinator combinator = combinators[0] as HideCombinator; |
| 1882 JUnitTestCase.assertNotNull(combinator); | 910 JUnitTestCase.assertNotNull(combinator); |
| 1883 JUnitTestCase.assertNotNull(combinator.keyword); | 911 JUnitTestCase.assertNotNull(combinator.keyword); |
| 1884 EngineTestCase.assertSize(1, combinator.hiddenNames); | 912 EngineTestCase.assertSize(1, combinator.hiddenNames); |
| 1885 } | 913 } |
| 1886 void test_parseCombinators_hs() { | 914 void test_parseCombinators_hs() { |
| 1887 List<Combinator> combinators = ParserTestCase.parse5("parseCombinators", "hi
de a show b;", []); | 915 List<Combinator> combinators = ParserTestCase.parse6("parseCombinators", "hi
de a show b;", []); |
| 1888 EngineTestCase.assertSize(2, combinators); | 916 EngineTestCase.assertSize(2, combinators); |
| 1889 HideCombinator hideCombinator = (combinators[0] as HideCombinator); | 917 HideCombinator hideCombinator = combinators[0] as HideCombinator; |
| 1890 JUnitTestCase.assertNotNull(hideCombinator); | 918 JUnitTestCase.assertNotNull(hideCombinator); |
| 1891 JUnitTestCase.assertNotNull(hideCombinator.keyword); | 919 JUnitTestCase.assertNotNull(hideCombinator.keyword); |
| 1892 EngineTestCase.assertSize(1, hideCombinator.hiddenNames); | 920 EngineTestCase.assertSize(1, hideCombinator.hiddenNames); |
| 1893 ShowCombinator showCombinator = (combinators[1] as ShowCombinator); | 921 ShowCombinator showCombinator = combinators[1] as ShowCombinator; |
| 1894 JUnitTestCase.assertNotNull(showCombinator); | 922 JUnitTestCase.assertNotNull(showCombinator); |
| 1895 JUnitTestCase.assertNotNull(showCombinator.keyword); | 923 JUnitTestCase.assertNotNull(showCombinator.keyword); |
| 1896 EngineTestCase.assertSize(1, showCombinator.shownNames); | 924 EngineTestCase.assertSize(1, showCombinator.shownNames); |
| 1897 } | 925 } |
| 1898 void test_parseCombinators_hshs() { | 926 void test_parseCombinators_hshs() { |
| 1899 List<Combinator> combinators = ParserTestCase.parse5("parseCombinators", "hi
de a show b hide c show d;", []); | 927 List<Combinator> combinators = ParserTestCase.parse6("parseCombinators", "hi
de a show b hide c show d;", []); |
| 1900 EngineTestCase.assertSize(4, combinators); | 928 EngineTestCase.assertSize(4, combinators); |
| 1901 } | 929 } |
| 1902 void test_parseCombinators_s() { | 930 void test_parseCombinators_s() { |
| 1903 List<Combinator> combinators = ParserTestCase.parse5("parseCombinators", "sh
ow a;", []); | 931 List<Combinator> combinators = ParserTestCase.parse6("parseCombinators", "sh
ow a;", []); |
| 1904 EngineTestCase.assertSize(1, combinators); | 932 EngineTestCase.assertSize(1, combinators); |
| 1905 ShowCombinator combinator = (combinators[0] as ShowCombinator); | 933 ShowCombinator combinator = combinators[0] as ShowCombinator; |
| 1906 JUnitTestCase.assertNotNull(combinator); | 934 JUnitTestCase.assertNotNull(combinator); |
| 1907 JUnitTestCase.assertNotNull(combinator.keyword); | 935 JUnitTestCase.assertNotNull(combinator.keyword); |
| 1908 EngineTestCase.assertSize(1, combinator.shownNames); | 936 EngineTestCase.assertSize(1, combinator.shownNames); |
| 1909 } | 937 } |
| 1910 void test_parseCommentAndMetadata_c() { | 938 void test_parseCommentAndMetadata_c() { |
| 1911 CommentAndMetadata commentAndMetadata = ParserTestCase.parse5("parseCommentA
ndMetadata", "/** 1 */ void", []); | 939 CommentAndMetadata commentAndMetadata = ParserTestCase.parse6("parseCommentA
ndMetadata", "/** 1 */ void", []); |
| 1912 JUnitTestCase.assertNotNull(commentAndMetadata.comment); | 940 JUnitTestCase.assertNotNull(commentAndMetadata.comment); |
| 1913 EngineTestCase.assertSize(0, commentAndMetadata.metadata); | 941 EngineTestCase.assertSize(0, commentAndMetadata.metadata); |
| 1914 } | 942 } |
| 1915 void test_parseCommentAndMetadata_cmc() { | 943 void test_parseCommentAndMetadata_cmc() { |
| 1916 CommentAndMetadata commentAndMetadata = ParserTestCase.parse5("parseCommentA
ndMetadata", "/** 1 */ @A /** 2 */ void", []); | 944 CommentAndMetadata commentAndMetadata = ParserTestCase.parse6("parseCommentA
ndMetadata", "/** 1 */ @A /** 2 */ void", []); |
| 1917 JUnitTestCase.assertNotNull(commentAndMetadata.comment); | 945 JUnitTestCase.assertNotNull(commentAndMetadata.comment); |
| 1918 EngineTestCase.assertSize(1, commentAndMetadata.metadata); | 946 EngineTestCase.assertSize(1, commentAndMetadata.metadata); |
| 1919 } | 947 } |
| 1920 void test_parseCommentAndMetadata_cmcm() { | 948 void test_parseCommentAndMetadata_cmcm() { |
| 1921 CommentAndMetadata commentAndMetadata = ParserTestCase.parse5("parseCommentA
ndMetadata", "/** 1 */ @A /** 2 */ @B void", []); | 949 CommentAndMetadata commentAndMetadata = ParserTestCase.parse6("parseCommentA
ndMetadata", "/** 1 */ @A /** 2 */ @B void", []); |
| 1922 JUnitTestCase.assertNotNull(commentAndMetadata.comment); | 950 JUnitTestCase.assertNotNull(commentAndMetadata.comment); |
| 1923 EngineTestCase.assertSize(2, commentAndMetadata.metadata); | 951 EngineTestCase.assertSize(2, commentAndMetadata.metadata); |
| 1924 } | 952 } |
| 1925 void test_parseCommentAndMetadata_cmm() { | 953 void test_parseCommentAndMetadata_cmm() { |
| 1926 CommentAndMetadata commentAndMetadata = ParserTestCase.parse5("parseCommentA
ndMetadata", "/** 1 */ @A @B void", []); | 954 CommentAndMetadata commentAndMetadata = ParserTestCase.parse6("parseCommentA
ndMetadata", "/** 1 */ @A @B void", []); |
| 1927 JUnitTestCase.assertNotNull(commentAndMetadata.comment); | 955 JUnitTestCase.assertNotNull(commentAndMetadata.comment); |
| 1928 EngineTestCase.assertSize(2, commentAndMetadata.metadata); | 956 EngineTestCase.assertSize(2, commentAndMetadata.metadata); |
| 1929 } | 957 } |
| 1930 void test_parseCommentAndMetadata_m() { | 958 void test_parseCommentAndMetadata_m() { |
| 1931 CommentAndMetadata commentAndMetadata = ParserTestCase.parse5("parseCommentA
ndMetadata", "@A void", []); | 959 CommentAndMetadata commentAndMetadata = ParserTestCase.parse6("parseCommentA
ndMetadata", "@A void", []); |
| 1932 JUnitTestCase.assertNull(commentAndMetadata.comment); | 960 JUnitTestCase.assertNull(commentAndMetadata.comment); |
| 1933 EngineTestCase.assertSize(1, commentAndMetadata.metadata); | 961 EngineTestCase.assertSize(1, commentAndMetadata.metadata); |
| 1934 } | 962 } |
| 1935 void test_parseCommentAndMetadata_mcm() { | 963 void test_parseCommentAndMetadata_mcm() { |
| 1936 CommentAndMetadata commentAndMetadata = ParserTestCase.parse5("parseCommentA
ndMetadata", "@A /** 1 */ @B void", []); | 964 CommentAndMetadata commentAndMetadata = ParserTestCase.parse6("parseCommentA
ndMetadata", "@A /** 1 */ @B void", []); |
| 1937 JUnitTestCase.assertNotNull(commentAndMetadata.comment); | 965 JUnitTestCase.assertNotNull(commentAndMetadata.comment); |
| 1938 EngineTestCase.assertSize(2, commentAndMetadata.metadata); | 966 EngineTestCase.assertSize(2, commentAndMetadata.metadata); |
| 1939 } | 967 } |
| 1940 void test_parseCommentAndMetadata_mcmc() { | 968 void test_parseCommentAndMetadata_mcmc() { |
| 1941 CommentAndMetadata commentAndMetadata = ParserTestCase.parse5("parseCommentA
ndMetadata", "@A /** 1 */ @B /** 2 */ void", []); | 969 CommentAndMetadata commentAndMetadata = ParserTestCase.parse6("parseCommentA
ndMetadata", "@A /** 1 */ @B /** 2 */ void", []); |
| 1942 JUnitTestCase.assertNotNull(commentAndMetadata.comment); | 970 JUnitTestCase.assertNotNull(commentAndMetadata.comment); |
| 1943 EngineTestCase.assertSize(2, commentAndMetadata.metadata); | 971 EngineTestCase.assertSize(2, commentAndMetadata.metadata); |
| 1944 } | 972 } |
| 1945 void test_parseCommentAndMetadata_mm() { | 973 void test_parseCommentAndMetadata_mm() { |
| 1946 CommentAndMetadata commentAndMetadata = ParserTestCase.parse5("parseCommentA
ndMetadata", "@A @B(x) void", []); | 974 CommentAndMetadata commentAndMetadata = ParserTestCase.parse6("parseCommentA
ndMetadata", "@A @B(x) void", []); |
| 1947 JUnitTestCase.assertNull(commentAndMetadata.comment); | 975 JUnitTestCase.assertNull(commentAndMetadata.comment); |
| 1948 EngineTestCase.assertSize(2, commentAndMetadata.metadata); | 976 EngineTestCase.assertSize(2, commentAndMetadata.metadata); |
| 1949 } | 977 } |
| 1950 void test_parseCommentAndMetadata_none() { | 978 void test_parseCommentAndMetadata_none() { |
| 1951 CommentAndMetadata commentAndMetadata = ParserTestCase.parse5("parseCommentA
ndMetadata", "void", []); | 979 CommentAndMetadata commentAndMetadata = ParserTestCase.parse6("parseCommentA
ndMetadata", "void", []); |
| 1952 JUnitTestCase.assertNull(commentAndMetadata.comment); | 980 JUnitTestCase.assertNull(commentAndMetadata.comment); |
| 1953 EngineTestCase.assertSize(0, commentAndMetadata.metadata); | 981 EngineTestCase.assertSize(0, commentAndMetadata.metadata); |
| 1954 } | 982 } |
| 1955 void test_parseCommentReference_new_prefixed() { | 983 void test_parseCommentReference_new_prefixed() { |
| 1956 CommentReference reference = ParserTestCase.parse("parseCommentReference", <
Object> ["new a.b", 7], ""); | 984 CommentReference reference = ParserTestCase.parse("parseCommentReference", <
Object> ["new a.b", 7], ""); |
| 1957 PrefixedIdentifier prefixedIdentifier = EngineTestCase.assertInstanceOf(Pref
ixedIdentifier, reference.identifier); | 985 PrefixedIdentifier prefixedIdentifier = EngineTestCase.assertInstanceOf(Pref
ixedIdentifier, reference.identifier); |
| 1958 SimpleIdentifier prefix10 = prefixedIdentifier.prefix; | |
| 1959 JUnitTestCase.assertNotNull(prefix10.token); | |
| 1960 JUnitTestCase.assertEquals("a", prefix10.name); | |
| 1961 JUnitTestCase.assertEquals(11, prefix10.offset); | |
| 1962 JUnitTestCase.assertNotNull(prefixedIdentifier.period); | |
| 1963 SimpleIdentifier identifier14 = prefixedIdentifier.identifier; | |
| 1964 JUnitTestCase.assertNotNull(identifier14.token); | |
| 1965 JUnitTestCase.assertEquals("b", identifier14.name); | |
| 1966 JUnitTestCase.assertEquals(13, identifier14.offset); | |
| 1967 } | |
| 1968 void test_parseCommentReference_new_simple() { | |
| 1969 CommentReference reference = ParserTestCase.parse("parseCommentReference", <
Object> ["new a", 5], ""); | |
| 1970 SimpleIdentifier identifier15 = EngineTestCase.assertInstanceOf(SimpleIdenti
fier, reference.identifier); | |
| 1971 JUnitTestCase.assertNotNull(identifier15.token); | |
| 1972 JUnitTestCase.assertEquals("a", identifier15.name); | |
| 1973 JUnitTestCase.assertEquals(9, identifier15.offset); | |
| 1974 } | |
| 1975 void test_parseCommentReference_prefixed() { | |
| 1976 CommentReference reference = ParserTestCase.parse("parseCommentReference", <
Object> ["a.b", 7], ""); | |
| 1977 PrefixedIdentifier prefixedIdentifier = EngineTestCase.assertInstanceOf(Pref
ixedIdentifier, reference.identifier); | |
| 1978 SimpleIdentifier prefix11 = prefixedIdentifier.prefix; | 986 SimpleIdentifier prefix11 = prefixedIdentifier.prefix; |
| 1979 JUnitTestCase.assertNotNull(prefix11.token); | 987 JUnitTestCase.assertNotNull(prefix11.token); |
| 1980 JUnitTestCase.assertEquals("a", prefix11.name); | 988 JUnitTestCase.assertEquals("a", prefix11.name); |
| 1981 JUnitTestCase.assertEquals(7, prefix11.offset); | 989 JUnitTestCase.assertEquals(11, prefix11.offset); |
| 1982 JUnitTestCase.assertNotNull(prefixedIdentifier.period); | 990 JUnitTestCase.assertNotNull(prefixedIdentifier.period); |
| 1983 SimpleIdentifier identifier16 = prefixedIdentifier.identifier; | 991 SimpleIdentifier identifier19 = prefixedIdentifier.identifier; |
| 1984 JUnitTestCase.assertNotNull(identifier16.token); | 992 JUnitTestCase.assertNotNull(identifier19.token); |
| 1985 JUnitTestCase.assertEquals("b", identifier16.name); | 993 JUnitTestCase.assertEquals("b", identifier19.name); |
| 1986 JUnitTestCase.assertEquals(9, identifier16.offset); | 994 JUnitTestCase.assertEquals(13, identifier19.offset); |
| 995 } |
| 996 void test_parseCommentReference_new_simple() { |
| 997 CommentReference reference = ParserTestCase.parse("parseCommentReference", <
Object> ["new a", 5], ""); |
| 998 SimpleIdentifier identifier20 = EngineTestCase.assertInstanceOf(SimpleIdenti
fier, reference.identifier); |
| 999 JUnitTestCase.assertNotNull(identifier20.token); |
| 1000 JUnitTestCase.assertEquals("a", identifier20.name); |
| 1001 JUnitTestCase.assertEquals(9, identifier20.offset); |
| 1002 } |
| 1003 void test_parseCommentReference_prefixed() { |
| 1004 CommentReference reference = ParserTestCase.parse("parseCommentReference", <
Object> ["a.b", 7], ""); |
| 1005 PrefixedIdentifier prefixedIdentifier = EngineTestCase.assertInstanceOf(Pref
ixedIdentifier, reference.identifier); |
| 1006 SimpleIdentifier prefix12 = prefixedIdentifier.prefix; |
| 1007 JUnitTestCase.assertNotNull(prefix12.token); |
| 1008 JUnitTestCase.assertEquals("a", prefix12.name); |
| 1009 JUnitTestCase.assertEquals(7, prefix12.offset); |
| 1010 JUnitTestCase.assertNotNull(prefixedIdentifier.period); |
| 1011 SimpleIdentifier identifier21 = prefixedIdentifier.identifier; |
| 1012 JUnitTestCase.assertNotNull(identifier21.token); |
| 1013 JUnitTestCase.assertEquals("b", identifier21.name); |
| 1014 JUnitTestCase.assertEquals(9, identifier21.offset); |
| 1987 } | 1015 } |
| 1988 void test_parseCommentReference_simple() { | 1016 void test_parseCommentReference_simple() { |
| 1989 CommentReference reference = ParserTestCase.parse("parseCommentReference", <
Object> ["a", 5], ""); | 1017 CommentReference reference = ParserTestCase.parse("parseCommentReference", <
Object> ["a", 5], ""); |
| 1990 SimpleIdentifier identifier17 = EngineTestCase.assertInstanceOf(SimpleIdenti
fier, reference.identifier); | 1018 SimpleIdentifier identifier22 = EngineTestCase.assertInstanceOf(SimpleIdenti
fier, reference.identifier); |
| 1991 JUnitTestCase.assertNotNull(identifier17.token); | 1019 JUnitTestCase.assertNotNull(identifier22.token); |
| 1992 JUnitTestCase.assertEquals("a", identifier17.name); | 1020 JUnitTestCase.assertEquals("a", identifier22.name); |
| 1993 JUnitTestCase.assertEquals(5, identifier17.offset); | 1021 JUnitTestCase.assertEquals(5, identifier22.offset); |
| 1994 } | 1022 } |
| 1995 void test_parseCommentReferences_multiLine() { | 1023 void test_parseCommentReferences_multiLine() { |
| 1996 List<Token> tokens = <Token> [new StringToken(TokenType.MULTI_LINE_COMMENT,
"/** xxx [a] yyy [b] zzz */", 3)]; | 1024 List<Token> tokens = <Token> [new StringToken(TokenType.MULTI_LINE_COMMENT,
"/** xxx [a] yyy [b] zzz */", 3)]; |
| 1997 List<CommentReference> references = ParserTestCase.parse("parseCommentRefere
nces", <Object> [tokens], ""); | 1025 List<CommentReference> references = ParserTestCase.parse("parseCommentRefere
nces", <Object> [tokens], ""); |
| 1998 EngineTestCase.assertSize(2, references); | 1026 EngineTestCase.assertSize(2, references); |
| 1999 CommentReference reference = references[0]; | 1027 CommentReference reference = references[0]; |
| 2000 JUnitTestCase.assertNotNull(reference); | 1028 JUnitTestCase.assertNotNull(reference); |
| 2001 JUnitTestCase.assertNotNull(reference.identifier); | 1029 JUnitTestCase.assertNotNull(reference.identifier); |
| 2002 JUnitTestCase.assertEquals(12, reference.offset); | 1030 JUnitTestCase.assertEquals(12, reference.offset); |
| 2003 reference = references[1]; | 1031 reference = references[1]; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 2015 JUnitTestCase.assertEquals(12, reference.offset); | 1043 JUnitTestCase.assertEquals(12, reference.offset); |
| 2016 reference = references[1]; | 1044 reference = references[1]; |
| 2017 JUnitTestCase.assertNotNull(reference); | 1045 JUnitTestCase.assertNotNull(reference); |
| 2018 JUnitTestCase.assertNotNull(reference.identifier); | 1046 JUnitTestCase.assertNotNull(reference.identifier); |
| 2019 JUnitTestCase.assertEquals(20, reference.offset); | 1047 JUnitTestCase.assertEquals(20, reference.offset); |
| 2020 reference = references[2]; | 1048 reference = references[2]; |
| 2021 JUnitTestCase.assertNotNull(reference); | 1049 JUnitTestCase.assertNotNull(reference); |
| 2022 JUnitTestCase.assertNotNull(reference.identifier); | 1050 JUnitTestCase.assertNotNull(reference.identifier); |
| 2023 JUnitTestCase.assertEquals(35, reference.offset); | 1051 JUnitTestCase.assertEquals(35, reference.offset); |
| 2024 } | 1052 } |
| 1053 void test_parseCompilationUnit_abstractAsPrefix_parameterized() { |
| 1054 CompilationUnit unit = ParserTestCase.parse6("parseCompilationUnit", "abstra
ct<dynamic> _abstract = new abstract.A();", []); |
| 1055 JUnitTestCase.assertNull(unit.scriptTag); |
| 1056 EngineTestCase.assertSize(0, unit.directives); |
| 1057 EngineTestCase.assertSize(1, unit.declarations); |
| 1058 } |
| 2025 void test_parseCompilationUnit_directives_multiple() { | 1059 void test_parseCompilationUnit_directives_multiple() { |
| 2026 CompilationUnit unit = ParserTestCase.parse5("parseCompilationUnit", "librar
y l;\npart 'a.dart';", []); | 1060 CompilationUnit unit = ParserTestCase.parse6("parseCompilationUnit", "librar
y l;\npart 'a.dart';", []); |
| 2027 JUnitTestCase.assertNull(unit.scriptTag); | 1061 JUnitTestCase.assertNull(unit.scriptTag); |
| 2028 EngineTestCase.assertSize(2, unit.directives); | 1062 EngineTestCase.assertSize(2, unit.directives); |
| 2029 EngineTestCase.assertSize(0, unit.declarations); | 1063 EngineTestCase.assertSize(0, unit.declarations); |
| 2030 } | 1064 } |
| 2031 void test_parseCompilationUnit_directives_single() { | 1065 void test_parseCompilationUnit_directives_single() { |
| 2032 CompilationUnit unit = ParserTestCase.parse5("parseCompilationUnit", "librar
y l;", []); | 1066 CompilationUnit unit = ParserTestCase.parse6("parseCompilationUnit", "librar
y l;", []); |
| 2033 JUnitTestCase.assertNull(unit.scriptTag); | 1067 JUnitTestCase.assertNull(unit.scriptTag); |
| 2034 EngineTestCase.assertSize(1, unit.directives); | 1068 EngineTestCase.assertSize(1, unit.directives); |
| 2035 EngineTestCase.assertSize(0, unit.declarations); | 1069 EngineTestCase.assertSize(0, unit.declarations); |
| 2036 } | 1070 } |
| 2037 void test_parseCompilationUnit_empty() { | 1071 void test_parseCompilationUnit_empty() { |
| 2038 CompilationUnit unit = ParserTestCase.parse5("parseCompilationUnit", "", [])
; | 1072 CompilationUnit unit = ParserTestCase.parse6("parseCompilationUnit", "", [])
; |
| 2039 JUnitTestCase.assertNull(unit.scriptTag); | 1073 JUnitTestCase.assertNull(unit.scriptTag); |
| 2040 EngineTestCase.assertSize(0, unit.directives); | 1074 EngineTestCase.assertSize(0, unit.directives); |
| 2041 EngineTestCase.assertSize(0, unit.declarations); | 1075 EngineTestCase.assertSize(0, unit.declarations); |
| 2042 } | 1076 } |
| 1077 void test_parseCompilationUnit_exportAsPrefix() { |
| 1078 CompilationUnit unit = ParserTestCase.parse6("parseCompilationUnit", "export
.A _export = new export.A();", []); |
| 1079 JUnitTestCase.assertNull(unit.scriptTag); |
| 1080 EngineTestCase.assertSize(0, unit.directives); |
| 1081 EngineTestCase.assertSize(1, unit.declarations); |
| 1082 } |
| 1083 void test_parseCompilationUnit_exportAsPrefix_parameterized() { |
| 1084 CompilationUnit unit = ParserTestCase.parse6("parseCompilationUnit", "export
<dynamic> _export = new export.A();", []); |
| 1085 JUnitTestCase.assertNull(unit.scriptTag); |
| 1086 EngineTestCase.assertSize(0, unit.directives); |
| 1087 EngineTestCase.assertSize(1, unit.declarations); |
| 1088 } |
| 1089 void test_parseCompilationUnit_operatorAsPrefix_parameterized() { |
| 1090 CompilationUnit unit = ParserTestCase.parse6("parseCompilationUnit", "operat
or<dynamic> _operator = new operator.A();", []); |
| 1091 JUnitTestCase.assertNull(unit.scriptTag); |
| 1092 EngineTestCase.assertSize(0, unit.directives); |
| 1093 EngineTestCase.assertSize(1, unit.declarations); |
| 1094 } |
| 2043 void test_parseCompilationUnit_script() { | 1095 void test_parseCompilationUnit_script() { |
| 2044 CompilationUnit unit = ParserTestCase.parse5("parseCompilationUnit", "#! /bi
n/dart", []); | 1096 CompilationUnit unit = ParserTestCase.parse6("parseCompilationUnit", "#! /bi
n/dart", []); |
| 2045 JUnitTestCase.assertNotNull(unit.scriptTag); | 1097 JUnitTestCase.assertNotNull(unit.scriptTag); |
| 2046 EngineTestCase.assertSize(0, unit.directives); | 1098 EngineTestCase.assertSize(0, unit.directives); |
| 2047 EngineTestCase.assertSize(0, unit.declarations); | 1099 EngineTestCase.assertSize(0, unit.declarations); |
| 2048 } | 1100 } |
| 2049 void test_parseCompilationUnit_topLevelDeclaration() { | 1101 void test_parseCompilationUnit_topLevelDeclaration() { |
| 2050 CompilationUnit unit = ParserTestCase.parse5("parseCompilationUnit", "class
A {}", []); | 1102 CompilationUnit unit = ParserTestCase.parse6("parseCompilationUnit", "class
A {}", []); |
| 2051 JUnitTestCase.assertNull(unit.scriptTag); | 1103 JUnitTestCase.assertNull(unit.scriptTag); |
| 2052 EngineTestCase.assertSize(0, unit.directives); | 1104 EngineTestCase.assertSize(0, unit.directives); |
| 2053 EngineTestCase.assertSize(1, unit.declarations); | 1105 EngineTestCase.assertSize(1, unit.declarations); |
| 2054 } | 1106 } |
| 1107 void test_parseCompilationUnit_typedefAsPrefix() { |
| 1108 CompilationUnit unit = ParserTestCase.parse6("parseCompilationUnit", "typede
f.A _typedef = new typedef.A();", []); |
| 1109 JUnitTestCase.assertNull(unit.scriptTag); |
| 1110 EngineTestCase.assertSize(0, unit.directives); |
| 1111 EngineTestCase.assertSize(1, unit.declarations); |
| 1112 } |
| 1113 void test_parseCompilationUnitMember_abstractAsPrefix() { |
| 1114 TopLevelVariableDeclaration declaration = ParserTestCase.parse("parseCompila
tionUnitMember", <Object> [emptyCommentAndMetadata()], "abstract.A _abstract = n
ew abstract.A();"); |
| 1115 JUnitTestCase.assertNotNull(declaration.semicolon); |
| 1116 JUnitTestCase.assertNotNull(declaration.variables); |
| 1117 } |
| 2055 void test_parseCompilationUnitMember_class() { | 1118 void test_parseCompilationUnitMember_class() { |
| 2056 ClassDeclaration declaration = ParserTestCase.parse("parseCompilationUnitMem
ber", <Object> [emptyCommentAndMetadata()], "class A {}"); | 1119 ClassDeclaration declaration = ParserTestCase.parse("parseCompilationUnitMem
ber", <Object> [emptyCommentAndMetadata()], "class A {}"); |
| 2057 JUnitTestCase.assertEquals("A", declaration.name.name); | 1120 JUnitTestCase.assertEquals("A", declaration.name.name); |
| 2058 EngineTestCase.assertSize(0, declaration.members); | 1121 EngineTestCase.assertSize(0, declaration.members); |
| 2059 } | 1122 } |
| 2060 void test_parseCompilationUnitMember_constVariable() { | 1123 void test_parseCompilationUnitMember_constVariable() { |
| 2061 TopLevelVariableDeclaration declaration = ParserTestCase.parse("parseCompila
tionUnitMember", <Object> [emptyCommentAndMetadata()], "const int x = 0;"); | 1124 TopLevelVariableDeclaration declaration = ParserTestCase.parse("parseCompila
tionUnitMember", <Object> [emptyCommentAndMetadata()], "const int x = 0;"); |
| 2062 JUnitTestCase.assertNotNull(declaration.semicolon); | 1125 JUnitTestCase.assertNotNull(declaration.semicolon); |
| 2063 JUnitTestCase.assertNotNull(declaration.variables); | 1126 JUnitTestCase.assertNotNull(declaration.variables); |
| 2064 } | 1127 } |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2185 FunctionTypeAlias typeAlias = ParserTestCase.parse("parseCompilationUnitMemb
er", <Object> [emptyCommentAndMetadata()], "typedef F();"); | 1248 FunctionTypeAlias typeAlias = ParserTestCase.parse("parseCompilationUnitMemb
er", <Object> [emptyCommentAndMetadata()], "typedef F();"); |
| 2186 JUnitTestCase.assertEquals("F", typeAlias.name.name); | 1249 JUnitTestCase.assertEquals("F", typeAlias.name.name); |
| 2187 EngineTestCase.assertSize(0, typeAlias.parameters.parameters); | 1250 EngineTestCase.assertSize(0, typeAlias.parameters.parameters); |
| 2188 } | 1251 } |
| 2189 void test_parseCompilationUnitMember_variable() { | 1252 void test_parseCompilationUnitMember_variable() { |
| 2190 TopLevelVariableDeclaration declaration = ParserTestCase.parse("parseCompila
tionUnitMember", <Object> [emptyCommentAndMetadata()], "var x = 0;"); | 1253 TopLevelVariableDeclaration declaration = ParserTestCase.parse("parseCompila
tionUnitMember", <Object> [emptyCommentAndMetadata()], "var x = 0;"); |
| 2191 JUnitTestCase.assertNotNull(declaration.semicolon); | 1254 JUnitTestCase.assertNotNull(declaration.semicolon); |
| 2192 JUnitTestCase.assertNotNull(declaration.variables); | 1255 JUnitTestCase.assertNotNull(declaration.variables); |
| 2193 } | 1256 } |
| 2194 void test_parseConditionalExpression() { | 1257 void test_parseConditionalExpression() { |
| 2195 ConditionalExpression expression = ParserTestCase.parse5("parseConditionalEx
pression", "x ? y : z", []); | 1258 ConditionalExpression expression = ParserTestCase.parse6("parseConditionalEx
pression", "x ? y : z", []); |
| 2196 JUnitTestCase.assertNotNull(expression.condition); | 1259 JUnitTestCase.assertNotNull(expression.condition); |
| 2197 JUnitTestCase.assertNotNull(expression.question); | 1260 JUnitTestCase.assertNotNull(expression.question); |
| 2198 JUnitTestCase.assertNotNull(expression.thenExpression); | 1261 JUnitTestCase.assertNotNull(expression.thenExpression); |
| 2199 JUnitTestCase.assertNotNull(expression.colon); | 1262 JUnitTestCase.assertNotNull(expression.colon); |
| 2200 JUnitTestCase.assertNotNull(expression.elseExpression); | 1263 JUnitTestCase.assertNotNull(expression.elseExpression); |
| 2201 } | 1264 } |
| 2202 void test_parseConstExpression_instanceCreation() { | 1265 void test_parseConstExpression_instanceCreation() { |
| 2203 InstanceCreationExpression expression = ParserTestCase.parse5("parseConstExp
ression", "const A()", []); | 1266 InstanceCreationExpression expression = ParserTestCase.parse6("parseConstExp
ression", "const A()", []); |
| 2204 JUnitTestCase.assertNotNull(expression.keyword); | 1267 JUnitTestCase.assertNotNull(expression.keyword); |
| 2205 ConstructorName name = expression.constructorName; | 1268 ConstructorName name = expression.constructorName; |
| 2206 JUnitTestCase.assertNotNull(name); | 1269 JUnitTestCase.assertNotNull(name); |
| 2207 JUnitTestCase.assertNotNull(name.type); | 1270 JUnitTestCase.assertNotNull(name.type); |
| 2208 JUnitTestCase.assertNull(name.period); | 1271 JUnitTestCase.assertNull(name.period); |
| 2209 JUnitTestCase.assertNull(name.name); | 1272 JUnitTestCase.assertNull(name.name); |
| 2210 JUnitTestCase.assertNotNull(expression.argumentList); | 1273 JUnitTestCase.assertNotNull(expression.argumentList); |
| 2211 } | 1274 } |
| 2212 void test_parseConstExpression_listLiteral_typed() { | 1275 void test_parseConstExpression_listLiteral_typed() { |
| 2213 ListLiteral literal = ParserTestCase.parse5("parseConstExpression", "const <
A> []", []); | 1276 ListLiteral literal = ParserTestCase.parse6("parseConstExpression", "const <
A> []", []); |
| 2214 JUnitTestCase.assertNotNull(literal.modifier); | 1277 JUnitTestCase.assertNotNull(literal.modifier); |
| 2215 JUnitTestCase.assertNotNull(literal.typeArguments); | 1278 JUnitTestCase.assertNotNull(literal.typeArguments); |
| 2216 JUnitTestCase.assertNotNull(literal.leftBracket); | 1279 JUnitTestCase.assertNotNull(literal.leftBracket); |
| 2217 EngineTestCase.assertSize(0, literal.elements); | 1280 EngineTestCase.assertSize(0, literal.elements); |
| 2218 JUnitTestCase.assertNotNull(literal.rightBracket); | 1281 JUnitTestCase.assertNotNull(literal.rightBracket); |
| 2219 } | 1282 } |
| 2220 void test_parseConstExpression_listLiteral_untyped() { | 1283 void test_parseConstExpression_listLiteral_untyped() { |
| 2221 ListLiteral literal = ParserTestCase.parse5("parseConstExpression", "const [
]", []); | 1284 ListLiteral literal = ParserTestCase.parse6("parseConstExpression", "const [
]", []); |
| 2222 JUnitTestCase.assertNotNull(literal.modifier); | 1285 JUnitTestCase.assertNotNull(literal.modifier); |
| 2223 JUnitTestCase.assertNull(literal.typeArguments); | 1286 JUnitTestCase.assertNull(literal.typeArguments); |
| 2224 JUnitTestCase.assertNotNull(literal.leftBracket); | 1287 JUnitTestCase.assertNotNull(literal.leftBracket); |
| 2225 EngineTestCase.assertSize(0, literal.elements); | 1288 EngineTestCase.assertSize(0, literal.elements); |
| 2226 JUnitTestCase.assertNotNull(literal.rightBracket); | 1289 JUnitTestCase.assertNotNull(literal.rightBracket); |
| 2227 } | 1290 } |
| 2228 void test_parseConstExpression_mapLiteral_typed() { | 1291 void test_parseConstExpression_mapLiteral_typed() { |
| 2229 MapLiteral literal = ParserTestCase.parse5("parseConstExpression", "const <A
> {}", []); | 1292 MapLiteral literal = ParserTestCase.parse6("parseConstExpression", "const <A
> {}", []); |
| 2230 JUnitTestCase.assertNotNull(literal.leftBracket); | 1293 JUnitTestCase.assertNotNull(literal.leftBracket); |
| 2231 EngineTestCase.assertSize(0, literal.entries); | 1294 EngineTestCase.assertSize(0, literal.entries); |
| 2232 JUnitTestCase.assertNotNull(literal.rightBracket); | 1295 JUnitTestCase.assertNotNull(literal.rightBracket); |
| 2233 JUnitTestCase.assertNotNull(literal.typeArguments); | 1296 JUnitTestCase.assertNotNull(literal.typeArguments); |
| 2234 } | 1297 } |
| 2235 void test_parseConstExpression_mapLiteral_untyped() { | 1298 void test_parseConstExpression_mapLiteral_untyped() { |
| 2236 MapLiteral literal = ParserTestCase.parse5("parseConstExpression", "const {}
", []); | 1299 MapLiteral literal = ParserTestCase.parse6("parseConstExpression", "const {}
", []); |
| 2237 JUnitTestCase.assertNotNull(literal.leftBracket); | 1300 JUnitTestCase.assertNotNull(literal.leftBracket); |
| 2238 EngineTestCase.assertSize(0, literal.entries); | 1301 EngineTestCase.assertSize(0, literal.entries); |
| 2239 JUnitTestCase.assertNotNull(literal.rightBracket); | 1302 JUnitTestCase.assertNotNull(literal.rightBracket); |
| 2240 JUnitTestCase.assertNull(literal.typeArguments); | 1303 JUnitTestCase.assertNull(literal.typeArguments); |
| 2241 } | 1304 } |
| 2242 void test_parseConstructor() { | 1305 void test_parseConstructor() { |
| 2243 } | 1306 } |
| 2244 void test_parseConstructorFieldInitializer_qualified() { | 1307 void test_parseConstructorFieldInitializer_qualified() { |
| 2245 ConstructorFieldInitializer invocation = ParserTestCase.parse5("parseConstru
ctorFieldInitializer", "this.a = b", []); | 1308 ConstructorFieldInitializer invocation = ParserTestCase.parse6("parseConstru
ctorFieldInitializer", "this.a = b", []); |
| 2246 JUnitTestCase.assertNotNull(invocation.equals); | 1309 JUnitTestCase.assertNotNull(invocation.equals); |
| 2247 JUnitTestCase.assertNotNull(invocation.expression); | 1310 JUnitTestCase.assertNotNull(invocation.expression); |
| 2248 JUnitTestCase.assertNotNull(invocation.fieldName); | 1311 JUnitTestCase.assertNotNull(invocation.fieldName); |
| 2249 JUnitTestCase.assertNotNull(invocation.keyword); | 1312 JUnitTestCase.assertNotNull(invocation.keyword); |
| 2250 JUnitTestCase.assertNotNull(invocation.period); | 1313 JUnitTestCase.assertNotNull(invocation.period); |
| 2251 } | 1314 } |
| 2252 void test_parseConstructorFieldInitializer_unqualified() { | 1315 void test_parseConstructorFieldInitializer_unqualified() { |
| 2253 ConstructorFieldInitializer invocation = ParserTestCase.parse5("parseConstru
ctorFieldInitializer", "a = b", []); | 1316 ConstructorFieldInitializer invocation = ParserTestCase.parse6("parseConstru
ctorFieldInitializer", "a = b", []); |
| 2254 JUnitTestCase.assertNotNull(invocation.equals); | 1317 JUnitTestCase.assertNotNull(invocation.equals); |
| 2255 JUnitTestCase.assertNotNull(invocation.expression); | 1318 JUnitTestCase.assertNotNull(invocation.expression); |
| 2256 JUnitTestCase.assertNotNull(invocation.fieldName); | 1319 JUnitTestCase.assertNotNull(invocation.fieldName); |
| 2257 JUnitTestCase.assertNull(invocation.keyword); | 1320 JUnitTestCase.assertNull(invocation.keyword); |
| 2258 JUnitTestCase.assertNull(invocation.period); | 1321 JUnitTestCase.assertNull(invocation.period); |
| 2259 } | 1322 } |
| 2260 void test_parseConstructorName_named_noPrefix() { | 1323 void test_parseConstructorName_named_noPrefix() { |
| 2261 ConstructorName name = ParserTestCase.parse5("parseConstructorName", "A.n;",
[]); | 1324 ConstructorName name = ParserTestCase.parse6("parseConstructorName", "A.n;",
[]); |
| 2262 JUnitTestCase.assertNotNull(name.type); | 1325 JUnitTestCase.assertNotNull(name.type); |
| 2263 JUnitTestCase.assertNull(name.period); | 1326 JUnitTestCase.assertNull(name.period); |
| 2264 JUnitTestCase.assertNull(name.name); | 1327 JUnitTestCase.assertNull(name.name); |
| 2265 } | 1328 } |
| 2266 void test_parseConstructorName_named_prefixed() { | 1329 void test_parseConstructorName_named_prefixed() { |
| 2267 ConstructorName name = ParserTestCase.parse5("parseConstructorName", "p.A.n;
", []); | 1330 ConstructorName name = ParserTestCase.parse6("parseConstructorName", "p.A.n;
", []); |
| 2268 JUnitTestCase.assertNotNull(name.type); | 1331 JUnitTestCase.assertNotNull(name.type); |
| 2269 JUnitTestCase.assertNotNull(name.period); | 1332 JUnitTestCase.assertNotNull(name.period); |
| 2270 JUnitTestCase.assertNotNull(name.name); | 1333 JUnitTestCase.assertNotNull(name.name); |
| 2271 } | 1334 } |
| 2272 void test_parseConstructorName_unnamed_noPrefix() { | 1335 void test_parseConstructorName_unnamed_noPrefix() { |
| 2273 ConstructorName name = ParserTestCase.parse5("parseConstructorName", "A;", [
]); | 1336 ConstructorName name = ParserTestCase.parse6("parseConstructorName", "A;", [
]); |
| 2274 JUnitTestCase.assertNotNull(name.type); | 1337 JUnitTestCase.assertNotNull(name.type); |
| 2275 JUnitTestCase.assertNull(name.period); | 1338 JUnitTestCase.assertNull(name.period); |
| 2276 JUnitTestCase.assertNull(name.name); | 1339 JUnitTestCase.assertNull(name.name); |
| 2277 } | 1340 } |
| 2278 void test_parseConstructorName_unnamed_prefixed() { | 1341 void test_parseConstructorName_unnamed_prefixed() { |
| 2279 ConstructorName name = ParserTestCase.parse5("parseConstructorName", "p.A;",
[]); | 1342 ConstructorName name = ParserTestCase.parse6("parseConstructorName", "p.A;",
[]); |
| 2280 JUnitTestCase.assertNotNull(name.type); | 1343 JUnitTestCase.assertNotNull(name.type); |
| 2281 JUnitTestCase.assertNull(name.period); | 1344 JUnitTestCase.assertNull(name.period); |
| 2282 JUnitTestCase.assertNull(name.name); | 1345 JUnitTestCase.assertNull(name.name); |
| 2283 } | 1346 } |
| 2284 void test_parseContinueStatement_label() { | 1347 void test_parseContinueStatement_label() { |
| 2285 ContinueStatement statement = ParserTestCase.parse5("parseContinueStatement"
, "continue foo;", [ParserErrorCode.CONTINUE_OUTSIDE_OF_LOOP]); | 1348 ContinueStatement statement = ParserTestCase.parse6("parseContinueStatement"
, "continue foo;", [ParserErrorCode.CONTINUE_OUTSIDE_OF_LOOP]); |
| 2286 JUnitTestCase.assertNotNull(statement.keyword); | 1349 JUnitTestCase.assertNotNull(statement.keyword); |
| 2287 JUnitTestCase.assertNotNull(statement.label); | 1350 JUnitTestCase.assertNotNull(statement.label); |
| 2288 JUnitTestCase.assertNotNull(statement.semicolon); | 1351 JUnitTestCase.assertNotNull(statement.semicolon); |
| 2289 } | 1352 } |
| 2290 void test_parseContinueStatement_noLabel() { | 1353 void test_parseContinueStatement_noLabel() { |
| 2291 ContinueStatement statement = ParserTestCase.parse5("parseContinueStatement"
, "continue;", [ParserErrorCode.CONTINUE_OUTSIDE_OF_LOOP]); | 1354 ContinueStatement statement = ParserTestCase.parse6("parseContinueStatement"
, "continue;", [ParserErrorCode.CONTINUE_OUTSIDE_OF_LOOP]); |
| 2292 JUnitTestCase.assertNotNull(statement.keyword); | 1355 JUnitTestCase.assertNotNull(statement.keyword); |
| 2293 JUnitTestCase.assertNull(statement.label); | 1356 JUnitTestCase.assertNull(statement.label); |
| 2294 JUnitTestCase.assertNotNull(statement.semicolon); | 1357 JUnitTestCase.assertNotNull(statement.semicolon); |
| 2295 } | 1358 } |
| 2296 void test_parseDirective_export() { | 1359 void test_parseDirective_export() { |
| 2297 ExportDirective directive = ParserTestCase.parse("parseDirective", <Object>
[emptyCommentAndMetadata()], "export 'lib/lib.dart';"); | 1360 ExportDirective directive = ParserTestCase.parse("parseDirective", <Object>
[emptyCommentAndMetadata()], "export 'lib/lib.dart';"); |
| 2298 JUnitTestCase.assertNotNull(directive.keyword); | 1361 JUnitTestCase.assertNotNull(directive.keyword); |
| 2299 JUnitTestCase.assertNotNull(directive.uri); | 1362 JUnitTestCase.assertNotNull(directive.uri); |
| 2300 EngineTestCase.assertSize(0, directive.combinators); | 1363 EngineTestCase.assertSize(0, directive.combinators); |
| 2301 JUnitTestCase.assertNotNull(directive.semicolon); | 1364 JUnitTestCase.assertNotNull(directive.semicolon); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 2322 JUnitTestCase.assertNotNull(directive.semicolon); | 1385 JUnitTestCase.assertNotNull(directive.semicolon); |
| 2323 } | 1386 } |
| 2324 void test_parseDirective_partOf() { | 1387 void test_parseDirective_partOf() { |
| 2325 PartOfDirective directive = ParserTestCase.parse("parseDirective", <Object>
[emptyCommentAndMetadata()], "part of l;"); | 1388 PartOfDirective directive = ParserTestCase.parse("parseDirective", <Object>
[emptyCommentAndMetadata()], "part of l;"); |
| 2326 JUnitTestCase.assertNotNull(directive.partToken); | 1389 JUnitTestCase.assertNotNull(directive.partToken); |
| 2327 JUnitTestCase.assertNotNull(directive.ofToken); | 1390 JUnitTestCase.assertNotNull(directive.ofToken); |
| 2328 JUnitTestCase.assertNotNull(directive.libraryName); | 1391 JUnitTestCase.assertNotNull(directive.libraryName); |
| 2329 JUnitTestCase.assertNotNull(directive.semicolon); | 1392 JUnitTestCase.assertNotNull(directive.semicolon); |
| 2330 } | 1393 } |
| 2331 void test_parseDocumentationComment_block() { | 1394 void test_parseDocumentationComment_block() { |
| 2332 Comment comment = ParserTestCase.parse5("parseDocumentationComment", "/** */
class", []); | 1395 Comment comment = ParserTestCase.parse6("parseDocumentationComment", "/** */
class", []); |
| 2333 JUnitTestCase.assertFalse(comment.isBlock()); | 1396 JUnitTestCase.assertFalse(comment.isBlock()); |
| 2334 JUnitTestCase.assertTrue(comment.isDocumentation()); | 1397 JUnitTestCase.assertTrue(comment.isDocumentation()); |
| 2335 JUnitTestCase.assertFalse(comment.isEndOfLine()); | 1398 JUnitTestCase.assertFalse(comment.isEndOfLine()); |
| 2336 } | 1399 } |
| 2337 void test_parseDocumentationComment_block_withReference() { | 1400 void test_parseDocumentationComment_block_withReference() { |
| 2338 Comment comment = ParserTestCase.parse5("parseDocumentationComment", "/** [a
] */ class", []); | 1401 Comment comment = ParserTestCase.parse6("parseDocumentationComment", "/** [a
] */ class", []); |
| 2339 JUnitTestCase.assertFalse(comment.isBlock()); | 1402 JUnitTestCase.assertFalse(comment.isBlock()); |
| 2340 JUnitTestCase.assertTrue(comment.isDocumentation()); | 1403 JUnitTestCase.assertTrue(comment.isDocumentation()); |
| 2341 JUnitTestCase.assertFalse(comment.isEndOfLine()); | 1404 JUnitTestCase.assertFalse(comment.isEndOfLine()); |
| 2342 NodeList<CommentReference> references2 = comment.references; | 1405 NodeList<CommentReference> references2 = comment.references; |
| 2343 EngineTestCase.assertSize(1, references2); | 1406 EngineTestCase.assertSize(1, references2); |
| 2344 CommentReference reference = references2[0]; | 1407 CommentReference reference = references2[0]; |
| 2345 JUnitTestCase.assertNotNull(reference); | 1408 JUnitTestCase.assertNotNull(reference); |
| 2346 JUnitTestCase.assertEquals(5, reference.offset); | 1409 JUnitTestCase.assertEquals(5, reference.offset); |
| 2347 } | 1410 } |
| 2348 void test_parseDocumentationComment_endOfLine() { | 1411 void test_parseDocumentationComment_endOfLine() { |
| 2349 Comment comment = ParserTestCase.parse5("parseDocumentationComment", "/// \n
/// \n class", []); | 1412 Comment comment = ParserTestCase.parse6("parseDocumentationComment", "/// \n
/// \n class", []); |
| 2350 JUnitTestCase.assertFalse(comment.isBlock()); | 1413 JUnitTestCase.assertFalse(comment.isBlock()); |
| 2351 JUnitTestCase.assertTrue(comment.isDocumentation()); | 1414 JUnitTestCase.assertTrue(comment.isDocumentation()); |
| 2352 JUnitTestCase.assertFalse(comment.isEndOfLine()); | 1415 JUnitTestCase.assertFalse(comment.isEndOfLine()); |
| 2353 } | 1416 } |
| 2354 void test_parseDoStatement() { | 1417 void test_parseDoStatement() { |
| 2355 DoStatement statement = ParserTestCase.parse5("parseDoStatement", "do {} whi
le (x);", []); | 1418 DoStatement statement = ParserTestCase.parse6("parseDoStatement", "do {} whi
le (x);", []); |
| 2356 JUnitTestCase.assertNotNull(statement.doKeyword); | 1419 JUnitTestCase.assertNotNull(statement.doKeyword); |
| 2357 JUnitTestCase.assertNotNull(statement.body); | 1420 JUnitTestCase.assertNotNull(statement.body); |
| 2358 JUnitTestCase.assertNotNull(statement.whileKeyword); | 1421 JUnitTestCase.assertNotNull(statement.whileKeyword); |
| 2359 JUnitTestCase.assertNotNull(statement.leftParenthesis); | 1422 JUnitTestCase.assertNotNull(statement.leftParenthesis); |
| 2360 JUnitTestCase.assertNotNull(statement.condition); | 1423 JUnitTestCase.assertNotNull(statement.condition); |
| 2361 JUnitTestCase.assertNotNull(statement.rightParenthesis); | 1424 JUnitTestCase.assertNotNull(statement.rightParenthesis); |
| 2362 JUnitTestCase.assertNotNull(statement.semicolon); | 1425 JUnitTestCase.assertNotNull(statement.semicolon); |
| 2363 } | 1426 } |
| 2364 void test_parseEmptyStatement() { | 1427 void test_parseEmptyStatement() { |
| 2365 EmptyStatement statement = ParserTestCase.parse5("parseEmptyStatement", ";",
[]); | 1428 EmptyStatement statement = ParserTestCase.parse6("parseEmptyStatement", ";",
[]); |
| 2366 JUnitTestCase.assertNotNull(statement.semicolon); | 1429 JUnitTestCase.assertNotNull(statement.semicolon); |
| 2367 } | 1430 } |
| 2368 void test_parseEqualityExpression_normal() { | 1431 void test_parseEqualityExpression_normal() { |
| 2369 BinaryExpression expression = ParserTestCase.parse5("parseEqualityExpression
", "x == y", []); | 1432 BinaryExpression expression = ParserTestCase.parse6("parseEqualityExpression
", "x == y", []); |
| 2370 JUnitTestCase.assertNotNull(expression.leftOperand); | 1433 JUnitTestCase.assertNotNull(expression.leftOperand); |
| 2371 JUnitTestCase.assertNotNull(expression.operator); | 1434 JUnitTestCase.assertNotNull(expression.operator); |
| 2372 JUnitTestCase.assertEquals(TokenType.EQ_EQ, expression.operator.type); | 1435 JUnitTestCase.assertEquals(TokenType.EQ_EQ, expression.operator.type); |
| 2373 JUnitTestCase.assertNotNull(expression.rightOperand); | 1436 JUnitTestCase.assertNotNull(expression.rightOperand); |
| 2374 } | 1437 } |
| 2375 void test_parseEqualityExpression_super() { | 1438 void test_parseEqualityExpression_super() { |
| 2376 BinaryExpression expression = ParserTestCase.parse5("parseEqualityExpression
", "super == y", []); | 1439 BinaryExpression expression = ParserTestCase.parse6("parseEqualityExpression
", "super == y", []); |
| 2377 EngineTestCase.assertInstanceOf(SuperExpression, expression.leftOperand); | 1440 EngineTestCase.assertInstanceOf(SuperExpression, expression.leftOperand); |
| 2378 JUnitTestCase.assertNotNull(expression.operator); | 1441 JUnitTestCase.assertNotNull(expression.operator); |
| 2379 JUnitTestCase.assertEquals(TokenType.EQ_EQ, expression.operator.type); | 1442 JUnitTestCase.assertEquals(TokenType.EQ_EQ, expression.operator.type); |
| 2380 JUnitTestCase.assertNotNull(expression.rightOperand); | 1443 JUnitTestCase.assertNotNull(expression.rightOperand); |
| 2381 } | 1444 } |
| 2382 void test_parseExportDirective_hide() { | 1445 void test_parseExportDirective_hide() { |
| 2383 ExportDirective directive = ParserTestCase.parse("parseExportDirective", <Ob
ject> [emptyCommentAndMetadata()], "export 'lib/lib.dart' hide A, B;"); | 1446 ExportDirective directive = ParserTestCase.parse("parseExportDirective", <Ob
ject> [emptyCommentAndMetadata()], "export 'lib/lib.dart' hide A, B;"); |
| 2384 JUnitTestCase.assertNotNull(directive.keyword); | 1447 JUnitTestCase.assertNotNull(directive.keyword); |
| 2385 JUnitTestCase.assertNotNull(directive.uri); | 1448 JUnitTestCase.assertNotNull(directive.uri); |
| 2386 EngineTestCase.assertSize(1, directive.combinators); | 1449 EngineTestCase.assertSize(1, directive.combinators); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 2408 JUnitTestCase.assertNotNull(directive.semicolon); | 1471 JUnitTestCase.assertNotNull(directive.semicolon); |
| 2409 } | 1472 } |
| 2410 void test_parseExportDirective_show_hide() { | 1473 void test_parseExportDirective_show_hide() { |
| 2411 ExportDirective directive = ParserTestCase.parse("parseExportDirective", <Ob
ject> [emptyCommentAndMetadata()], "export 'lib/lib.dart' show B hide A;"); | 1474 ExportDirective directive = ParserTestCase.parse("parseExportDirective", <Ob
ject> [emptyCommentAndMetadata()], "export 'lib/lib.dart' show B hide A;"); |
| 2412 JUnitTestCase.assertNotNull(directive.keyword); | 1475 JUnitTestCase.assertNotNull(directive.keyword); |
| 2413 JUnitTestCase.assertNotNull(directive.uri); | 1476 JUnitTestCase.assertNotNull(directive.uri); |
| 2414 EngineTestCase.assertSize(2, directive.combinators); | 1477 EngineTestCase.assertSize(2, directive.combinators); |
| 2415 JUnitTestCase.assertNotNull(directive.semicolon); | 1478 JUnitTestCase.assertNotNull(directive.semicolon); |
| 2416 } | 1479 } |
| 2417 void test_parseExpression_assign() { | 1480 void test_parseExpression_assign() { |
| 2418 AssignmentExpression expression = ParserTestCase.parse5("parseExpression", "
x = y", []); | 1481 AssignmentExpression expression = ParserTestCase.parse6("parseExpression", "
x = y", []); |
| 2419 JUnitTestCase.assertNotNull(expression.leftHandSide); | 1482 JUnitTestCase.assertNotNull(expression.leftHandSide); |
| 2420 JUnitTestCase.assertNotNull(expression.operator); | 1483 JUnitTestCase.assertNotNull(expression.operator); |
| 2421 JUnitTestCase.assertEquals(TokenType.EQ, expression.operator.type); | 1484 JUnitTestCase.assertEquals(TokenType.EQ, expression.operator.type); |
| 2422 JUnitTestCase.assertNotNull(expression.rightHandSide); | 1485 JUnitTestCase.assertNotNull(expression.rightHandSide); |
| 2423 } | 1486 } |
| 2424 void test_parseExpression_comparison() { | 1487 void test_parseExpression_comparison() { |
| 2425 BinaryExpression expression = ParserTestCase.parse5("parseExpression", "--a.
b == c", []); | 1488 BinaryExpression expression = ParserTestCase.parse6("parseExpression", "--a.
b == c", []); |
| 2426 JUnitTestCase.assertNotNull(expression.leftOperand); | 1489 JUnitTestCase.assertNotNull(expression.leftOperand); |
| 2427 JUnitTestCase.assertNotNull(expression.operator); | 1490 JUnitTestCase.assertNotNull(expression.operator); |
| 2428 JUnitTestCase.assertEquals(TokenType.EQ_EQ, expression.operator.type); | 1491 JUnitTestCase.assertEquals(TokenType.EQ_EQ, expression.operator.type); |
| 2429 JUnitTestCase.assertNotNull(expression.rightOperand); | 1492 JUnitTestCase.assertNotNull(expression.rightOperand); |
| 2430 } | 1493 } |
| 2431 void test_parseExpression_invokeFunctionExpression() { | 1494 void test_parseExpression_invokeFunctionExpression() { |
| 2432 FunctionExpressionInvocation invocation = ParserTestCase.parse5("parseExpres
sion", "(a) {return a + a;} (3)", []); | 1495 FunctionExpressionInvocation invocation = ParserTestCase.parse6("parseExpres
sion", "(a) {return a + a;} (3)", []); |
| 2433 EngineTestCase.assertInstanceOf(FunctionExpression, invocation.function); | 1496 EngineTestCase.assertInstanceOf(FunctionExpression, invocation.function); |
| 2434 FunctionExpression expression = (invocation.function as FunctionExpression); | 1497 FunctionExpression expression = invocation.function as FunctionExpression; |
| 2435 JUnitTestCase.assertNotNull(expression.parameters); | 1498 JUnitTestCase.assertNotNull(expression.parameters); |
| 2436 JUnitTestCase.assertNotNull(expression.body); | 1499 JUnitTestCase.assertNotNull(expression.body); |
| 2437 ArgumentList list = invocation.argumentList; | 1500 ArgumentList list = invocation.argumentList; |
| 2438 JUnitTestCase.assertNotNull(list); | 1501 JUnitTestCase.assertNotNull(list); |
| 2439 EngineTestCase.assertSize(1, list.arguments); | 1502 EngineTestCase.assertSize(1, list.arguments); |
| 2440 } | 1503 } |
| 2441 void test_parseExpression_superMethodInvocation() { | 1504 void test_parseExpression_superMethodInvocation() { |
| 2442 MethodInvocation invocation = ParserTestCase.parse5("parseExpression", "supe
r.m()", []); | 1505 MethodInvocation invocation = ParserTestCase.parse6("parseExpression", "supe
r.m()", []); |
| 2443 JUnitTestCase.assertNotNull(invocation.target); | 1506 JUnitTestCase.assertNotNull(invocation.target); |
| 2444 JUnitTestCase.assertNotNull(invocation.methodName); | 1507 JUnitTestCase.assertNotNull(invocation.methodName); |
| 2445 JUnitTestCase.assertNotNull(invocation.argumentList); | 1508 JUnitTestCase.assertNotNull(invocation.argumentList); |
| 2446 } | 1509 } |
| 2447 void test_parseExpressionList_multiple() { | 1510 void test_parseExpressionList_multiple() { |
| 2448 List<Expression> result = ParserTestCase.parse5("parseExpressionList", "1, 2
, 3", []); | 1511 List<Expression> result = ParserTestCase.parse6("parseExpressionList", "1, 2
, 3", []); |
| 2449 EngineTestCase.assertSize(3, result); | 1512 EngineTestCase.assertSize(3, result); |
| 2450 } | 1513 } |
| 2451 void test_parseExpressionList_single() { | 1514 void test_parseExpressionList_single() { |
| 2452 List<Expression> result = ParserTestCase.parse5("parseExpressionList", "1",
[]); | 1515 List<Expression> result = ParserTestCase.parse6("parseExpressionList", "1",
[]); |
| 2453 EngineTestCase.assertSize(1, result); | 1516 EngineTestCase.assertSize(1, result); |
| 2454 } | 1517 } |
| 2455 void test_parseExpressionWithoutCascade_assign() { | 1518 void test_parseExpressionWithoutCascade_assign() { |
| 2456 AssignmentExpression expression = ParserTestCase.parse5("parseExpressionWith
outCascade", "x = y", []); | 1519 AssignmentExpression expression = ParserTestCase.parse6("parseExpressionWith
outCascade", "x = y", []); |
| 2457 JUnitTestCase.assertNotNull(expression.leftHandSide); | 1520 JUnitTestCase.assertNotNull(expression.leftHandSide); |
| 2458 JUnitTestCase.assertNotNull(expression.operator); | 1521 JUnitTestCase.assertNotNull(expression.operator); |
| 2459 JUnitTestCase.assertEquals(TokenType.EQ, expression.operator.type); | 1522 JUnitTestCase.assertEquals(TokenType.EQ, expression.operator.type); |
| 2460 JUnitTestCase.assertNotNull(expression.rightHandSide); | 1523 JUnitTestCase.assertNotNull(expression.rightHandSide); |
| 2461 } | 1524 } |
| 2462 void test_parseExpressionWithoutCascade_comparison() { | 1525 void test_parseExpressionWithoutCascade_comparison() { |
| 2463 BinaryExpression expression = ParserTestCase.parse5("parseExpressionWithoutC
ascade", "--a.b == c", []); | 1526 BinaryExpression expression = ParserTestCase.parse6("parseExpressionWithoutC
ascade", "--a.b == c", []); |
| 2464 JUnitTestCase.assertNotNull(expression.leftOperand); | 1527 JUnitTestCase.assertNotNull(expression.leftOperand); |
| 2465 JUnitTestCase.assertNotNull(expression.operator); | 1528 JUnitTestCase.assertNotNull(expression.operator); |
| 2466 JUnitTestCase.assertEquals(TokenType.EQ_EQ, expression.operator.type); | 1529 JUnitTestCase.assertEquals(TokenType.EQ_EQ, expression.operator.type); |
| 2467 JUnitTestCase.assertNotNull(expression.rightOperand); | 1530 JUnitTestCase.assertNotNull(expression.rightOperand); |
| 2468 } | 1531 } |
| 2469 void test_parseExpressionWithoutCascade_superMethodInvocation() { | 1532 void test_parseExpressionWithoutCascade_superMethodInvocation() { |
| 2470 MethodInvocation invocation = ParserTestCase.parse5("parseExpressionWithoutC
ascade", "super.m()", []); | 1533 MethodInvocation invocation = ParserTestCase.parse6("parseExpressionWithoutC
ascade", "super.m()", []); |
| 2471 JUnitTestCase.assertNotNull(invocation.target); | 1534 JUnitTestCase.assertNotNull(invocation.target); |
| 2472 JUnitTestCase.assertNotNull(invocation.methodName); | 1535 JUnitTestCase.assertNotNull(invocation.methodName); |
| 2473 JUnitTestCase.assertNotNull(invocation.argumentList); | 1536 JUnitTestCase.assertNotNull(invocation.argumentList); |
| 2474 } | 1537 } |
| 2475 void test_parseExtendsClause() { | 1538 void test_parseExtendsClause() { |
| 2476 ExtendsClause clause = ParserTestCase.parse5("parseExtendsClause", "extends
B", []); | 1539 ExtendsClause clause = ParserTestCase.parse6("parseExtendsClause", "extends
B", []); |
| 2477 JUnitTestCase.assertNotNull(clause.keyword); | 1540 JUnitTestCase.assertNotNull(clause.keyword); |
| 2478 JUnitTestCase.assertNotNull(clause.superclass); | 1541 JUnitTestCase.assertNotNull(clause.superclass); |
| 2479 EngineTestCase.assertInstanceOf(TypeName, clause.superclass); | 1542 EngineTestCase.assertInstanceOf(TypeName, clause.superclass); |
| 2480 } | 1543 } |
| 2481 void test_parseFinalConstVarOrType_const_noType() { | 1544 void test_parseFinalConstVarOrType_const_noType() { |
| 2482 FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType"
, <Object> [false], "const"); | 1545 FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType"
, <Object> [false], "const"); |
| 2483 Token keyword29 = result.keyword; | 1546 Token keyword29 = result.keyword; |
| 2484 JUnitTestCase.assertNotNull(keyword29); | 1547 JUnitTestCase.assertNotNull(keyword29); |
| 2485 JUnitTestCase.assertEquals(TokenType.KEYWORD, keyword29.type); | 1548 JUnitTestCase.assertEquals(TokenType.KEYWORD, keyword29.type); |
| 2486 JUnitTestCase.assertEquals(Keyword.CONST, ((keyword29 as KeywordToken)).keyw
ord); | 1549 JUnitTestCase.assertEquals(Keyword.CONST, ((keyword29 as KeywordToken)).keyw
ord); |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2534 FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType"
, <Object> [false], "var"); | 1597 FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType"
, <Object> [false], "var"); |
| 2535 Token keyword33 = result.keyword; | 1598 Token keyword33 = result.keyword; |
| 2536 JUnitTestCase.assertNotNull(keyword33); | 1599 JUnitTestCase.assertNotNull(keyword33); |
| 2537 JUnitTestCase.assertEquals(TokenType.KEYWORD, keyword33.type); | 1600 JUnitTestCase.assertEquals(TokenType.KEYWORD, keyword33.type); |
| 2538 JUnitTestCase.assertEquals(Keyword.VAR, ((keyword33 as KeywordToken)).keywor
d); | 1601 JUnitTestCase.assertEquals(Keyword.VAR, ((keyword33 as KeywordToken)).keywor
d); |
| 2539 JUnitTestCase.assertNull(result.type); | 1602 JUnitTestCase.assertNull(result.type); |
| 2540 } | 1603 } |
| 2541 void test_parseFormalParameter_final_withType_named() { | 1604 void test_parseFormalParameter_final_withType_named() { |
| 2542 ParameterKind kind = ParameterKind.NAMED; | 1605 ParameterKind kind = ParameterKind.NAMED; |
| 2543 DefaultFormalParameter parameter = ParserTestCase.parse("parseFormalParamete
r", <Object> [kind], "final A a : null"); | 1606 DefaultFormalParameter parameter = ParserTestCase.parse("parseFormalParamete
r", <Object> [kind], "final A a : null"); |
| 2544 SimpleFormalParameter simpleParameter = (parameter.parameter as SimpleFormal
Parameter); | 1607 SimpleFormalParameter simpleParameter = parameter.parameter as SimpleFormalP
arameter; |
| 2545 JUnitTestCase.assertNotNull(simpleParameter.identifier); | 1608 JUnitTestCase.assertNotNull(simpleParameter.identifier); |
| 2546 JUnitTestCase.assertNotNull(simpleParameter.keyword); | 1609 JUnitTestCase.assertNotNull(simpleParameter.keyword); |
| 2547 JUnitTestCase.assertNotNull(simpleParameter.type); | 1610 JUnitTestCase.assertNotNull(simpleParameter.type); |
| 2548 JUnitTestCase.assertEquals(kind, simpleParameter.kind); | 1611 JUnitTestCase.assertEquals(kind, simpleParameter.kind); |
| 2549 JUnitTestCase.assertNotNull(parameter.separator); | 1612 JUnitTestCase.assertNotNull(parameter.separator); |
| 2550 JUnitTestCase.assertNotNull(parameter.defaultValue); | 1613 JUnitTestCase.assertNotNull(parameter.defaultValue); |
| 2551 JUnitTestCase.assertEquals(kind, parameter.kind); | 1614 JUnitTestCase.assertEquals(kind, parameter.kind); |
| 2552 } | 1615 } |
| 2553 void test_parseFormalParameter_final_withType_normal() { | 1616 void test_parseFormalParameter_final_withType_normal() { |
| 2554 ParameterKind kind = ParameterKind.REQUIRED; | 1617 ParameterKind kind = ParameterKind.REQUIRED; |
| 2555 SimpleFormalParameter parameter = ParserTestCase.parse("parseFormalParameter
", <Object> [kind], "final A a"); | 1618 SimpleFormalParameter parameter = ParserTestCase.parse("parseFormalParameter
", <Object> [kind], "final A a"); |
| 2556 JUnitTestCase.assertNotNull(parameter.identifier); | 1619 JUnitTestCase.assertNotNull(parameter.identifier); |
| 2557 JUnitTestCase.assertNotNull(parameter.keyword); | 1620 JUnitTestCase.assertNotNull(parameter.keyword); |
| 2558 JUnitTestCase.assertNotNull(parameter.type); | 1621 JUnitTestCase.assertNotNull(parameter.type); |
| 2559 JUnitTestCase.assertEquals(kind, parameter.kind); | 1622 JUnitTestCase.assertEquals(kind, parameter.kind); |
| 2560 } | 1623 } |
| 2561 void test_parseFormalParameter_final_withType_positional() { | 1624 void test_parseFormalParameter_final_withType_positional() { |
| 2562 ParameterKind kind = ParameterKind.POSITIONAL; | 1625 ParameterKind kind = ParameterKind.POSITIONAL; |
| 2563 DefaultFormalParameter parameter = ParserTestCase.parse("parseFormalParamete
r", <Object> [kind], "final A a = null"); | 1626 DefaultFormalParameter parameter = ParserTestCase.parse("parseFormalParamete
r", <Object> [kind], "final A a = null"); |
| 2564 SimpleFormalParameter simpleParameter = (parameter.parameter as SimpleFormal
Parameter); | 1627 SimpleFormalParameter simpleParameter = parameter.parameter as SimpleFormalP
arameter; |
| 2565 JUnitTestCase.assertNotNull(simpleParameter.identifier); | 1628 JUnitTestCase.assertNotNull(simpleParameter.identifier); |
| 2566 JUnitTestCase.assertNotNull(simpleParameter.keyword); | 1629 JUnitTestCase.assertNotNull(simpleParameter.keyword); |
| 2567 JUnitTestCase.assertNotNull(simpleParameter.type); | 1630 JUnitTestCase.assertNotNull(simpleParameter.type); |
| 2568 JUnitTestCase.assertEquals(kind, simpleParameter.kind); | 1631 JUnitTestCase.assertEquals(kind, simpleParameter.kind); |
| 2569 JUnitTestCase.assertNotNull(parameter.separator); | 1632 JUnitTestCase.assertNotNull(parameter.separator); |
| 2570 JUnitTestCase.assertNotNull(parameter.defaultValue); | 1633 JUnitTestCase.assertNotNull(parameter.defaultValue); |
| 2571 JUnitTestCase.assertEquals(kind, parameter.kind); | 1634 JUnitTestCase.assertEquals(kind, parameter.kind); |
| 2572 } | 1635 } |
| 2573 void test_parseFormalParameter_nonFinal_withType_named() { | 1636 void test_parseFormalParameter_nonFinal_withType_named() { |
| 2574 ParameterKind kind = ParameterKind.NAMED; | 1637 ParameterKind kind = ParameterKind.NAMED; |
| 2575 DefaultFormalParameter parameter = ParserTestCase.parse("parseFormalParamete
r", <Object> [kind], "A a : null"); | 1638 DefaultFormalParameter parameter = ParserTestCase.parse("parseFormalParamete
r", <Object> [kind], "A a : null"); |
| 2576 SimpleFormalParameter simpleParameter = (parameter.parameter as SimpleFormal
Parameter); | 1639 SimpleFormalParameter simpleParameter = parameter.parameter as SimpleFormalP
arameter; |
| 2577 JUnitTestCase.assertNotNull(simpleParameter.identifier); | 1640 JUnitTestCase.assertNotNull(simpleParameter.identifier); |
| 2578 JUnitTestCase.assertNull(simpleParameter.keyword); | 1641 JUnitTestCase.assertNull(simpleParameter.keyword); |
| 2579 JUnitTestCase.assertNotNull(simpleParameter.type); | 1642 JUnitTestCase.assertNotNull(simpleParameter.type); |
| 2580 JUnitTestCase.assertEquals(kind, simpleParameter.kind); | 1643 JUnitTestCase.assertEquals(kind, simpleParameter.kind); |
| 2581 JUnitTestCase.assertNotNull(parameter.separator); | 1644 JUnitTestCase.assertNotNull(parameter.separator); |
| 2582 JUnitTestCase.assertNotNull(parameter.defaultValue); | 1645 JUnitTestCase.assertNotNull(parameter.defaultValue); |
| 2583 JUnitTestCase.assertEquals(kind, parameter.kind); | 1646 JUnitTestCase.assertEquals(kind, parameter.kind); |
| 2584 } | 1647 } |
| 2585 void test_parseFormalParameter_nonFinal_withType_normal() { | 1648 void test_parseFormalParameter_nonFinal_withType_normal() { |
| 2586 ParameterKind kind = ParameterKind.REQUIRED; | 1649 ParameterKind kind = ParameterKind.REQUIRED; |
| 2587 SimpleFormalParameter parameter = ParserTestCase.parse("parseFormalParameter
", <Object> [kind], "A a"); | 1650 SimpleFormalParameter parameter = ParserTestCase.parse("parseFormalParameter
", <Object> [kind], "A a"); |
| 2588 JUnitTestCase.assertNotNull(parameter.identifier); | 1651 JUnitTestCase.assertNotNull(parameter.identifier); |
| 2589 JUnitTestCase.assertNull(parameter.keyword); | 1652 JUnitTestCase.assertNull(parameter.keyword); |
| 2590 JUnitTestCase.assertNotNull(parameter.type); | 1653 JUnitTestCase.assertNotNull(parameter.type); |
| 2591 JUnitTestCase.assertEquals(kind, parameter.kind); | 1654 JUnitTestCase.assertEquals(kind, parameter.kind); |
| 2592 } | 1655 } |
| 2593 void test_parseFormalParameter_nonFinal_withType_positional() { | 1656 void test_parseFormalParameter_nonFinal_withType_positional() { |
| 2594 ParameterKind kind = ParameterKind.POSITIONAL; | 1657 ParameterKind kind = ParameterKind.POSITIONAL; |
| 2595 DefaultFormalParameter parameter = ParserTestCase.parse("parseFormalParamete
r", <Object> [kind], "A a = null"); | 1658 DefaultFormalParameter parameter = ParserTestCase.parse("parseFormalParamete
r", <Object> [kind], "A a = null"); |
| 2596 SimpleFormalParameter simpleParameter = (parameter.parameter as SimpleFormal
Parameter); | 1659 SimpleFormalParameter simpleParameter = parameter.parameter as SimpleFormalP
arameter; |
| 2597 JUnitTestCase.assertNotNull(simpleParameter.identifier); | 1660 JUnitTestCase.assertNotNull(simpleParameter.identifier); |
| 2598 JUnitTestCase.assertNull(simpleParameter.keyword); | 1661 JUnitTestCase.assertNull(simpleParameter.keyword); |
| 2599 JUnitTestCase.assertNotNull(simpleParameter.type); | 1662 JUnitTestCase.assertNotNull(simpleParameter.type); |
| 2600 JUnitTestCase.assertEquals(kind, simpleParameter.kind); | 1663 JUnitTestCase.assertEquals(kind, simpleParameter.kind); |
| 2601 JUnitTestCase.assertNotNull(parameter.separator); | 1664 JUnitTestCase.assertNotNull(parameter.separator); |
| 2602 JUnitTestCase.assertNotNull(parameter.defaultValue); | 1665 JUnitTestCase.assertNotNull(parameter.defaultValue); |
| 2603 JUnitTestCase.assertEquals(kind, parameter.kind); | 1666 JUnitTestCase.assertEquals(kind, parameter.kind); |
| 2604 } | 1667 } |
| 2605 void test_parseFormalParameter_var() { | 1668 void test_parseFormalParameter_var() { |
| 2606 ParameterKind kind = ParameterKind.REQUIRED; | 1669 ParameterKind kind = ParameterKind.REQUIRED; |
| 2607 SimpleFormalParameter parameter = ParserTestCase.parse("parseFormalParameter
", <Object> [kind], "var a"); | 1670 SimpleFormalParameter parameter = ParserTestCase.parse("parseFormalParameter
", <Object> [kind], "var a"); |
| 2608 JUnitTestCase.assertNotNull(parameter.identifier); | 1671 JUnitTestCase.assertNotNull(parameter.identifier); |
| 2609 JUnitTestCase.assertNotNull(parameter.keyword); | 1672 JUnitTestCase.assertNotNull(parameter.keyword); |
| 2610 JUnitTestCase.assertNull(parameter.type); | 1673 JUnitTestCase.assertNull(parameter.type); |
| 2611 JUnitTestCase.assertEquals(kind, parameter.kind); | 1674 JUnitTestCase.assertEquals(kind, parameter.kind); |
| 2612 } | 1675 } |
| 2613 void test_parseFormalParameter_var_named() { | 1676 void test_parseFormalParameter_var_named() { |
| 2614 ParameterKind kind = ParameterKind.NAMED; | 1677 ParameterKind kind = ParameterKind.NAMED; |
| 2615 DefaultFormalParameter parameter = ParserTestCase.parse("parseFormalParamete
r", <Object> [kind], "var a : null"); | 1678 DefaultFormalParameter parameter = ParserTestCase.parse("parseFormalParamete
r", <Object> [kind], "var a : null"); |
| 2616 SimpleFormalParameter simpleParameter = (parameter.parameter as SimpleFormal
Parameter); | 1679 SimpleFormalParameter simpleParameter = parameter.parameter as SimpleFormalP
arameter; |
| 2617 JUnitTestCase.assertNotNull(simpleParameter.identifier); | 1680 JUnitTestCase.assertNotNull(simpleParameter.identifier); |
| 2618 JUnitTestCase.assertNotNull(simpleParameter.keyword); | 1681 JUnitTestCase.assertNotNull(simpleParameter.keyword); |
| 2619 JUnitTestCase.assertNull(simpleParameter.type); | 1682 JUnitTestCase.assertNull(simpleParameter.type); |
| 2620 JUnitTestCase.assertEquals(kind, simpleParameter.kind); | 1683 JUnitTestCase.assertEquals(kind, simpleParameter.kind); |
| 2621 JUnitTestCase.assertNotNull(parameter.separator); | 1684 JUnitTestCase.assertNotNull(parameter.separator); |
| 2622 JUnitTestCase.assertNotNull(parameter.defaultValue); | 1685 JUnitTestCase.assertNotNull(parameter.defaultValue); |
| 2623 JUnitTestCase.assertEquals(kind, parameter.kind); | 1686 JUnitTestCase.assertEquals(kind, parameter.kind); |
| 2624 } | 1687 } |
| 2625 void test_parseFormalParameter_var_positional() { | 1688 void test_parseFormalParameter_var_positional() { |
| 2626 ParameterKind kind = ParameterKind.POSITIONAL; | 1689 ParameterKind kind = ParameterKind.POSITIONAL; |
| 2627 DefaultFormalParameter parameter = ParserTestCase.parse("parseFormalParamete
r", <Object> [kind], "var a = null"); | 1690 DefaultFormalParameter parameter = ParserTestCase.parse("parseFormalParamete
r", <Object> [kind], "var a = null"); |
| 2628 SimpleFormalParameter simpleParameter = (parameter.parameter as SimpleFormal
Parameter); | 1691 SimpleFormalParameter simpleParameter = parameter.parameter as SimpleFormalP
arameter; |
| 2629 JUnitTestCase.assertNotNull(simpleParameter.identifier); | 1692 JUnitTestCase.assertNotNull(simpleParameter.identifier); |
| 2630 JUnitTestCase.assertNotNull(simpleParameter.keyword); | 1693 JUnitTestCase.assertNotNull(simpleParameter.keyword); |
| 2631 JUnitTestCase.assertNull(simpleParameter.type); | 1694 JUnitTestCase.assertNull(simpleParameter.type); |
| 2632 JUnitTestCase.assertEquals(kind, simpleParameter.kind); | 1695 JUnitTestCase.assertEquals(kind, simpleParameter.kind); |
| 2633 JUnitTestCase.assertNotNull(parameter.separator); | 1696 JUnitTestCase.assertNotNull(parameter.separator); |
| 2634 JUnitTestCase.assertNotNull(parameter.defaultValue); | 1697 JUnitTestCase.assertNotNull(parameter.defaultValue); |
| 2635 JUnitTestCase.assertEquals(kind, parameter.kind); | 1698 JUnitTestCase.assertEquals(kind, parameter.kind); |
| 2636 } | 1699 } |
| 2637 void test_parseFormalParameterList_empty() { | 1700 void test_parseFormalParameterList_empty() { |
| 2638 FormalParameterList parameterList = ParserTestCase.parse5("parseFormalParame
terList", "()", []); | 1701 FormalParameterList parameterList = ParserTestCase.parse6("parseFormalParame
terList", "()", []); |
| 2639 JUnitTestCase.assertNotNull(parameterList.leftParenthesis); | 1702 JUnitTestCase.assertNotNull(parameterList.leftParenthesis); |
| 2640 JUnitTestCase.assertNull(parameterList.leftDelimiter); | 1703 JUnitTestCase.assertNull(parameterList.leftDelimiter); |
| 2641 EngineTestCase.assertSize(0, parameterList.parameters); | 1704 EngineTestCase.assertSize(0, parameterList.parameters); |
| 2642 JUnitTestCase.assertNull(parameterList.rightDelimiter); | 1705 JUnitTestCase.assertNull(parameterList.rightDelimiter); |
| 2643 JUnitTestCase.assertNotNull(parameterList.rightParenthesis); | 1706 JUnitTestCase.assertNotNull(parameterList.rightParenthesis); |
| 2644 } | 1707 } |
| 2645 void test_parseFormalParameterList_named_multiple() { | 1708 void test_parseFormalParameterList_named_multiple() { |
| 2646 FormalParameterList parameterList = ParserTestCase.parse5("parseFormalParame
terList", "({A a : 1, B b, C c : 3})", []); | 1709 FormalParameterList parameterList = ParserTestCase.parse6("parseFormalParame
terList", "({A a : 1, B b, C c : 3})", []); |
| 2647 JUnitTestCase.assertNotNull(parameterList.leftParenthesis); | 1710 JUnitTestCase.assertNotNull(parameterList.leftParenthesis); |
| 2648 JUnitTestCase.assertNotNull(parameterList.leftDelimiter); | 1711 JUnitTestCase.assertNotNull(parameterList.leftDelimiter); |
| 2649 EngineTestCase.assertSize(3, parameterList.parameters); | 1712 EngineTestCase.assertSize(3, parameterList.parameters); |
| 2650 JUnitTestCase.assertNotNull(parameterList.rightDelimiter); | 1713 JUnitTestCase.assertNotNull(parameterList.rightDelimiter); |
| 2651 JUnitTestCase.assertNotNull(parameterList.rightParenthesis); | 1714 JUnitTestCase.assertNotNull(parameterList.rightParenthesis); |
| 2652 } | 1715 } |
| 2653 void test_parseFormalParameterList_named_single() { | 1716 void test_parseFormalParameterList_named_single() { |
| 2654 FormalParameterList parameterList = ParserTestCase.parse5("parseFormalParame
terList", "({A a})", []); | 1717 FormalParameterList parameterList = ParserTestCase.parse6("parseFormalParame
terList", "({A a})", []); |
| 2655 JUnitTestCase.assertNotNull(parameterList.leftParenthesis); | 1718 JUnitTestCase.assertNotNull(parameterList.leftParenthesis); |
| 2656 JUnitTestCase.assertNotNull(parameterList.leftDelimiter); | 1719 JUnitTestCase.assertNotNull(parameterList.leftDelimiter); |
| 2657 EngineTestCase.assertSize(1, parameterList.parameters); | 1720 EngineTestCase.assertSize(1, parameterList.parameters); |
| 2658 JUnitTestCase.assertNotNull(parameterList.rightDelimiter); | 1721 JUnitTestCase.assertNotNull(parameterList.rightDelimiter); |
| 2659 JUnitTestCase.assertNotNull(parameterList.rightParenthesis); | 1722 JUnitTestCase.assertNotNull(parameterList.rightParenthesis); |
| 2660 } | 1723 } |
| 2661 void test_parseFormalParameterList_normal_multiple() { | 1724 void test_parseFormalParameterList_normal_multiple() { |
| 2662 FormalParameterList parameterList = ParserTestCase.parse5("parseFormalParame
terList", "(A a, B b, C c)", []); | 1725 FormalParameterList parameterList = ParserTestCase.parse6("parseFormalParame
terList", "(A a, B b, C c)", []); |
| 2663 JUnitTestCase.assertNotNull(parameterList.leftParenthesis); | 1726 JUnitTestCase.assertNotNull(parameterList.leftParenthesis); |
| 2664 JUnitTestCase.assertNull(parameterList.leftDelimiter); | 1727 JUnitTestCase.assertNull(parameterList.leftDelimiter); |
| 2665 EngineTestCase.assertSize(3, parameterList.parameters); | 1728 EngineTestCase.assertSize(3, parameterList.parameters); |
| 2666 JUnitTestCase.assertNull(parameterList.rightDelimiter); | 1729 JUnitTestCase.assertNull(parameterList.rightDelimiter); |
| 2667 JUnitTestCase.assertNotNull(parameterList.rightParenthesis); | 1730 JUnitTestCase.assertNotNull(parameterList.rightParenthesis); |
| 2668 } | 1731 } |
| 2669 void test_parseFormalParameterList_normal_named() { | 1732 void test_parseFormalParameterList_normal_named() { |
| 2670 FormalParameterList parameterList = ParserTestCase.parse5("parseFormalParame
terList", "(A a, {B b})", []); | 1733 FormalParameterList parameterList = ParserTestCase.parse6("parseFormalParame
terList", "(A a, {B b})", []); |
| 2671 JUnitTestCase.assertNotNull(parameterList.leftParenthesis); | 1734 JUnitTestCase.assertNotNull(parameterList.leftParenthesis); |
| 2672 JUnitTestCase.assertNotNull(parameterList.leftDelimiter); | 1735 JUnitTestCase.assertNotNull(parameterList.leftDelimiter); |
| 2673 EngineTestCase.assertSize(2, parameterList.parameters); | 1736 EngineTestCase.assertSize(2, parameterList.parameters); |
| 2674 JUnitTestCase.assertNotNull(parameterList.rightDelimiter); | 1737 JUnitTestCase.assertNotNull(parameterList.rightDelimiter); |
| 2675 JUnitTestCase.assertNotNull(parameterList.rightParenthesis); | 1738 JUnitTestCase.assertNotNull(parameterList.rightParenthesis); |
| 2676 } | 1739 } |
| 2677 void test_parseFormalParameterList_normal_positional() { | 1740 void test_parseFormalParameterList_normal_positional() { |
| 2678 FormalParameterList parameterList = ParserTestCase.parse5("parseFormalParame
terList", "(A a, [B b])", []); | 1741 FormalParameterList parameterList = ParserTestCase.parse6("parseFormalParame
terList", "(A a, [B b])", []); |
| 2679 JUnitTestCase.assertNotNull(parameterList.leftParenthesis); | 1742 JUnitTestCase.assertNotNull(parameterList.leftParenthesis); |
| 2680 JUnitTestCase.assertNotNull(parameterList.leftDelimiter); | 1743 JUnitTestCase.assertNotNull(parameterList.leftDelimiter); |
| 2681 EngineTestCase.assertSize(2, parameterList.parameters); | 1744 EngineTestCase.assertSize(2, parameterList.parameters); |
| 2682 JUnitTestCase.assertNotNull(parameterList.rightDelimiter); | 1745 JUnitTestCase.assertNotNull(parameterList.rightDelimiter); |
| 2683 JUnitTestCase.assertNotNull(parameterList.rightParenthesis); | 1746 JUnitTestCase.assertNotNull(parameterList.rightParenthesis); |
| 2684 } | 1747 } |
| 2685 void test_parseFormalParameterList_normal_single() { | 1748 void test_parseFormalParameterList_normal_single() { |
| 2686 FormalParameterList parameterList = ParserTestCase.parse5("parseFormalParame
terList", "(A a)", []); | 1749 FormalParameterList parameterList = ParserTestCase.parse6("parseFormalParame
terList", "(A a)", []); |
| 2687 JUnitTestCase.assertNotNull(parameterList.leftParenthesis); | 1750 JUnitTestCase.assertNotNull(parameterList.leftParenthesis); |
| 2688 JUnitTestCase.assertNull(parameterList.leftDelimiter); | 1751 JUnitTestCase.assertNull(parameterList.leftDelimiter); |
| 2689 EngineTestCase.assertSize(1, parameterList.parameters); | 1752 EngineTestCase.assertSize(1, parameterList.parameters); |
| 2690 JUnitTestCase.assertNull(parameterList.rightDelimiter); | 1753 JUnitTestCase.assertNull(parameterList.rightDelimiter); |
| 2691 JUnitTestCase.assertNotNull(parameterList.rightParenthesis); | 1754 JUnitTestCase.assertNotNull(parameterList.rightParenthesis); |
| 2692 } | 1755 } |
| 2693 void test_parseFormalParameterList_positional_multiple() { | 1756 void test_parseFormalParameterList_positional_multiple() { |
| 2694 FormalParameterList parameterList = ParserTestCase.parse5("parseFormalParame
terList", "([A a = null, B b, C c = null])", []); | 1757 FormalParameterList parameterList = ParserTestCase.parse6("parseFormalParame
terList", "([A a = null, B b, C c = null])", []); |
| 2695 JUnitTestCase.assertNotNull(parameterList.leftParenthesis); | 1758 JUnitTestCase.assertNotNull(parameterList.leftParenthesis); |
| 2696 JUnitTestCase.assertNotNull(parameterList.leftDelimiter); | 1759 JUnitTestCase.assertNotNull(parameterList.leftDelimiter); |
| 2697 EngineTestCase.assertSize(3, parameterList.parameters); | 1760 EngineTestCase.assertSize(3, parameterList.parameters); |
| 2698 JUnitTestCase.assertNotNull(parameterList.rightDelimiter); | 1761 JUnitTestCase.assertNotNull(parameterList.rightDelimiter); |
| 2699 JUnitTestCase.assertNotNull(parameterList.rightParenthesis); | 1762 JUnitTestCase.assertNotNull(parameterList.rightParenthesis); |
| 2700 } | 1763 } |
| 2701 void test_parseFormalParameterList_positional_single() { | 1764 void test_parseFormalParameterList_positional_single() { |
| 2702 FormalParameterList parameterList = ParserTestCase.parse5("parseFormalParame
terList", "([A a = null])", []); | 1765 FormalParameterList parameterList = ParserTestCase.parse6("parseFormalParame
terList", "([A a = null])", []); |
| 2703 JUnitTestCase.assertNotNull(parameterList.leftParenthesis); | 1766 JUnitTestCase.assertNotNull(parameterList.leftParenthesis); |
| 2704 JUnitTestCase.assertNotNull(parameterList.leftDelimiter); | 1767 JUnitTestCase.assertNotNull(parameterList.leftDelimiter); |
| 2705 EngineTestCase.assertSize(1, parameterList.parameters); | 1768 EngineTestCase.assertSize(1, parameterList.parameters); |
| 2706 JUnitTestCase.assertNotNull(parameterList.rightDelimiter); | 1769 JUnitTestCase.assertNotNull(parameterList.rightDelimiter); |
| 2707 JUnitTestCase.assertNotNull(parameterList.rightParenthesis); | 1770 JUnitTestCase.assertNotNull(parameterList.rightParenthesis); |
| 2708 } | 1771 } |
| 2709 void test_parseForStatement_each_identifier() { | 1772 void test_parseForStatement_each_identifier() { |
| 2710 ForEachStatement statement = ParserTestCase.parse5("parseForStatement", "for
(element in list) {}", []); | 1773 ForEachStatement statement = ParserTestCase.parse6("parseForStatement", "for
(element in list) {}", []); |
| 2711 JUnitTestCase.assertNotNull(statement.forKeyword); | 1774 JUnitTestCase.assertNotNull(statement.forKeyword); |
| 2712 JUnitTestCase.assertNotNull(statement.leftParenthesis); | 1775 JUnitTestCase.assertNotNull(statement.leftParenthesis); |
| 2713 JUnitTestCase.assertNotNull(statement.loopParameter); | 1776 JUnitTestCase.assertNotNull(statement.loopParameter); |
| 2714 JUnitTestCase.assertNotNull(statement.inKeyword); | 1777 JUnitTestCase.assertNotNull(statement.inKeyword); |
| 2715 JUnitTestCase.assertNotNull(statement.iterator); | 1778 JUnitTestCase.assertNotNull(statement.iterator); |
| 2716 JUnitTestCase.assertNotNull(statement.rightParenthesis); | 1779 JUnitTestCase.assertNotNull(statement.rightParenthesis); |
| 2717 JUnitTestCase.assertNotNull(statement.body); | 1780 JUnitTestCase.assertNotNull(statement.body); |
| 2718 } | 1781 } |
| 2719 void test_parseForStatement_each_noType() { | 1782 void test_parseForStatement_each_noType() { |
| 2720 ForEachStatement statement = ParserTestCase.parse5("parseForStatement", "for
(element in list) {}", []); | 1783 ForEachStatement statement = ParserTestCase.parse6("parseForStatement", "for
(element in list) {}", []); |
| 2721 JUnitTestCase.assertNotNull(statement.forKeyword); | 1784 JUnitTestCase.assertNotNull(statement.forKeyword); |
| 2722 JUnitTestCase.assertNotNull(statement.leftParenthesis); | 1785 JUnitTestCase.assertNotNull(statement.leftParenthesis); |
| 2723 JUnitTestCase.assertNotNull(statement.loopParameter); | 1786 JUnitTestCase.assertNotNull(statement.loopParameter); |
| 2724 JUnitTestCase.assertNotNull(statement.inKeyword); | 1787 JUnitTestCase.assertNotNull(statement.inKeyword); |
| 2725 JUnitTestCase.assertNotNull(statement.iterator); | 1788 JUnitTestCase.assertNotNull(statement.iterator); |
| 2726 JUnitTestCase.assertNotNull(statement.rightParenthesis); | 1789 JUnitTestCase.assertNotNull(statement.rightParenthesis); |
| 2727 JUnitTestCase.assertNotNull(statement.body); | 1790 JUnitTestCase.assertNotNull(statement.body); |
| 2728 } | 1791 } |
| 2729 void test_parseForStatement_each_type() { | 1792 void test_parseForStatement_each_type() { |
| 2730 ForEachStatement statement = ParserTestCase.parse5("parseForStatement", "for
(A element in list) {}", []); | 1793 ForEachStatement statement = ParserTestCase.parse6("parseForStatement", "for
(A element in list) {}", []); |
| 2731 JUnitTestCase.assertNotNull(statement.forKeyword); | 1794 JUnitTestCase.assertNotNull(statement.forKeyword); |
| 2732 JUnitTestCase.assertNotNull(statement.leftParenthesis); | 1795 JUnitTestCase.assertNotNull(statement.leftParenthesis); |
| 2733 JUnitTestCase.assertNotNull(statement.loopParameter); | 1796 JUnitTestCase.assertNotNull(statement.loopParameter); |
| 2734 JUnitTestCase.assertNotNull(statement.inKeyword); | 1797 JUnitTestCase.assertNotNull(statement.inKeyword); |
| 2735 JUnitTestCase.assertNotNull(statement.iterator); | 1798 JUnitTestCase.assertNotNull(statement.iterator); |
| 2736 JUnitTestCase.assertNotNull(statement.rightParenthesis); | 1799 JUnitTestCase.assertNotNull(statement.rightParenthesis); |
| 2737 JUnitTestCase.assertNotNull(statement.body); | 1800 JUnitTestCase.assertNotNull(statement.body); |
| 2738 } | 1801 } |
| 2739 void test_parseForStatement_each_var() { | 1802 void test_parseForStatement_each_var() { |
| 2740 ForEachStatement statement = ParserTestCase.parse5("parseForStatement", "for
(var element in list) {}", []); | 1803 ForEachStatement statement = ParserTestCase.parse6("parseForStatement", "for
(var element in list) {}", []); |
| 2741 JUnitTestCase.assertNotNull(statement.forKeyword); | 1804 JUnitTestCase.assertNotNull(statement.forKeyword); |
| 2742 JUnitTestCase.assertNotNull(statement.leftParenthesis); | 1805 JUnitTestCase.assertNotNull(statement.leftParenthesis); |
| 2743 JUnitTestCase.assertNotNull(statement.loopParameter); | 1806 JUnitTestCase.assertNotNull(statement.loopParameter); |
| 2744 JUnitTestCase.assertNotNull(statement.inKeyword); | 1807 JUnitTestCase.assertNotNull(statement.inKeyword); |
| 2745 JUnitTestCase.assertNotNull(statement.iterator); | 1808 JUnitTestCase.assertNotNull(statement.iterator); |
| 2746 JUnitTestCase.assertNotNull(statement.rightParenthesis); | 1809 JUnitTestCase.assertNotNull(statement.rightParenthesis); |
| 2747 JUnitTestCase.assertNotNull(statement.body); | 1810 JUnitTestCase.assertNotNull(statement.body); |
| 2748 } | 1811 } |
| 2749 void test_parseForStatement_loop_c() { | 1812 void test_parseForStatement_loop_c() { |
| 2750 ForStatement statement = ParserTestCase.parse5("parseForStatement", "for (;
i < count;) {}", []); | 1813 ForStatement statement = ParserTestCase.parse6("parseForStatement", "for (;
i < count;) {}", []); |
| 2751 JUnitTestCase.assertNotNull(statement.forKeyword); | 1814 JUnitTestCase.assertNotNull(statement.forKeyword); |
| 2752 JUnitTestCase.assertNotNull(statement.leftParenthesis); | 1815 JUnitTestCase.assertNotNull(statement.leftParenthesis); |
| 2753 JUnitTestCase.assertNull(statement.variables); | 1816 JUnitTestCase.assertNull(statement.variables); |
| 2754 JUnitTestCase.assertNull(statement.initialization); | 1817 JUnitTestCase.assertNull(statement.initialization); |
| 2755 JUnitTestCase.assertNotNull(statement.leftSeparator); | 1818 JUnitTestCase.assertNotNull(statement.leftSeparator); |
| 2756 JUnitTestCase.assertNotNull(statement.condition); | 1819 JUnitTestCase.assertNotNull(statement.condition); |
| 2757 JUnitTestCase.assertNotNull(statement.rightSeparator); | 1820 JUnitTestCase.assertNotNull(statement.rightSeparator); |
| 2758 EngineTestCase.assertSize(0, statement.updaters); | 1821 EngineTestCase.assertSize(0, statement.updaters); |
| 2759 JUnitTestCase.assertNotNull(statement.rightParenthesis); | 1822 JUnitTestCase.assertNotNull(statement.rightParenthesis); |
| 2760 JUnitTestCase.assertNotNull(statement.body); | 1823 JUnitTestCase.assertNotNull(statement.body); |
| 2761 } | 1824 } |
| 2762 void test_parseForStatement_loop_cu() { | 1825 void test_parseForStatement_loop_cu() { |
| 2763 ForStatement statement = ParserTestCase.parse5("parseForStatement", "for (;
i < count; i++) {}", []); | 1826 ForStatement statement = ParserTestCase.parse6("parseForStatement", "for (;
i < count; i++) {}", []); |
| 2764 JUnitTestCase.assertNotNull(statement.forKeyword); | 1827 JUnitTestCase.assertNotNull(statement.forKeyword); |
| 2765 JUnitTestCase.assertNotNull(statement.leftParenthesis); | 1828 JUnitTestCase.assertNotNull(statement.leftParenthesis); |
| 2766 JUnitTestCase.assertNull(statement.variables); | 1829 JUnitTestCase.assertNull(statement.variables); |
| 2767 JUnitTestCase.assertNull(statement.initialization); | 1830 JUnitTestCase.assertNull(statement.initialization); |
| 2768 JUnitTestCase.assertNotNull(statement.leftSeparator); | 1831 JUnitTestCase.assertNotNull(statement.leftSeparator); |
| 2769 JUnitTestCase.assertNotNull(statement.condition); | 1832 JUnitTestCase.assertNotNull(statement.condition); |
| 2770 JUnitTestCase.assertNotNull(statement.rightSeparator); | 1833 JUnitTestCase.assertNotNull(statement.rightSeparator); |
| 2771 EngineTestCase.assertSize(1, statement.updaters); | 1834 EngineTestCase.assertSize(1, statement.updaters); |
| 2772 JUnitTestCase.assertNotNull(statement.rightParenthesis); | 1835 JUnitTestCase.assertNotNull(statement.rightParenthesis); |
| 2773 JUnitTestCase.assertNotNull(statement.body); | 1836 JUnitTestCase.assertNotNull(statement.body); |
| 2774 } | 1837 } |
| 2775 void test_parseForStatement_loop_ecu() { | 1838 void test_parseForStatement_loop_ecu() { |
| 2776 ForStatement statement = ParserTestCase.parse5("parseForStatement", "for (i-
-; i < count; i++) {}", []); | 1839 ForStatement statement = ParserTestCase.parse6("parseForStatement", "for (i-
-; i < count; i++) {}", []); |
| 2777 JUnitTestCase.assertNotNull(statement.forKeyword); | 1840 JUnitTestCase.assertNotNull(statement.forKeyword); |
| 2778 JUnitTestCase.assertNotNull(statement.leftParenthesis); | 1841 JUnitTestCase.assertNotNull(statement.leftParenthesis); |
| 2779 JUnitTestCase.assertNull(statement.variables); | 1842 JUnitTestCase.assertNull(statement.variables); |
| 2780 JUnitTestCase.assertNotNull(statement.initialization); | 1843 JUnitTestCase.assertNotNull(statement.initialization); |
| 2781 JUnitTestCase.assertNotNull(statement.leftSeparator); | 1844 JUnitTestCase.assertNotNull(statement.leftSeparator); |
| 2782 JUnitTestCase.assertNotNull(statement.condition); | 1845 JUnitTestCase.assertNotNull(statement.condition); |
| 2783 JUnitTestCase.assertNotNull(statement.rightSeparator); | 1846 JUnitTestCase.assertNotNull(statement.rightSeparator); |
| 2784 EngineTestCase.assertSize(1, statement.updaters); | 1847 EngineTestCase.assertSize(1, statement.updaters); |
| 2785 JUnitTestCase.assertNotNull(statement.rightParenthesis); | 1848 JUnitTestCase.assertNotNull(statement.rightParenthesis); |
| 2786 JUnitTestCase.assertNotNull(statement.body); | 1849 JUnitTestCase.assertNotNull(statement.body); |
| 2787 } | 1850 } |
| 2788 void test_parseForStatement_loop_i() { | 1851 void test_parseForStatement_loop_i() { |
| 2789 ForStatement statement = ParserTestCase.parse5("parseForStatement", "for (va
r i = 0;;) {}", []); | 1852 ForStatement statement = ParserTestCase.parse6("parseForStatement", "for (va
r i = 0;;) {}", []); |
| 2790 JUnitTestCase.assertNotNull(statement.forKeyword); | 1853 JUnitTestCase.assertNotNull(statement.forKeyword); |
| 2791 JUnitTestCase.assertNotNull(statement.leftParenthesis); | 1854 JUnitTestCase.assertNotNull(statement.leftParenthesis); |
| 2792 VariableDeclarationList variables8 = statement.variables; | 1855 VariableDeclarationList variables8 = statement.variables; |
| 2793 JUnitTestCase.assertNotNull(variables8); | 1856 JUnitTestCase.assertNotNull(variables8); |
| 2794 EngineTestCase.assertSize(1, variables8.variables); | 1857 EngineTestCase.assertSize(1, variables8.variables); |
| 2795 JUnitTestCase.assertNull(statement.initialization); | 1858 JUnitTestCase.assertNull(statement.initialization); |
| 2796 JUnitTestCase.assertNotNull(statement.leftSeparator); | 1859 JUnitTestCase.assertNotNull(statement.leftSeparator); |
| 2797 JUnitTestCase.assertNull(statement.condition); | 1860 JUnitTestCase.assertNull(statement.condition); |
| 2798 JUnitTestCase.assertNotNull(statement.rightSeparator); | 1861 JUnitTestCase.assertNotNull(statement.rightSeparator); |
| 2799 EngineTestCase.assertSize(0, statement.updaters); | 1862 EngineTestCase.assertSize(0, statement.updaters); |
| 2800 JUnitTestCase.assertNotNull(statement.rightParenthesis); | 1863 JUnitTestCase.assertNotNull(statement.rightParenthesis); |
| 2801 JUnitTestCase.assertNotNull(statement.body); | 1864 JUnitTestCase.assertNotNull(statement.body); |
| 2802 } | 1865 } |
| 2803 void test_parseForStatement_loop_ic() { | 1866 void test_parseForStatement_loop_ic() { |
| 2804 ForStatement statement = ParserTestCase.parse5("parseForStatement", "for (va
r i = 0; i < count;) {}", []); | 1867 ForStatement statement = ParserTestCase.parse6("parseForStatement", "for (va
r i = 0; i < count;) {}", []); |
| 2805 JUnitTestCase.assertNotNull(statement.forKeyword); | 1868 JUnitTestCase.assertNotNull(statement.forKeyword); |
| 2806 JUnitTestCase.assertNotNull(statement.leftParenthesis); | 1869 JUnitTestCase.assertNotNull(statement.leftParenthesis); |
| 2807 VariableDeclarationList variables9 = statement.variables; | 1870 VariableDeclarationList variables9 = statement.variables; |
| 2808 JUnitTestCase.assertNotNull(variables9); | 1871 JUnitTestCase.assertNotNull(variables9); |
| 2809 EngineTestCase.assertSize(1, variables9.variables); | 1872 EngineTestCase.assertSize(1, variables9.variables); |
| 2810 JUnitTestCase.assertNull(statement.initialization); | 1873 JUnitTestCase.assertNull(statement.initialization); |
| 2811 JUnitTestCase.assertNotNull(statement.leftSeparator); | 1874 JUnitTestCase.assertNotNull(statement.leftSeparator); |
| 2812 JUnitTestCase.assertNotNull(statement.condition); | 1875 JUnitTestCase.assertNotNull(statement.condition); |
| 2813 JUnitTestCase.assertNotNull(statement.rightSeparator); | 1876 JUnitTestCase.assertNotNull(statement.rightSeparator); |
| 2814 EngineTestCase.assertSize(0, statement.updaters); | 1877 EngineTestCase.assertSize(0, statement.updaters); |
| 2815 JUnitTestCase.assertNotNull(statement.rightParenthesis); | 1878 JUnitTestCase.assertNotNull(statement.rightParenthesis); |
| 2816 JUnitTestCase.assertNotNull(statement.body); | 1879 JUnitTestCase.assertNotNull(statement.body); |
| 2817 } | 1880 } |
| 2818 void test_parseForStatement_loop_icu() { | 1881 void test_parseForStatement_loop_icu() { |
| 2819 ForStatement statement = ParserTestCase.parse5("parseForStatement", "for (va
r i = 0; i < count; i++) {}", []); | 1882 ForStatement statement = ParserTestCase.parse6("parseForStatement", "for (va
r i = 0; i < count; i++) {}", []); |
| 2820 JUnitTestCase.assertNotNull(statement.forKeyword); | 1883 JUnitTestCase.assertNotNull(statement.forKeyword); |
| 2821 JUnitTestCase.assertNotNull(statement.leftParenthesis); | 1884 JUnitTestCase.assertNotNull(statement.leftParenthesis); |
| 2822 VariableDeclarationList variables10 = statement.variables; | 1885 VariableDeclarationList variables10 = statement.variables; |
| 2823 JUnitTestCase.assertNotNull(variables10); | 1886 JUnitTestCase.assertNotNull(variables10); |
| 2824 EngineTestCase.assertSize(1, variables10.variables); | 1887 EngineTestCase.assertSize(1, variables10.variables); |
| 2825 JUnitTestCase.assertNull(statement.initialization); | 1888 JUnitTestCase.assertNull(statement.initialization); |
| 2826 JUnitTestCase.assertNotNull(statement.leftSeparator); | 1889 JUnitTestCase.assertNotNull(statement.leftSeparator); |
| 2827 JUnitTestCase.assertNotNull(statement.condition); | 1890 JUnitTestCase.assertNotNull(statement.condition); |
| 2828 JUnitTestCase.assertNotNull(statement.rightSeparator); | 1891 JUnitTestCase.assertNotNull(statement.rightSeparator); |
| 2829 EngineTestCase.assertSize(1, statement.updaters); | 1892 EngineTestCase.assertSize(1, statement.updaters); |
| 2830 JUnitTestCase.assertNotNull(statement.rightParenthesis); | 1893 JUnitTestCase.assertNotNull(statement.rightParenthesis); |
| 2831 JUnitTestCase.assertNotNull(statement.body); | 1894 JUnitTestCase.assertNotNull(statement.body); |
| 2832 } | 1895 } |
| 2833 void test_parseForStatement_loop_iicuu() { | 1896 void test_parseForStatement_loop_iicuu() { |
| 2834 ForStatement statement = ParserTestCase.parse5("parseForStatement", "for (in
t i = 0, j = count; i < j; i++, j--) {}", []); | 1897 ForStatement statement = ParserTestCase.parse6("parseForStatement", "for (in
t i = 0, j = count; i < j; i++, j--) {}", []); |
| 2835 JUnitTestCase.assertNotNull(statement.forKeyword); | 1898 JUnitTestCase.assertNotNull(statement.forKeyword); |
| 2836 JUnitTestCase.assertNotNull(statement.leftParenthesis); | 1899 JUnitTestCase.assertNotNull(statement.leftParenthesis); |
| 2837 VariableDeclarationList variables11 = statement.variables; | 1900 VariableDeclarationList variables11 = statement.variables; |
| 2838 JUnitTestCase.assertNotNull(variables11); | 1901 JUnitTestCase.assertNotNull(variables11); |
| 2839 EngineTestCase.assertSize(2, variables11.variables); | 1902 EngineTestCase.assertSize(2, variables11.variables); |
| 2840 JUnitTestCase.assertNull(statement.initialization); | 1903 JUnitTestCase.assertNull(statement.initialization); |
| 2841 JUnitTestCase.assertNotNull(statement.leftSeparator); | 1904 JUnitTestCase.assertNotNull(statement.leftSeparator); |
| 2842 JUnitTestCase.assertNotNull(statement.condition); | 1905 JUnitTestCase.assertNotNull(statement.condition); |
| 2843 JUnitTestCase.assertNotNull(statement.rightSeparator); | 1906 JUnitTestCase.assertNotNull(statement.rightSeparator); |
| 2844 EngineTestCase.assertSize(2, statement.updaters); | 1907 EngineTestCase.assertSize(2, statement.updaters); |
| 2845 JUnitTestCase.assertNotNull(statement.rightParenthesis); | 1908 JUnitTestCase.assertNotNull(statement.rightParenthesis); |
| 2846 JUnitTestCase.assertNotNull(statement.body); | 1909 JUnitTestCase.assertNotNull(statement.body); |
| 2847 } | 1910 } |
| 2848 void test_parseForStatement_loop_iu() { | 1911 void test_parseForStatement_loop_iu() { |
| 2849 ForStatement statement = ParserTestCase.parse5("parseForStatement", "for (va
r i = 0;; i++) {}", []); | 1912 ForStatement statement = ParserTestCase.parse6("parseForStatement", "for (va
r i = 0;; i++) {}", []); |
| 2850 JUnitTestCase.assertNotNull(statement.forKeyword); | 1913 JUnitTestCase.assertNotNull(statement.forKeyword); |
| 2851 JUnitTestCase.assertNotNull(statement.leftParenthesis); | 1914 JUnitTestCase.assertNotNull(statement.leftParenthesis); |
| 2852 VariableDeclarationList variables12 = statement.variables; | 1915 VariableDeclarationList variables12 = statement.variables; |
| 2853 JUnitTestCase.assertNotNull(variables12); | 1916 JUnitTestCase.assertNotNull(variables12); |
| 2854 EngineTestCase.assertSize(1, variables12.variables); | 1917 EngineTestCase.assertSize(1, variables12.variables); |
| 2855 JUnitTestCase.assertNull(statement.initialization); | 1918 JUnitTestCase.assertNull(statement.initialization); |
| 2856 JUnitTestCase.assertNotNull(statement.leftSeparator); | 1919 JUnitTestCase.assertNotNull(statement.leftSeparator); |
| 2857 JUnitTestCase.assertNull(statement.condition); | 1920 JUnitTestCase.assertNull(statement.condition); |
| 2858 JUnitTestCase.assertNotNull(statement.rightSeparator); | 1921 JUnitTestCase.assertNotNull(statement.rightSeparator); |
| 2859 EngineTestCase.assertSize(1, statement.updaters); | 1922 EngineTestCase.assertSize(1, statement.updaters); |
| 2860 JUnitTestCase.assertNotNull(statement.rightParenthesis); | 1923 JUnitTestCase.assertNotNull(statement.rightParenthesis); |
| 2861 JUnitTestCase.assertNotNull(statement.body); | 1924 JUnitTestCase.assertNotNull(statement.body); |
| 2862 } | 1925 } |
| 2863 void test_parseForStatement_loop_u() { | 1926 void test_parseForStatement_loop_u() { |
| 2864 ForStatement statement = ParserTestCase.parse5("parseForStatement", "for (;;
i++) {}", []); | 1927 ForStatement statement = ParserTestCase.parse6("parseForStatement", "for (;;
i++) {}", []); |
| 2865 JUnitTestCase.assertNotNull(statement.forKeyword); | 1928 JUnitTestCase.assertNotNull(statement.forKeyword); |
| 2866 JUnitTestCase.assertNotNull(statement.leftParenthesis); | 1929 JUnitTestCase.assertNotNull(statement.leftParenthesis); |
| 2867 JUnitTestCase.assertNull(statement.variables); | 1930 JUnitTestCase.assertNull(statement.variables); |
| 2868 JUnitTestCase.assertNull(statement.initialization); | 1931 JUnitTestCase.assertNull(statement.initialization); |
| 2869 JUnitTestCase.assertNotNull(statement.leftSeparator); | 1932 JUnitTestCase.assertNotNull(statement.leftSeparator); |
| 2870 JUnitTestCase.assertNull(statement.condition); | 1933 JUnitTestCase.assertNull(statement.condition); |
| 2871 JUnitTestCase.assertNotNull(statement.rightSeparator); | 1934 JUnitTestCase.assertNotNull(statement.rightSeparator); |
| 2872 EngineTestCase.assertSize(1, statement.updaters); | 1935 EngineTestCase.assertSize(1, statement.updaters); |
| 2873 JUnitTestCase.assertNotNull(statement.rightParenthesis); | 1936 JUnitTestCase.assertNotNull(statement.rightParenthesis); |
| 2874 JUnitTestCase.assertNotNull(statement.body); | 1937 JUnitTestCase.assertNotNull(statement.body); |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2933 JUnitTestCase.assertEquals(comment, declaration.documentationComment); | 1996 JUnitTestCase.assertEquals(comment, declaration.documentationComment); |
| 2934 JUnitTestCase.assertEquals(returnType, declaration.returnType); | 1997 JUnitTestCase.assertEquals(returnType, declaration.returnType); |
| 2935 JUnitTestCase.assertNotNull(declaration.name); | 1998 JUnitTestCase.assertNotNull(declaration.name); |
| 2936 FunctionExpression expression = declaration.functionExpression; | 1999 FunctionExpression expression = declaration.functionExpression; |
| 2937 JUnitTestCase.assertNotNull(expression); | 2000 JUnitTestCase.assertNotNull(expression); |
| 2938 JUnitTestCase.assertNotNull(expression.body); | 2001 JUnitTestCase.assertNotNull(expression.body); |
| 2939 JUnitTestCase.assertNotNull(expression.parameters); | 2002 JUnitTestCase.assertNotNull(expression.parameters); |
| 2940 JUnitTestCase.assertNotNull(declaration.propertyKeyword); | 2003 JUnitTestCase.assertNotNull(declaration.propertyKeyword); |
| 2941 } | 2004 } |
| 2942 void test_parseFunctionDeclarationStatement() { | 2005 void test_parseFunctionDeclarationStatement() { |
| 2943 FunctionDeclarationStatement statement = ParserTestCase.parse5("parseFunctio
nDeclarationStatement", "void f(int p) => p * 2;", []); | 2006 FunctionDeclarationStatement statement = ParserTestCase.parse6("parseFunctio
nDeclarationStatement", "void f(int p) => p * 2;", []); |
| 2944 JUnitTestCase.assertNotNull(statement.functionDeclaration); | 2007 JUnitTestCase.assertNotNull(statement.functionDeclaration); |
| 2945 } | 2008 } |
| 2946 void test_parseFunctionExpression_body_inExpression() { | 2009 void test_parseFunctionExpression_body_inExpression() { |
| 2947 FunctionExpression expression = ParserTestCase.parse5("parseFunctionExpressi
on", "(int i) => i++", []); | 2010 FunctionExpression expression = ParserTestCase.parse6("parseFunctionExpressi
on", "(int i) => i++", []); |
| 2948 JUnitTestCase.assertNotNull(expression.body); | 2011 JUnitTestCase.assertNotNull(expression.body); |
| 2949 JUnitTestCase.assertNotNull(expression.parameters); | 2012 JUnitTestCase.assertNotNull(expression.parameters); |
| 2950 JUnitTestCase.assertNull(((expression.body as ExpressionFunctionBody)).semic
olon); | 2013 JUnitTestCase.assertNull(((expression.body as ExpressionFunctionBody)).semic
olon); |
| 2951 } | 2014 } |
| 2952 void test_parseFunctionExpression_minimal() { | 2015 void test_parseFunctionExpression_minimal() { |
| 2953 FunctionExpression expression = ParserTestCase.parse5("parseFunctionExpressi
on", "() {}", []); | 2016 FunctionExpression expression = ParserTestCase.parse6("parseFunctionExpressi
on", "() {}", []); |
| 2954 JUnitTestCase.assertNotNull(expression.body); | 2017 JUnitTestCase.assertNotNull(expression.body); |
| 2955 JUnitTestCase.assertNotNull(expression.parameters); | 2018 JUnitTestCase.assertNotNull(expression.parameters); |
| 2956 } | 2019 } |
| 2957 void test_parseGetter_nonStatic() { | 2020 void test_parseGetter_nonStatic() { |
| 2958 Comment comment = Comment.createDocumentationComment(new List<Token>(0)); | 2021 Comment comment = Comment.createDocumentationComment(new List<Token>(0)); |
| 2959 TypeName returnType = new TypeName.full(new SimpleIdentifier.full(null), nul
l); | 2022 TypeName returnType = new TypeName.full(new SimpleIdentifier.full(null), nul
l); |
| 2960 MethodDeclaration method = ParserTestCase.parse("parseGetter", <Object> [com
mentAndMetadata(comment, []), null, null, returnType], "get a;"); | 2023 MethodDeclaration method = ParserTestCase.parse("parseGetter", <Object> [com
mentAndMetadata(comment, []), null, null, returnType], "get a;"); |
| 2961 JUnitTestCase.assertNotNull(method.body); | 2024 JUnitTestCase.assertNotNull(method.body); |
| 2962 JUnitTestCase.assertEquals(comment, method.documentationComment); | 2025 JUnitTestCase.assertEquals(comment, method.documentationComment); |
| 2963 JUnitTestCase.assertNull(method.externalKeyword); | 2026 JUnitTestCase.assertNull(method.externalKeyword); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 2977 JUnitTestCase.assertEquals(comment, method.documentationComment); | 2040 JUnitTestCase.assertEquals(comment, method.documentationComment); |
| 2978 JUnitTestCase.assertNull(method.externalKeyword); | 2041 JUnitTestCase.assertNull(method.externalKeyword); |
| 2979 JUnitTestCase.assertEquals(staticKeyword, method.modifierKeyword); | 2042 JUnitTestCase.assertEquals(staticKeyword, method.modifierKeyword); |
| 2980 JUnitTestCase.assertNotNull(method.name); | 2043 JUnitTestCase.assertNotNull(method.name); |
| 2981 JUnitTestCase.assertNull(method.operatorKeyword); | 2044 JUnitTestCase.assertNull(method.operatorKeyword); |
| 2982 JUnitTestCase.assertNull(method.parameters); | 2045 JUnitTestCase.assertNull(method.parameters); |
| 2983 JUnitTestCase.assertNotNull(method.propertyKeyword); | 2046 JUnitTestCase.assertNotNull(method.propertyKeyword); |
| 2984 JUnitTestCase.assertEquals(returnType, method.returnType); | 2047 JUnitTestCase.assertEquals(returnType, method.returnType); |
| 2985 } | 2048 } |
| 2986 void test_parseIdentifierList_multiple() { | 2049 void test_parseIdentifierList_multiple() { |
| 2987 List<SimpleIdentifier> list = ParserTestCase.parse5("parseIdentifierList", "
a, b, c", []); | 2050 List<SimpleIdentifier> list = ParserTestCase.parse6("parseIdentifierList", "
a, b, c", []); |
| 2988 EngineTestCase.assertSize(3, list); | 2051 EngineTestCase.assertSize(3, list); |
| 2989 } | 2052 } |
| 2990 void test_parseIdentifierList_single() { | 2053 void test_parseIdentifierList_single() { |
| 2991 List<SimpleIdentifier> list = ParserTestCase.parse5("parseIdentifierList", "
a", []); | 2054 List<SimpleIdentifier> list = ParserTestCase.parse6("parseIdentifierList", "
a", []); |
| 2992 EngineTestCase.assertSize(1, list); | 2055 EngineTestCase.assertSize(1, list); |
| 2993 } | 2056 } |
| 2994 void test_parseIfStatement_else_block() { | 2057 void test_parseIfStatement_else_block() { |
| 2995 IfStatement statement = ParserTestCase.parse5("parseIfStatement", "if (x) {}
else {}", []); | 2058 IfStatement statement = ParserTestCase.parse6("parseIfStatement", "if (x) {}
else {}", []); |
| 2996 JUnitTestCase.assertNotNull(statement.ifKeyword); | 2059 JUnitTestCase.assertNotNull(statement.ifKeyword); |
| 2997 JUnitTestCase.assertNotNull(statement.leftParenthesis); | 2060 JUnitTestCase.assertNotNull(statement.leftParenthesis); |
| 2998 JUnitTestCase.assertNotNull(statement.condition); | 2061 JUnitTestCase.assertNotNull(statement.condition); |
| 2999 JUnitTestCase.assertNotNull(statement.rightParenthesis); | 2062 JUnitTestCase.assertNotNull(statement.rightParenthesis); |
| 3000 JUnitTestCase.assertNotNull(statement.thenStatement); | 2063 JUnitTestCase.assertNotNull(statement.thenStatement); |
| 3001 JUnitTestCase.assertNotNull(statement.elseKeyword); | 2064 JUnitTestCase.assertNotNull(statement.elseKeyword); |
| 3002 JUnitTestCase.assertNotNull(statement.elseStatement); | 2065 JUnitTestCase.assertNotNull(statement.elseStatement); |
| 3003 } | 2066 } |
| 3004 void test_parseIfStatement_else_statement() { | 2067 void test_parseIfStatement_else_statement() { |
| 3005 IfStatement statement = ParserTestCase.parse5("parseIfStatement", "if (x) f(
x); else f(y);", []); | 2068 IfStatement statement = ParserTestCase.parse6("parseIfStatement", "if (x) f(
x); else f(y);", []); |
| 3006 JUnitTestCase.assertNotNull(statement.ifKeyword); | 2069 JUnitTestCase.assertNotNull(statement.ifKeyword); |
| 3007 JUnitTestCase.assertNotNull(statement.leftParenthesis); | 2070 JUnitTestCase.assertNotNull(statement.leftParenthesis); |
| 3008 JUnitTestCase.assertNotNull(statement.condition); | 2071 JUnitTestCase.assertNotNull(statement.condition); |
| 3009 JUnitTestCase.assertNotNull(statement.rightParenthesis); | 2072 JUnitTestCase.assertNotNull(statement.rightParenthesis); |
| 3010 JUnitTestCase.assertNotNull(statement.thenStatement); | 2073 JUnitTestCase.assertNotNull(statement.thenStatement); |
| 3011 JUnitTestCase.assertNotNull(statement.elseKeyword); | 2074 JUnitTestCase.assertNotNull(statement.elseKeyword); |
| 3012 JUnitTestCase.assertNotNull(statement.elseStatement); | 2075 JUnitTestCase.assertNotNull(statement.elseStatement); |
| 3013 } | 2076 } |
| 3014 void test_parseIfStatement_noElse_block() { | 2077 void test_parseIfStatement_noElse_block() { |
| 3015 IfStatement statement = ParserTestCase.parse5("parseIfStatement", "if (x) {}
", []); | 2078 IfStatement statement = ParserTestCase.parse6("parseIfStatement", "if (x) {}
", []); |
| 3016 JUnitTestCase.assertNotNull(statement.ifKeyword); | 2079 JUnitTestCase.assertNotNull(statement.ifKeyword); |
| 3017 JUnitTestCase.assertNotNull(statement.leftParenthesis); | 2080 JUnitTestCase.assertNotNull(statement.leftParenthesis); |
| 3018 JUnitTestCase.assertNotNull(statement.condition); | 2081 JUnitTestCase.assertNotNull(statement.condition); |
| 3019 JUnitTestCase.assertNotNull(statement.rightParenthesis); | 2082 JUnitTestCase.assertNotNull(statement.rightParenthesis); |
| 3020 JUnitTestCase.assertNotNull(statement.thenStatement); | 2083 JUnitTestCase.assertNotNull(statement.thenStatement); |
| 3021 JUnitTestCase.assertNull(statement.elseKeyword); | 2084 JUnitTestCase.assertNull(statement.elseKeyword); |
| 3022 JUnitTestCase.assertNull(statement.elseStatement); | 2085 JUnitTestCase.assertNull(statement.elseStatement); |
| 3023 } | 2086 } |
| 3024 void test_parseIfStatement_noElse_statement() { | 2087 void test_parseIfStatement_noElse_statement() { |
| 3025 IfStatement statement = ParserTestCase.parse5("parseIfStatement", "if (x) f(
x);", []); | 2088 IfStatement statement = ParserTestCase.parse6("parseIfStatement", "if (x) f(
x);", []); |
| 3026 JUnitTestCase.assertNotNull(statement.ifKeyword); | 2089 JUnitTestCase.assertNotNull(statement.ifKeyword); |
| 3027 JUnitTestCase.assertNotNull(statement.leftParenthesis); | 2090 JUnitTestCase.assertNotNull(statement.leftParenthesis); |
| 3028 JUnitTestCase.assertNotNull(statement.condition); | 2091 JUnitTestCase.assertNotNull(statement.condition); |
| 3029 JUnitTestCase.assertNotNull(statement.rightParenthesis); | 2092 JUnitTestCase.assertNotNull(statement.rightParenthesis); |
| 3030 JUnitTestCase.assertNotNull(statement.thenStatement); | 2093 JUnitTestCase.assertNotNull(statement.thenStatement); |
| 3031 JUnitTestCase.assertNull(statement.elseKeyword); | 2094 JUnitTestCase.assertNull(statement.elseKeyword); |
| 3032 JUnitTestCase.assertNull(statement.elseStatement); | 2095 JUnitTestCase.assertNull(statement.elseStatement); |
| 3033 } | 2096 } |
| 3034 void test_parseImplementsClause_multiple() { | 2097 void test_parseImplementsClause_multiple() { |
| 3035 ImplementsClause clause = ParserTestCase.parse5("parseImplementsClause", "im
plements A, B, C", []); | 2098 ImplementsClause clause = ParserTestCase.parse6("parseImplementsClause", "im
plements A, B, C", []); |
| 3036 EngineTestCase.assertSize(3, clause.interfaces); | 2099 EngineTestCase.assertSize(3, clause.interfaces); |
| 3037 JUnitTestCase.assertNotNull(clause.keyword); | 2100 JUnitTestCase.assertNotNull(clause.keyword); |
| 3038 } | 2101 } |
| 3039 void test_parseImplementsClause_single() { | 2102 void test_parseImplementsClause_single() { |
| 3040 ImplementsClause clause = ParserTestCase.parse5("parseImplementsClause", "im
plements A", []); | 2103 ImplementsClause clause = ParserTestCase.parse6("parseImplementsClause", "im
plements A", []); |
| 3041 EngineTestCase.assertSize(1, clause.interfaces); | 2104 EngineTestCase.assertSize(1, clause.interfaces); |
| 3042 JUnitTestCase.assertNotNull(clause.keyword); | 2105 JUnitTestCase.assertNotNull(clause.keyword); |
| 3043 } | 2106 } |
| 3044 void test_parseImportDirective_hide() { | 2107 void test_parseImportDirective_hide() { |
| 3045 ImportDirective directive = ParserTestCase.parse("parseImportDirective", <Ob
ject> [emptyCommentAndMetadata()], "import 'lib/lib.dart' hide A, B;"); | 2108 ImportDirective directive = ParserTestCase.parse("parseImportDirective", <Ob
ject> [emptyCommentAndMetadata()], "import 'lib/lib.dart' hide A, B;"); |
| 3046 JUnitTestCase.assertNotNull(directive.keyword); | 2109 JUnitTestCase.assertNotNull(directive.keyword); |
| 3047 JUnitTestCase.assertNotNull(directive.uri); | 2110 JUnitTestCase.assertNotNull(directive.uri); |
| 3048 JUnitTestCase.assertNull(directive.asToken); | 2111 JUnitTestCase.assertNull(directive.asToken); |
| 3049 JUnitTestCase.assertNull(directive.prefix); | 2112 JUnitTestCase.assertNull(directive.prefix); |
| 3050 EngineTestCase.assertSize(1, directive.combinators); | 2113 EngineTestCase.assertSize(1, directive.combinators); |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3168 JUnitTestCase.assertNotNull(expression.argumentList); | 2231 JUnitTestCase.assertNotNull(expression.argumentList); |
| 3169 } | 2232 } |
| 3170 void test_parseLibraryDirective() { | 2233 void test_parseLibraryDirective() { |
| 3171 LibraryDirective directive = ParserTestCase.parse("parseLibraryDirective", <
Object> [emptyCommentAndMetadata()], "library l;"); | 2234 LibraryDirective directive = ParserTestCase.parse("parseLibraryDirective", <
Object> [emptyCommentAndMetadata()], "library l;"); |
| 3172 JUnitTestCase.assertNotNull(directive.libraryToken); | 2235 JUnitTestCase.assertNotNull(directive.libraryToken); |
| 3173 JUnitTestCase.assertNotNull(directive.name); | 2236 JUnitTestCase.assertNotNull(directive.name); |
| 3174 JUnitTestCase.assertNotNull(directive.semicolon); | 2237 JUnitTestCase.assertNotNull(directive.semicolon); |
| 3175 } | 2238 } |
| 3176 void test_parseLibraryIdentifier_multiple() { | 2239 void test_parseLibraryIdentifier_multiple() { |
| 3177 String name = "a.b.c"; | 2240 String name = "a.b.c"; |
| 3178 LibraryIdentifier identifier = ParserTestCase.parse5("parseLibraryIdentifier
", name, []); | 2241 LibraryIdentifier identifier = ParserTestCase.parse6("parseLibraryIdentifier
", name, []); |
| 3179 JUnitTestCase.assertEquals(name, identifier.name); | 2242 JUnitTestCase.assertEquals(name, identifier.name); |
| 3180 } | 2243 } |
| 3181 void test_parseLibraryIdentifier_single() { | 2244 void test_parseLibraryIdentifier_single() { |
| 3182 String name = "a"; | 2245 String name = "a"; |
| 3183 LibraryIdentifier identifier = ParserTestCase.parse5("parseLibraryIdentifier
", name, []); | 2246 LibraryIdentifier identifier = ParserTestCase.parse6("parseLibraryIdentifier
", name, []); |
| 3184 JUnitTestCase.assertEquals(name, identifier.name); | 2247 JUnitTestCase.assertEquals(name, identifier.name); |
| 3185 } | 2248 } |
| 3186 void test_parseListLiteral_empty_oneToken() { | 2249 void test_parseListLiteral_empty_oneToken() { |
| 3187 Token token9 = TokenFactory.token(Keyword.CONST); | 2250 Token token9 = TokenFactory.token(Keyword.CONST); |
| 3188 TypeArgumentList typeArguments = new TypeArgumentList.full(null, null, null)
; | 2251 TypeArgumentList typeArguments = new TypeArgumentList.full(null, null, null)
; |
| 3189 ListLiteral literal = ParserTestCase.parse("parseListLiteral", <Object> [tok
en9, typeArguments], "[]"); | 2252 ListLiteral literal = ParserTestCase.parse("parseListLiteral", <Object> [tok
en9, typeArguments], "[]"); |
| 3190 JUnitTestCase.assertEquals(token9, literal.modifier); | 2253 JUnitTestCase.assertEquals(token9, literal.modifier); |
| 3191 JUnitTestCase.assertEquals(typeArguments, literal.typeArguments); | 2254 JUnitTestCase.assertEquals(typeArguments, literal.typeArguments); |
| 3192 JUnitTestCase.assertNotNull(literal.leftBracket); | 2255 JUnitTestCase.assertNotNull(literal.leftBracket); |
| 3193 EngineTestCase.assertSize(0, literal.elements); | 2256 EngineTestCase.assertSize(0, literal.elements); |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3245 } | 2308 } |
| 3246 void test_parseListOrMapLiteral_map_type() { | 2309 void test_parseListOrMapLiteral_map_type() { |
| 3247 MapLiteral literal = ParserTestCase.parse("parseListOrMapLiteral", <Object>
[null], "<int> {'1' : 1}"); | 2310 MapLiteral literal = ParserTestCase.parse("parseListOrMapLiteral", <Object>
[null], "<int> {'1' : 1}"); |
| 3248 JUnitTestCase.assertNull(literal.modifier); | 2311 JUnitTestCase.assertNull(literal.modifier); |
| 3249 JUnitTestCase.assertNotNull(literal.typeArguments); | 2312 JUnitTestCase.assertNotNull(literal.typeArguments); |
| 3250 JUnitTestCase.assertNotNull(literal.leftBracket); | 2313 JUnitTestCase.assertNotNull(literal.leftBracket); |
| 3251 EngineTestCase.assertSize(1, literal.entries); | 2314 EngineTestCase.assertSize(1, literal.entries); |
| 3252 JUnitTestCase.assertNotNull(literal.rightBracket); | 2315 JUnitTestCase.assertNotNull(literal.rightBracket); |
| 3253 } | 2316 } |
| 3254 void test_parseLogicalAndExpression() { | 2317 void test_parseLogicalAndExpression() { |
| 3255 BinaryExpression expression = ParserTestCase.parse5("parseLogicalAndExpressi
on", "x && y", []); | 2318 BinaryExpression expression = ParserTestCase.parse6("parseLogicalAndExpressi
on", "x && y", []); |
| 3256 JUnitTestCase.assertNotNull(expression.leftOperand); | 2319 JUnitTestCase.assertNotNull(expression.leftOperand); |
| 3257 JUnitTestCase.assertNotNull(expression.operator); | 2320 JUnitTestCase.assertNotNull(expression.operator); |
| 3258 JUnitTestCase.assertEquals(TokenType.AMPERSAND_AMPERSAND, expression.operato
r.type); | 2321 JUnitTestCase.assertEquals(TokenType.AMPERSAND_AMPERSAND, expression.operato
r.type); |
| 3259 JUnitTestCase.assertNotNull(expression.rightOperand); | 2322 JUnitTestCase.assertNotNull(expression.rightOperand); |
| 3260 } | 2323 } |
| 3261 void test_parseLogicalOrExpression() { | 2324 void test_parseLogicalOrExpression() { |
| 3262 BinaryExpression expression = ParserTestCase.parse5("parseLogicalOrExpressio
n", "x || y", []); | 2325 BinaryExpression expression = ParserTestCase.parse6("parseLogicalOrExpressio
n", "x || y", []); |
| 3263 JUnitTestCase.assertNotNull(expression.leftOperand); | 2326 JUnitTestCase.assertNotNull(expression.leftOperand); |
| 3264 JUnitTestCase.assertNotNull(expression.operator); | 2327 JUnitTestCase.assertNotNull(expression.operator); |
| 3265 JUnitTestCase.assertEquals(TokenType.BAR_BAR, expression.operator.type); | 2328 JUnitTestCase.assertEquals(TokenType.BAR_BAR, expression.operator.type); |
| 3266 JUnitTestCase.assertNotNull(expression.rightOperand); | 2329 JUnitTestCase.assertNotNull(expression.rightOperand); |
| 3267 } | 2330 } |
| 3268 void test_parseMapLiteral_empty() { | 2331 void test_parseMapLiteral_empty() { |
| 3269 Token token11 = TokenFactory.token(Keyword.CONST); | 2332 Token token11 = TokenFactory.token(Keyword.CONST); |
| 3270 TypeArgumentList typeArguments = new TypeArgumentList.full(null, null, null)
; | 2333 TypeArgumentList typeArguments = new TypeArgumentList.full(null, null, null)
; |
| 3271 MapLiteral literal = ParserTestCase.parse("parseMapLiteral", <Object> [token
11, typeArguments], "{}"); | 2334 MapLiteral literal = ParserTestCase.parse("parseMapLiteral", <Object> [token
11, typeArguments], "{}"); |
| 3272 JUnitTestCase.assertEquals(token11, literal.modifier); | 2335 JUnitTestCase.assertEquals(token11, literal.modifier); |
| 3273 JUnitTestCase.assertEquals(typeArguments, literal.typeArguments); | 2336 JUnitTestCase.assertEquals(typeArguments, literal.typeArguments); |
| 3274 JUnitTestCase.assertNotNull(literal.leftBracket); | 2337 JUnitTestCase.assertNotNull(literal.leftBracket); |
| 3275 EngineTestCase.assertSize(0, literal.entries); | 2338 EngineTestCase.assertSize(0, literal.entries); |
| 3276 JUnitTestCase.assertNotNull(literal.rightBracket); | 2339 JUnitTestCase.assertNotNull(literal.rightBracket); |
| 3277 } | 2340 } |
| 3278 void test_parseMapLiteral_multiple() { | 2341 void test_parseMapLiteral_multiple() { |
| 3279 MapLiteral literal = ParserTestCase.parse("parseMapLiteral", <Object> [null,
null], "{'a' : b, 'x' : y}"); | 2342 MapLiteral literal = ParserTestCase.parse("parseMapLiteral", <Object> [null,
null], "{'a' : b, 'x' : y}"); |
| 3280 JUnitTestCase.assertNotNull(literal.leftBracket); | 2343 JUnitTestCase.assertNotNull(literal.leftBracket); |
| 3281 EngineTestCase.assertSize(2, literal.entries); | 2344 EngineTestCase.assertSize(2, literal.entries); |
| 3282 JUnitTestCase.assertNotNull(literal.rightBracket); | 2345 JUnitTestCase.assertNotNull(literal.rightBracket); |
| 3283 } | 2346 } |
| 3284 void test_parseMapLiteral_single() { | 2347 void test_parseMapLiteral_single() { |
| 3285 MapLiteral literal = ParserTestCase.parse("parseMapLiteral", <Object> [null,
null], "{'x' : y}"); | 2348 MapLiteral literal = ParserTestCase.parse("parseMapLiteral", <Object> [null,
null], "{'x' : y}"); |
| 3286 JUnitTestCase.assertNotNull(literal.leftBracket); | 2349 JUnitTestCase.assertNotNull(literal.leftBracket); |
| 3287 EngineTestCase.assertSize(1, literal.entries); | 2350 EngineTestCase.assertSize(1, literal.entries); |
| 3288 JUnitTestCase.assertNotNull(literal.rightBracket); | 2351 JUnitTestCase.assertNotNull(literal.rightBracket); |
| 3289 } | 2352 } |
| 3290 void test_parseMapLiteralEntry() { | 2353 void test_parseMapLiteralEntry() { |
| 3291 MapLiteralEntry entry = ParserTestCase.parse5("parseMapLiteralEntry", "'x' :
y", []); | 2354 MapLiteralEntry entry = ParserTestCase.parse6("parseMapLiteralEntry", "'x' :
y", []); |
| 3292 JUnitTestCase.assertNotNull(entry.key); | 2355 JUnitTestCase.assertNotNull(entry.key); |
| 3293 JUnitTestCase.assertNotNull(entry.separator); | 2356 JUnitTestCase.assertNotNull(entry.separator); |
| 3294 JUnitTestCase.assertNotNull(entry.value); | 2357 JUnitTestCase.assertNotNull(entry.value); |
| 3295 } | 2358 } |
| 3296 void test_parseModifiers_abstract() { | 2359 void test_parseModifiers_abstract() { |
| 3297 Modifiers modifiers = ParserTestCase.parse5("parseModifiers", "abstract A",
[]); | 2360 Modifiers modifiers = ParserTestCase.parse6("parseModifiers", "abstract A",
[]); |
| 3298 JUnitTestCase.assertNotNull(modifiers.abstractKeyword); | 2361 JUnitTestCase.assertNotNull(modifiers.abstractKeyword); |
| 3299 } | 2362 } |
| 3300 void test_parseModifiers_const() { | 2363 void test_parseModifiers_const() { |
| 3301 Modifiers modifiers = ParserTestCase.parse5("parseModifiers", "const A", [])
; | 2364 Modifiers modifiers = ParserTestCase.parse6("parseModifiers", "const A", [])
; |
| 3302 JUnitTestCase.assertNotNull(modifiers.constKeyword); | 2365 JUnitTestCase.assertNotNull(modifiers.constKeyword); |
| 3303 } | 2366 } |
| 3304 void test_parseModifiers_external() { | 2367 void test_parseModifiers_external() { |
| 3305 Modifiers modifiers = ParserTestCase.parse5("parseModifiers", "external A",
[]); | 2368 Modifiers modifiers = ParserTestCase.parse6("parseModifiers", "external A",
[]); |
| 3306 JUnitTestCase.assertNotNull(modifiers.externalKeyword); | 2369 JUnitTestCase.assertNotNull(modifiers.externalKeyword); |
| 3307 } | 2370 } |
| 3308 void test_parseModifiers_factory() { | 2371 void test_parseModifiers_factory() { |
| 3309 Modifiers modifiers = ParserTestCase.parse5("parseModifiers", "factory A", [
]); | 2372 Modifiers modifiers = ParserTestCase.parse6("parseModifiers", "factory A", [
]); |
| 3310 JUnitTestCase.assertNotNull(modifiers.factoryKeyword); | 2373 JUnitTestCase.assertNotNull(modifiers.factoryKeyword); |
| 3311 } | 2374 } |
| 3312 void test_parseModifiers_final() { | 2375 void test_parseModifiers_final() { |
| 3313 Modifiers modifiers = ParserTestCase.parse5("parseModifiers", "final A", [])
; | 2376 Modifiers modifiers = ParserTestCase.parse6("parseModifiers", "final A", [])
; |
| 3314 JUnitTestCase.assertNotNull(modifiers.finalKeyword); | 2377 JUnitTestCase.assertNotNull(modifiers.finalKeyword); |
| 3315 } | 2378 } |
| 3316 void test_parseModifiers_static() { | 2379 void test_parseModifiers_static() { |
| 3317 Modifiers modifiers = ParserTestCase.parse5("parseModifiers", "static A", []
); | 2380 Modifiers modifiers = ParserTestCase.parse6("parseModifiers", "static A", []
); |
| 3318 JUnitTestCase.assertNotNull(modifiers.staticKeyword); | 2381 JUnitTestCase.assertNotNull(modifiers.staticKeyword); |
| 3319 } | 2382 } |
| 3320 void test_parseModifiers_var() { | 2383 void test_parseModifiers_var() { |
| 3321 Modifiers modifiers = ParserTestCase.parse5("parseModifiers", "var A", []); | 2384 Modifiers modifiers = ParserTestCase.parse6("parseModifiers", "var A", []); |
| 3322 JUnitTestCase.assertNotNull(modifiers.varKeyword); | 2385 JUnitTestCase.assertNotNull(modifiers.varKeyword); |
| 3323 } | 2386 } |
| 3324 void test_parseMultiplicativeExpression_normal() { | 2387 void test_parseMultiplicativeExpression_normal() { |
| 3325 BinaryExpression expression = ParserTestCase.parse5("parseMultiplicativeExpr
ession", "x * y", []); | 2388 BinaryExpression expression = ParserTestCase.parse6("parseMultiplicativeExpr
ession", "x * y", []); |
| 3326 JUnitTestCase.assertNotNull(expression.leftOperand); | 2389 JUnitTestCase.assertNotNull(expression.leftOperand); |
| 3327 JUnitTestCase.assertNotNull(expression.operator); | 2390 JUnitTestCase.assertNotNull(expression.operator); |
| 3328 JUnitTestCase.assertEquals(TokenType.STAR, expression.operator.type); | 2391 JUnitTestCase.assertEquals(TokenType.STAR, expression.operator.type); |
| 3329 JUnitTestCase.assertNotNull(expression.rightOperand); | 2392 JUnitTestCase.assertNotNull(expression.rightOperand); |
| 3330 } | 2393 } |
| 3331 void test_parseMultiplicativeExpression_super() { | 2394 void test_parseMultiplicativeExpression_super() { |
| 3332 BinaryExpression expression = ParserTestCase.parse5("parseMultiplicativeExpr
ession", "super * y", []); | 2395 BinaryExpression expression = ParserTestCase.parse6("parseMultiplicativeExpr
ession", "super * y", []); |
| 3333 EngineTestCase.assertInstanceOf(SuperExpression, expression.leftOperand); | 2396 EngineTestCase.assertInstanceOf(SuperExpression, expression.leftOperand); |
| 3334 JUnitTestCase.assertNotNull(expression.operator); | 2397 JUnitTestCase.assertNotNull(expression.operator); |
| 3335 JUnitTestCase.assertEquals(TokenType.STAR, expression.operator.type); | 2398 JUnitTestCase.assertEquals(TokenType.STAR, expression.operator.type); |
| 3336 JUnitTestCase.assertNotNull(expression.rightOperand); | 2399 JUnitTestCase.assertNotNull(expression.rightOperand); |
| 3337 } | 2400 } |
| 3338 void test_parseNewExpression() { | 2401 void test_parseNewExpression() { |
| 3339 InstanceCreationExpression expression = ParserTestCase.parse5("parseNewExpre
ssion", "new A()", []); | 2402 InstanceCreationExpression expression = ParserTestCase.parse6("parseNewExpre
ssion", "new A()", []); |
| 3340 JUnitTestCase.assertNotNull(expression.keyword); | 2403 JUnitTestCase.assertNotNull(expression.keyword); |
| 3341 ConstructorName name = expression.constructorName; | 2404 ConstructorName name = expression.constructorName; |
| 3342 JUnitTestCase.assertNotNull(name); | 2405 JUnitTestCase.assertNotNull(name); |
| 3343 JUnitTestCase.assertNotNull(name.type); | 2406 JUnitTestCase.assertNotNull(name.type); |
| 3344 JUnitTestCase.assertNull(name.period); | 2407 JUnitTestCase.assertNull(name.period); |
| 3345 JUnitTestCase.assertNull(name.name); | 2408 JUnitTestCase.assertNull(name.name); |
| 3346 JUnitTestCase.assertNotNull(expression.argumentList); | 2409 JUnitTestCase.assertNotNull(expression.argumentList); |
| 3347 } | 2410 } |
| 3348 void test_parseNonLabeledStatement_const_list_empty() { | 2411 void test_parseNonLabeledStatement_const_list_empty() { |
| 3349 ExpressionStatement statement = ParserTestCase.parse5("parseNonLabeledStatem
ent", "const [];", []); | 2412 ExpressionStatement statement = ParserTestCase.parse6("parseNonLabeledStatem
ent", "const [];", []); |
| 3350 JUnitTestCase.assertNotNull(statement.expression); | 2413 JUnitTestCase.assertNotNull(statement.expression); |
| 3351 } | 2414 } |
| 3352 void test_parseNonLabeledStatement_const_list_nonEmpty() { | 2415 void test_parseNonLabeledStatement_const_list_nonEmpty() { |
| 3353 ExpressionStatement statement = ParserTestCase.parse5("parseNonLabeledStatem
ent", "const [1, 2];", []); | 2416 ExpressionStatement statement = ParserTestCase.parse6("parseNonLabeledStatem
ent", "const [1, 2];", []); |
| 3354 JUnitTestCase.assertNotNull(statement.expression); | 2417 JUnitTestCase.assertNotNull(statement.expression); |
| 3355 } | 2418 } |
| 3356 void test_parseNonLabeledStatement_const_map_empty() { | 2419 void test_parseNonLabeledStatement_const_map_empty() { |
| 3357 ExpressionStatement statement = ParserTestCase.parse5("parseNonLabeledStatem
ent", "const {};", []); | 2420 ExpressionStatement statement = ParserTestCase.parse6("parseNonLabeledStatem
ent", "const {};", []); |
| 3358 JUnitTestCase.assertNotNull(statement.expression); | 2421 JUnitTestCase.assertNotNull(statement.expression); |
| 3359 } | 2422 } |
| 3360 void test_parseNonLabeledStatement_const_map_nonEmpty() { | 2423 void test_parseNonLabeledStatement_const_map_nonEmpty() { |
| 3361 ExpressionStatement statement = ParserTestCase.parse5("parseNonLabeledStatem
ent", "const {'a' : 1};", []); | 2424 ExpressionStatement statement = ParserTestCase.parse6("parseNonLabeledStatem
ent", "const {'a' : 1};", []); |
| 3362 JUnitTestCase.assertNotNull(statement.expression); | 2425 JUnitTestCase.assertNotNull(statement.expression); |
| 3363 } | 2426 } |
| 3364 void test_parseNonLabeledStatement_const_object() { | 2427 void test_parseNonLabeledStatement_const_object() { |
| 3365 ExpressionStatement statement = ParserTestCase.parse5("parseNonLabeledStatem
ent", "const A();", []); | 2428 ExpressionStatement statement = ParserTestCase.parse6("parseNonLabeledStatem
ent", "const A();", []); |
| 3366 JUnitTestCase.assertNotNull(statement.expression); | 2429 JUnitTestCase.assertNotNull(statement.expression); |
| 3367 } | 2430 } |
| 3368 void test_parseNonLabeledStatement_const_object_named_typeParameters() { | 2431 void test_parseNonLabeledStatement_const_object_named_typeParameters() { |
| 3369 ExpressionStatement statement = ParserTestCase.parse5("parseNonLabeledStatem
ent", "const A<B>.c();", []); | 2432 ExpressionStatement statement = ParserTestCase.parse6("parseNonLabeledStatem
ent", "const A<B>.c();", []); |
| 3370 JUnitTestCase.assertNotNull(statement.expression); | 2433 JUnitTestCase.assertNotNull(statement.expression); |
| 3371 } | 2434 } |
| 3372 void test_parseNonLabeledStatement_constructorInvocation() { | 2435 void test_parseNonLabeledStatement_constructorInvocation() { |
| 3373 ExpressionStatement statement = ParserTestCase.parse5("parseNonLabeledStatem
ent", "new C().m();", []); | 2436 ExpressionStatement statement = ParserTestCase.parse6("parseNonLabeledStatem
ent", "new C().m();", []); |
| 3374 JUnitTestCase.assertNotNull(statement.expression); | 2437 JUnitTestCase.assertNotNull(statement.expression); |
| 3375 } | 2438 } |
| 3376 void test_parseNonLabeledStatement_false() { | 2439 void test_parseNonLabeledStatement_false() { |
| 3377 ExpressionStatement statement = ParserTestCase.parse5("parseNonLabeledStatem
ent", "false;", []); | 2440 ExpressionStatement statement = ParserTestCase.parse6("parseNonLabeledStatem
ent", "false;", []); |
| 3378 JUnitTestCase.assertNotNull(statement.expression); | 2441 JUnitTestCase.assertNotNull(statement.expression); |
| 3379 } | 2442 } |
| 3380 void test_parseNonLabeledStatement_functionDeclaration() { | 2443 void test_parseNonLabeledStatement_functionDeclaration() { |
| 3381 ParserTestCase.parse5("parseNonLabeledStatement", "f() {};", []); | 2444 ParserTestCase.parse6("parseNonLabeledStatement", "f() {};", []); |
| 3382 } | 2445 } |
| 3383 void test_parseNonLabeledStatement_functionDeclaration_arguments() { | 2446 void test_parseNonLabeledStatement_functionDeclaration_arguments() { |
| 3384 ParserTestCase.parse5("parseNonLabeledStatement", "f(void g()) {};", []); | 2447 ParserTestCase.parse6("parseNonLabeledStatement", "f(void g()) {};", []); |
| 3385 } | 2448 } |
| 3386 void test_parseNonLabeledStatement_functionExpressionIndex() { | 2449 void test_parseNonLabeledStatement_functionExpressionIndex() { |
| 3387 ParserTestCase.parse5("parseNonLabeledStatement", "() {}[0] = null;", []); | 2450 ParserTestCase.parse6("parseNonLabeledStatement", "() {}[0] = null;", []); |
| 3388 } | 2451 } |
| 3389 void test_parseNonLabeledStatement_functionInvocation() { | 2452 void test_parseNonLabeledStatement_functionInvocation() { |
| 3390 ExpressionStatement statement = ParserTestCase.parse5("parseNonLabeledStatem
ent", "f();", []); | 2453 ExpressionStatement statement = ParserTestCase.parse6("parseNonLabeledStatem
ent", "f();", []); |
| 3391 JUnitTestCase.assertNotNull(statement.expression); | 2454 JUnitTestCase.assertNotNull(statement.expression); |
| 3392 } | 2455 } |
| 3393 void test_parseNonLabeledStatement_invokeFunctionExpression() { | 2456 void test_parseNonLabeledStatement_invokeFunctionExpression() { |
| 3394 ExpressionStatement statement = ParserTestCase.parse5("parseNonLabeledStatem
ent", "(a) {return a + a;} (3);", []); | 2457 ExpressionStatement statement = ParserTestCase.parse6("parseNonLabeledStatem
ent", "(a) {return a + a;} (3);", []); |
| 3395 EngineTestCase.assertInstanceOf(FunctionExpressionInvocation, statement.expr
ession); | 2458 EngineTestCase.assertInstanceOf(FunctionExpressionInvocation, statement.expr
ession); |
| 3396 FunctionExpressionInvocation invocation = (statement.expression as FunctionE
xpressionInvocation); | 2459 FunctionExpressionInvocation invocation = statement.expression as FunctionEx
pressionInvocation; |
| 3397 EngineTestCase.assertInstanceOf(FunctionExpression, invocation.function); | 2460 EngineTestCase.assertInstanceOf(FunctionExpression, invocation.function); |
| 3398 FunctionExpression expression = (invocation.function as FunctionExpression); | 2461 FunctionExpression expression = invocation.function as FunctionExpression; |
| 3399 JUnitTestCase.assertNotNull(expression.parameters); | 2462 JUnitTestCase.assertNotNull(expression.parameters); |
| 3400 JUnitTestCase.assertNotNull(expression.body); | 2463 JUnitTestCase.assertNotNull(expression.body); |
| 3401 ArgumentList list = invocation.argumentList; | 2464 ArgumentList list = invocation.argumentList; |
| 3402 JUnitTestCase.assertNotNull(list); | 2465 JUnitTestCase.assertNotNull(list); |
| 3403 EngineTestCase.assertSize(1, list.arguments); | 2466 EngineTestCase.assertSize(1, list.arguments); |
| 3404 } | 2467 } |
| 3405 void test_parseNonLabeledStatement_null() { | 2468 void test_parseNonLabeledStatement_null() { |
| 3406 ExpressionStatement statement = ParserTestCase.parse5("parseNonLabeledStatem
ent", "null;", []); | 2469 ExpressionStatement statement = ParserTestCase.parse6("parseNonLabeledStatem
ent", "null;", []); |
| 3407 JUnitTestCase.assertNotNull(statement.expression); | 2470 JUnitTestCase.assertNotNull(statement.expression); |
| 3408 } | 2471 } |
| 3409 void test_parseNonLabeledStatement_startingWithBuiltInIdentifier() { | 2472 void test_parseNonLabeledStatement_startingWithBuiltInIdentifier() { |
| 3410 ExpressionStatement statement = ParserTestCase.parse5("parseNonLabeledStatem
ent", "library.getName();", []); | 2473 ExpressionStatement statement = ParserTestCase.parse6("parseNonLabeledStatem
ent", "library.getName();", []); |
| 3411 JUnitTestCase.assertNotNull(statement.expression); | 2474 JUnitTestCase.assertNotNull(statement.expression); |
| 3412 } | 2475 } |
| 3413 void test_parseNonLabeledStatement_true() { | 2476 void test_parseNonLabeledStatement_true() { |
| 3414 ExpressionStatement statement = ParserTestCase.parse5("parseNonLabeledStatem
ent", "true;", []); | 2477 ExpressionStatement statement = ParserTestCase.parse6("parseNonLabeledStatem
ent", "true;", []); |
| 3415 JUnitTestCase.assertNotNull(statement.expression); | 2478 JUnitTestCase.assertNotNull(statement.expression); |
| 3416 } | 2479 } |
| 3417 void test_parseNonLabeledStatement_typeCast() { | 2480 void test_parseNonLabeledStatement_typeCast() { |
| 3418 ExpressionStatement statement = ParserTestCase.parse5("parseNonLabeledStatem
ent", "double.NAN as num;", []); | 2481 ExpressionStatement statement = ParserTestCase.parse6("parseNonLabeledStatem
ent", "double.NAN as num;", []); |
| 3419 JUnitTestCase.assertNotNull(statement.expression); | 2482 JUnitTestCase.assertNotNull(statement.expression); |
| 3420 } | 2483 } |
| 3421 void test_parseNormalFormalParameter_field_const_noType() { | 2484 void test_parseNormalFormalParameter_field_const_noType() { |
| 3422 FieldFormalParameter parameter = ParserTestCase.parse5("parseNormalFormalPar
ameter", "const this.a)", []); | 2485 FieldFormalParameter parameter = ParserTestCase.parse6("parseNormalFormalPar
ameter", "const this.a)", []); |
| 3423 JUnitTestCase.assertNotNull(parameter.keyword); | 2486 JUnitTestCase.assertNotNull(parameter.keyword); |
| 3424 JUnitTestCase.assertNull(parameter.type); | 2487 JUnitTestCase.assertNull(parameter.type); |
| 3425 JUnitTestCase.assertNotNull(parameter.identifier); | 2488 JUnitTestCase.assertNotNull(parameter.identifier); |
| 3426 } | 2489 } |
| 3427 void test_parseNormalFormalParameter_field_const_type() { | 2490 void test_parseNormalFormalParameter_field_const_type() { |
| 3428 FieldFormalParameter parameter = ParserTestCase.parse5("parseNormalFormalPar
ameter", "const A this.a)", []); | 2491 FieldFormalParameter parameter = ParserTestCase.parse6("parseNormalFormalPar
ameter", "const A this.a)", []); |
| 3429 JUnitTestCase.assertNotNull(parameter.keyword); | 2492 JUnitTestCase.assertNotNull(parameter.keyword); |
| 3430 JUnitTestCase.assertNotNull(parameter.type); | 2493 JUnitTestCase.assertNotNull(parameter.type); |
| 3431 JUnitTestCase.assertNotNull(parameter.identifier); | 2494 JUnitTestCase.assertNotNull(parameter.identifier); |
| 3432 } | 2495 } |
| 3433 void test_parseNormalFormalParameter_field_final_noType() { | 2496 void test_parseNormalFormalParameter_field_final_noType() { |
| 3434 FieldFormalParameter parameter = ParserTestCase.parse5("parseNormalFormalPar
ameter", "final this.a)", []); | 2497 FieldFormalParameter parameter = ParserTestCase.parse6("parseNormalFormalPar
ameter", "final this.a)", []); |
| 3435 JUnitTestCase.assertNotNull(parameter.keyword); | 2498 JUnitTestCase.assertNotNull(parameter.keyword); |
| 3436 JUnitTestCase.assertNull(parameter.type); | 2499 JUnitTestCase.assertNull(parameter.type); |
| 3437 JUnitTestCase.assertNotNull(parameter.identifier); | 2500 JUnitTestCase.assertNotNull(parameter.identifier); |
| 3438 } | 2501 } |
| 3439 void test_parseNormalFormalParameter_field_final_type() { | 2502 void test_parseNormalFormalParameter_field_final_type() { |
| 3440 FieldFormalParameter parameter = ParserTestCase.parse5("parseNormalFormalPar
ameter", "final A this.a)", []); | 2503 FieldFormalParameter parameter = ParserTestCase.parse6("parseNormalFormalPar
ameter", "final A this.a)", []); |
| 3441 JUnitTestCase.assertNotNull(parameter.keyword); | 2504 JUnitTestCase.assertNotNull(parameter.keyword); |
| 3442 JUnitTestCase.assertNotNull(parameter.type); | 2505 JUnitTestCase.assertNotNull(parameter.type); |
| 3443 JUnitTestCase.assertNotNull(parameter.identifier); | 2506 JUnitTestCase.assertNotNull(parameter.identifier); |
| 3444 } | 2507 } |
| 3445 void test_parseNormalFormalParameter_field_noType() { | 2508 void test_parseNormalFormalParameter_field_noType() { |
| 3446 FieldFormalParameter parameter = ParserTestCase.parse5("parseNormalFormalPar
ameter", "this.a)", []); | 2509 FieldFormalParameter parameter = ParserTestCase.parse6("parseNormalFormalPar
ameter", "this.a)", []); |
| 3447 JUnitTestCase.assertNull(parameter.keyword); | 2510 JUnitTestCase.assertNull(parameter.keyword); |
| 3448 JUnitTestCase.assertNull(parameter.type); | 2511 JUnitTestCase.assertNull(parameter.type); |
| 3449 JUnitTestCase.assertNotNull(parameter.identifier); | 2512 JUnitTestCase.assertNotNull(parameter.identifier); |
| 3450 } | 2513 } |
| 3451 void test_parseNormalFormalParameter_field_type() { | 2514 void test_parseNormalFormalParameter_field_type() { |
| 3452 FieldFormalParameter parameter = ParserTestCase.parse5("parseNormalFormalPar
ameter", "A this.a)", []); | 2515 FieldFormalParameter parameter = ParserTestCase.parse6("parseNormalFormalPar
ameter", "A this.a)", []); |
| 3453 JUnitTestCase.assertNull(parameter.keyword); | 2516 JUnitTestCase.assertNull(parameter.keyword); |
| 3454 JUnitTestCase.assertNotNull(parameter.type); | 2517 JUnitTestCase.assertNotNull(parameter.type); |
| 3455 JUnitTestCase.assertNotNull(parameter.identifier); | 2518 JUnitTestCase.assertNotNull(parameter.identifier); |
| 3456 } | 2519 } |
| 3457 void test_parseNormalFormalParameter_field_var() { | 2520 void test_parseNormalFormalParameter_field_var() { |
| 3458 FieldFormalParameter parameter = ParserTestCase.parse5("parseNormalFormalPar
ameter", "var this.a)", []); | 2521 FieldFormalParameter parameter = ParserTestCase.parse6("parseNormalFormalPar
ameter", "var this.a)", []); |
| 3459 JUnitTestCase.assertNotNull(parameter.keyword); | 2522 JUnitTestCase.assertNotNull(parameter.keyword); |
| 3460 JUnitTestCase.assertNull(parameter.type); | 2523 JUnitTestCase.assertNull(parameter.type); |
| 3461 JUnitTestCase.assertNotNull(parameter.identifier); | 2524 JUnitTestCase.assertNotNull(parameter.identifier); |
| 3462 } | 2525 } |
| 3463 void test_parseNormalFormalParameter_function_noType() { | 2526 void test_parseNormalFormalParameter_function_noType() { |
| 3464 FunctionTypedFormalParameter parameter = ParserTestCase.parse5("parseNormalF
ormalParameter", "a())", []); | 2527 FunctionTypedFormalParameter parameter = ParserTestCase.parse6("parseNormalF
ormalParameter", "a())", []); |
| 3465 JUnitTestCase.assertNull(parameter.returnType); | 2528 JUnitTestCase.assertNull(parameter.returnType); |
| 3466 JUnitTestCase.assertNotNull(parameter.identifier); | 2529 JUnitTestCase.assertNotNull(parameter.identifier); |
| 3467 JUnitTestCase.assertNotNull(parameter.parameters); | 2530 JUnitTestCase.assertNotNull(parameter.parameters); |
| 3468 } | 2531 } |
| 3469 void test_parseNormalFormalParameter_function_type() { | 2532 void test_parseNormalFormalParameter_function_type() { |
| 3470 FunctionTypedFormalParameter parameter = ParserTestCase.parse5("parseNormalF
ormalParameter", "A a())", []); | 2533 FunctionTypedFormalParameter parameter = ParserTestCase.parse6("parseNormalF
ormalParameter", "A a())", []); |
| 3471 JUnitTestCase.assertNotNull(parameter.returnType); | 2534 JUnitTestCase.assertNotNull(parameter.returnType); |
| 3472 JUnitTestCase.assertNotNull(parameter.identifier); | 2535 JUnitTestCase.assertNotNull(parameter.identifier); |
| 3473 JUnitTestCase.assertNotNull(parameter.parameters); | 2536 JUnitTestCase.assertNotNull(parameter.parameters); |
| 3474 } | 2537 } |
| 3475 void test_parseNormalFormalParameter_function_void() { | 2538 void test_parseNormalFormalParameter_function_void() { |
| 3476 FunctionTypedFormalParameter parameter = ParserTestCase.parse5("parseNormalF
ormalParameter", "void a())", []); | 2539 FunctionTypedFormalParameter parameter = ParserTestCase.parse6("parseNormalF
ormalParameter", "void a())", []); |
| 3477 JUnitTestCase.assertNotNull(parameter.returnType); | 2540 JUnitTestCase.assertNotNull(parameter.returnType); |
| 3478 JUnitTestCase.assertNotNull(parameter.identifier); | 2541 JUnitTestCase.assertNotNull(parameter.identifier); |
| 3479 JUnitTestCase.assertNotNull(parameter.parameters); | 2542 JUnitTestCase.assertNotNull(parameter.parameters); |
| 3480 } | 2543 } |
| 3481 void test_parseNormalFormalParameter_simple_const_noType() { | 2544 void test_parseNormalFormalParameter_simple_const_noType() { |
| 3482 SimpleFormalParameter parameter = ParserTestCase.parse5("parseNormalFormalPa
rameter", "const a)", []); | 2545 SimpleFormalParameter parameter = ParserTestCase.parse6("parseNormalFormalPa
rameter", "const a)", []); |
| 3483 JUnitTestCase.assertNotNull(parameter.keyword); | 2546 JUnitTestCase.assertNotNull(parameter.keyword); |
| 3484 JUnitTestCase.assertNull(parameter.type); | 2547 JUnitTestCase.assertNull(parameter.type); |
| 3485 JUnitTestCase.assertNotNull(parameter.identifier); | 2548 JUnitTestCase.assertNotNull(parameter.identifier); |
| 3486 } | 2549 } |
| 3487 void test_parseNormalFormalParameter_simple_const_type() { | 2550 void test_parseNormalFormalParameter_simple_const_type() { |
| 3488 SimpleFormalParameter parameter = ParserTestCase.parse5("parseNormalFormalPa
rameter", "const A a)", []); | 2551 SimpleFormalParameter parameter = ParserTestCase.parse6("parseNormalFormalPa
rameter", "const A a)", []); |
| 3489 JUnitTestCase.assertNotNull(parameter.keyword); | 2552 JUnitTestCase.assertNotNull(parameter.keyword); |
| 3490 JUnitTestCase.assertNotNull(parameter.type); | 2553 JUnitTestCase.assertNotNull(parameter.type); |
| 3491 JUnitTestCase.assertNotNull(parameter.identifier); | 2554 JUnitTestCase.assertNotNull(parameter.identifier); |
| 3492 } | 2555 } |
| 3493 void test_parseNormalFormalParameter_simple_final_noType() { | 2556 void test_parseNormalFormalParameter_simple_final_noType() { |
| 3494 SimpleFormalParameter parameter = ParserTestCase.parse5("parseNormalFormalPa
rameter", "final a)", []); | 2557 SimpleFormalParameter parameter = ParserTestCase.parse6("parseNormalFormalPa
rameter", "final a)", []); |
| 3495 JUnitTestCase.assertNotNull(parameter.keyword); | 2558 JUnitTestCase.assertNotNull(parameter.keyword); |
| 3496 JUnitTestCase.assertNull(parameter.type); | 2559 JUnitTestCase.assertNull(parameter.type); |
| 3497 JUnitTestCase.assertNotNull(parameter.identifier); | 2560 JUnitTestCase.assertNotNull(parameter.identifier); |
| 3498 } | 2561 } |
| 3499 void test_parseNormalFormalParameter_simple_final_type() { | 2562 void test_parseNormalFormalParameter_simple_final_type() { |
| 3500 SimpleFormalParameter parameter = ParserTestCase.parse5("parseNormalFormalPa
rameter", "final A a)", []); | 2563 SimpleFormalParameter parameter = ParserTestCase.parse6("parseNormalFormalPa
rameter", "final A a)", []); |
| 3501 JUnitTestCase.assertNotNull(parameter.keyword); | 2564 JUnitTestCase.assertNotNull(parameter.keyword); |
| 3502 JUnitTestCase.assertNotNull(parameter.type); | 2565 JUnitTestCase.assertNotNull(parameter.type); |
| 3503 JUnitTestCase.assertNotNull(parameter.identifier); | 2566 JUnitTestCase.assertNotNull(parameter.identifier); |
| 3504 } | 2567 } |
| 3505 void test_parseNormalFormalParameter_simple_noType() { | 2568 void test_parseNormalFormalParameter_simple_noType() { |
| 3506 SimpleFormalParameter parameter = ParserTestCase.parse5("parseNormalFormalPa
rameter", "a)", []); | 2569 SimpleFormalParameter parameter = ParserTestCase.parse6("parseNormalFormalPa
rameter", "a)", []); |
| 3507 JUnitTestCase.assertNull(parameter.keyword); | 2570 JUnitTestCase.assertNull(parameter.keyword); |
| 3508 JUnitTestCase.assertNull(parameter.type); | 2571 JUnitTestCase.assertNull(parameter.type); |
| 3509 JUnitTestCase.assertNotNull(parameter.identifier); | 2572 JUnitTestCase.assertNotNull(parameter.identifier); |
| 3510 } | 2573 } |
| 3511 void test_parseNormalFormalParameter_simple_type() { | 2574 void test_parseNormalFormalParameter_simple_type() { |
| 3512 SimpleFormalParameter parameter = ParserTestCase.parse5("parseNormalFormalPa
rameter", "A a)", []); | 2575 SimpleFormalParameter parameter = ParserTestCase.parse6("parseNormalFormalPa
rameter", "A a)", []); |
| 3513 JUnitTestCase.assertNull(parameter.keyword); | 2576 JUnitTestCase.assertNull(parameter.keyword); |
| 3514 JUnitTestCase.assertNotNull(parameter.type); | 2577 JUnitTestCase.assertNotNull(parameter.type); |
| 3515 JUnitTestCase.assertNotNull(parameter.identifier); | 2578 JUnitTestCase.assertNotNull(parameter.identifier); |
| 3516 } | 2579 } |
| 3517 void test_parseOperator() { | 2580 void test_parseOperator() { |
| 3518 Comment comment = Comment.createDocumentationComment(new List<Token>(0)); | 2581 Comment comment = Comment.createDocumentationComment(new List<Token>(0)); |
| 3519 TypeName returnType = new TypeName.full(new SimpleIdentifier.full(null), nul
l); | 2582 TypeName returnType = new TypeName.full(new SimpleIdentifier.full(null), nul
l); |
| 3520 MethodDeclaration method = ParserTestCase.parse("parseOperator", <Object> [c
ommentAndMetadata(comment, []), null, returnType], "operator +(A a);"); | 2583 MethodDeclaration method = ParserTestCase.parse("parseOperator", <Object> [c
ommentAndMetadata(comment, []), null, returnType], "operator +(A a);"); |
| 3521 JUnitTestCase.assertNotNull(method.body); | 2584 JUnitTestCase.assertNotNull(method.body); |
| 3522 JUnitTestCase.assertEquals(comment, method.documentationComment); | 2585 JUnitTestCase.assertEquals(comment, method.documentationComment); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 3537 JUnitTestCase.assertNotNull(directive.semicolon); | 2600 JUnitTestCase.assertNotNull(directive.semicolon); |
| 3538 } | 2601 } |
| 3539 void test_parsePartDirective_partOf() { | 2602 void test_parsePartDirective_partOf() { |
| 3540 PartOfDirective directive = ParserTestCase.parse("parsePartDirective", <Obje
ct> [emptyCommentAndMetadata()], "part of l;"); | 2603 PartOfDirective directive = ParserTestCase.parse("parsePartDirective", <Obje
ct> [emptyCommentAndMetadata()], "part of l;"); |
| 3541 JUnitTestCase.assertNotNull(directive.partToken); | 2604 JUnitTestCase.assertNotNull(directive.partToken); |
| 3542 JUnitTestCase.assertNotNull(directive.ofToken); | 2605 JUnitTestCase.assertNotNull(directive.ofToken); |
| 3543 JUnitTestCase.assertNotNull(directive.libraryName); | 2606 JUnitTestCase.assertNotNull(directive.libraryName); |
| 3544 JUnitTestCase.assertNotNull(directive.semicolon); | 2607 JUnitTestCase.assertNotNull(directive.semicolon); |
| 3545 } | 2608 } |
| 3546 void test_parsePostfixExpression_decrement() { | 2609 void test_parsePostfixExpression_decrement() { |
| 3547 PostfixExpression expression = ParserTestCase.parse5("parsePostfixExpression
", "i--", []); | 2610 PostfixExpression expression = ParserTestCase.parse6("parsePostfixExpression
", "i--", []); |
| 3548 JUnitTestCase.assertNotNull(expression.operand); | 2611 JUnitTestCase.assertNotNull(expression.operand); |
| 3549 JUnitTestCase.assertNotNull(expression.operator); | 2612 JUnitTestCase.assertNotNull(expression.operator); |
| 3550 JUnitTestCase.assertEquals(TokenType.MINUS_MINUS, expression.operator.type); | 2613 JUnitTestCase.assertEquals(TokenType.MINUS_MINUS, expression.operator.type); |
| 3551 } | 2614 } |
| 3552 void test_parsePostfixExpression_increment() { | 2615 void test_parsePostfixExpression_increment() { |
| 3553 PostfixExpression expression = ParserTestCase.parse5("parsePostfixExpression
", "i++", []); | 2616 PostfixExpression expression = ParserTestCase.parse6("parsePostfixExpression
", "i++", []); |
| 3554 JUnitTestCase.assertNotNull(expression.operand); | 2617 JUnitTestCase.assertNotNull(expression.operand); |
| 3555 JUnitTestCase.assertNotNull(expression.operator); | 2618 JUnitTestCase.assertNotNull(expression.operator); |
| 3556 JUnitTestCase.assertEquals(TokenType.PLUS_PLUS, expression.operator.type); | 2619 JUnitTestCase.assertEquals(TokenType.PLUS_PLUS, expression.operator.type); |
| 3557 } | 2620 } |
| 3558 void test_parsePostfixExpression_none_indexExpression() { | 2621 void test_parsePostfixExpression_none_indexExpression() { |
| 3559 IndexExpression expression = ParserTestCase.parse5("parsePostfixExpression",
"a[0]", []); | 2622 IndexExpression expression = ParserTestCase.parse6("parsePostfixExpression",
"a[0]", []); |
| 3560 JUnitTestCase.assertNotNull(expression.array); | 2623 JUnitTestCase.assertNotNull(expression.array); |
| 3561 JUnitTestCase.assertNotNull(expression.index); | 2624 JUnitTestCase.assertNotNull(expression.index); |
| 3562 } | 2625 } |
| 3563 void test_parsePostfixExpression_none_methodInvocation() { | 2626 void test_parsePostfixExpression_none_methodInvocation() { |
| 3564 MethodInvocation expression = ParserTestCase.parse5("parsePostfixExpression"
, "a.m()", []); | 2627 MethodInvocation expression = ParserTestCase.parse6("parsePostfixExpression"
, "a.m()", []); |
| 3565 JUnitTestCase.assertNotNull(expression.target); | 2628 JUnitTestCase.assertNotNull(expression.target); |
| 3566 JUnitTestCase.assertNotNull(expression.methodName); | 2629 JUnitTestCase.assertNotNull(expression.methodName); |
| 3567 JUnitTestCase.assertNotNull(expression.argumentList); | 2630 JUnitTestCase.assertNotNull(expression.argumentList); |
| 3568 } | 2631 } |
| 3569 void test_parsePostfixExpression_none_propertyAccess() { | 2632 void test_parsePostfixExpression_none_propertyAccess() { |
| 3570 PrefixedIdentifier expression = ParserTestCase.parse5("parsePostfixExpressio
n", "a.b", []); | 2633 PrefixedIdentifier expression = ParserTestCase.parse6("parsePostfixExpressio
n", "a.b", []); |
| 3571 JUnitTestCase.assertNotNull(expression.prefix); | 2634 JUnitTestCase.assertNotNull(expression.prefix); |
| 3572 JUnitTestCase.assertNotNull(expression.identifier); | 2635 JUnitTestCase.assertNotNull(expression.identifier); |
| 3573 } | 2636 } |
| 3574 void test_parsePrefixedIdentifier_noPrefix() { | 2637 void test_parsePrefixedIdentifier_noPrefix() { |
| 3575 String lexeme = "bar"; | 2638 String lexeme = "bar"; |
| 3576 SimpleIdentifier identifier = ParserTestCase.parse5("parsePrefixedIdentifier
", lexeme, []); | 2639 SimpleIdentifier identifier = ParserTestCase.parse6("parsePrefixedIdentifier
", lexeme, []); |
| 3577 JUnitTestCase.assertNotNull(identifier.token); | 2640 JUnitTestCase.assertNotNull(identifier.token); |
| 3578 JUnitTestCase.assertEquals(lexeme, identifier.name); | 2641 JUnitTestCase.assertEquals(lexeme, identifier.name); |
| 3579 } | 2642 } |
| 3580 void test_parsePrefixedIdentifier_prefix() { | 2643 void test_parsePrefixedIdentifier_prefix() { |
| 3581 String lexeme = "foo.bar"; | 2644 String lexeme = "foo.bar"; |
| 3582 PrefixedIdentifier identifier = ParserTestCase.parse5("parsePrefixedIdentifi
er", lexeme, []); | 2645 PrefixedIdentifier identifier = ParserTestCase.parse6("parsePrefixedIdentifi
er", lexeme, []); |
| 3583 JUnitTestCase.assertEquals("foo", identifier.prefix.name); | 2646 JUnitTestCase.assertEquals("foo", identifier.prefix.name); |
| 3584 JUnitTestCase.assertNotNull(identifier.period); | 2647 JUnitTestCase.assertNotNull(identifier.period); |
| 3585 JUnitTestCase.assertEquals("bar", identifier.identifier.name); | 2648 JUnitTestCase.assertEquals("bar", identifier.identifier.name); |
| 3586 } | 2649 } |
| 3587 void test_parsePrimaryExpression_argumentDefinitionTest() { | 2650 void test_parsePrimaryExpression_argumentDefinitionTest() { |
| 3588 ArgumentDefinitionTest expression = ParserTestCase.parse5("parseArgumentDefi
nitionTest", "?a", []); | 2651 ArgumentDefinitionTest expression = ParserTestCase.parse6("parseArgumentDefi
nitionTest", "?a", []); |
| 3589 JUnitTestCase.assertNotNull(expression.question); | 2652 JUnitTestCase.assertNotNull(expression.question); |
| 3590 JUnitTestCase.assertNotNull(expression.identifier); | 2653 JUnitTestCase.assertNotNull(expression.identifier); |
| 3591 } | 2654 } |
| 3592 void test_parsePrimaryExpression_const() { | 2655 void test_parsePrimaryExpression_const() { |
| 3593 InstanceCreationExpression expression = ParserTestCase.parse5("parsePrimaryE
xpression", "const A()", []); | 2656 InstanceCreationExpression expression = ParserTestCase.parse6("parsePrimaryE
xpression", "const A()", []); |
| 3594 JUnitTestCase.assertNotNull(expression); | 2657 JUnitTestCase.assertNotNull(expression); |
| 3595 } | 2658 } |
| 3596 void test_parsePrimaryExpression_double() { | 2659 void test_parsePrimaryExpression_double() { |
| 3597 String doubleLiteral = "3.2e4"; | 2660 String doubleLiteral = "3.2e4"; |
| 3598 DoubleLiteral literal = ParserTestCase.parse5("parsePrimaryExpression", doub
leLiteral, []); | 2661 DoubleLiteral literal = ParserTestCase.parse6("parsePrimaryExpression", doub
leLiteral, []); |
| 3599 JUnitTestCase.assertNotNull(literal.literal); | 2662 JUnitTestCase.assertNotNull(literal.literal); |
| 3600 JUnitTestCase.assertEquals(double.parse(doubleLiteral), literal.value); | 2663 JUnitTestCase.assertEquals(double.parse(doubleLiteral), literal.value); |
| 3601 } | 2664 } |
| 3602 void test_parsePrimaryExpression_false() { | 2665 void test_parsePrimaryExpression_false() { |
| 3603 BooleanLiteral literal = ParserTestCase.parse5("parsePrimaryExpression", "fa
lse", []); | 2666 BooleanLiteral literal = ParserTestCase.parse6("parsePrimaryExpression", "fa
lse", []); |
| 3604 JUnitTestCase.assertNotNull(literal.literal); | 2667 JUnitTestCase.assertNotNull(literal.literal); |
| 3605 JUnitTestCase.assertFalse(literal.value); | 2668 JUnitTestCase.assertFalse(literal.value); |
| 3606 } | 2669 } |
| 3607 void test_parsePrimaryExpression_function_arguments() { | 2670 void test_parsePrimaryExpression_function_arguments() { |
| 3608 FunctionExpression expression = ParserTestCase.parse5("parsePrimaryExpressio
n", "(int i) => i + 1", []); | 2671 FunctionExpression expression = ParserTestCase.parse6("parsePrimaryExpressio
n", "(int i) => i + 1", []); |
| 3609 JUnitTestCase.assertNotNull(expression.parameters); | 2672 JUnitTestCase.assertNotNull(expression.parameters); |
| 3610 JUnitTestCase.assertNotNull(expression.body); | 2673 JUnitTestCase.assertNotNull(expression.body); |
| 3611 } | 2674 } |
| 3612 void test_parsePrimaryExpression_function_noArguments() { | 2675 void test_parsePrimaryExpression_function_noArguments() { |
| 3613 FunctionExpression expression = ParserTestCase.parse5("parsePrimaryExpressio
n", "() => 42", []); | 2676 FunctionExpression expression = ParserTestCase.parse6("parsePrimaryExpressio
n", "() => 42", []); |
| 3614 JUnitTestCase.assertNotNull(expression.parameters); | 2677 JUnitTestCase.assertNotNull(expression.parameters); |
| 3615 JUnitTestCase.assertNotNull(expression.body); | 2678 JUnitTestCase.assertNotNull(expression.body); |
| 3616 } | 2679 } |
| 3617 void test_parsePrimaryExpression_hex() { | 2680 void test_parsePrimaryExpression_hex() { |
| 3618 String hexLiteral = "3F"; | 2681 String hexLiteral = "3F"; |
| 3619 IntegerLiteral literal = ParserTestCase.parse5("parsePrimaryExpression", "0x
${hexLiteral}", []); | 2682 IntegerLiteral literal = ParserTestCase.parse6("parsePrimaryExpression", "0x
${hexLiteral}", []); |
| 3620 JUnitTestCase.assertNotNull(literal.literal); | 2683 JUnitTestCase.assertNotNull(literal.literal); |
| 3621 JUnitTestCase.assertEquals(int.parse(hexLiteral, radix: 16), literal.value); | 2684 JUnitTestCase.assertEquals(int.parse(hexLiteral, radix: 16), literal.value); |
| 3622 } | 2685 } |
| 3623 void test_parsePrimaryExpression_identifier() { | 2686 void test_parsePrimaryExpression_identifier() { |
| 3624 SimpleIdentifier identifier = ParserTestCase.parse5("parsePrimaryExpression"
, "a", []); | 2687 SimpleIdentifier identifier = ParserTestCase.parse6("parsePrimaryExpression"
, "a", []); |
| 3625 JUnitTestCase.assertNotNull(identifier); | 2688 JUnitTestCase.assertNotNull(identifier); |
| 3626 } | 2689 } |
| 3627 void test_parsePrimaryExpression_int() { | 2690 void test_parsePrimaryExpression_int() { |
| 3628 String intLiteral = "472"; | 2691 String intLiteral = "472"; |
| 3629 IntegerLiteral literal = ParserTestCase.parse5("parsePrimaryExpression", int
Literal, []); | 2692 IntegerLiteral literal = ParserTestCase.parse6("parsePrimaryExpression", int
Literal, []); |
| 3630 JUnitTestCase.assertNotNull(literal.literal); | 2693 JUnitTestCase.assertNotNull(literal.literal); |
| 3631 JUnitTestCase.assertEquals(int.parse(intLiteral), literal.value); | 2694 JUnitTestCase.assertEquals(int.parse(intLiteral), literal.value); |
| 3632 } | 2695 } |
| 3633 void test_parsePrimaryExpression_listLiteral() { | 2696 void test_parsePrimaryExpression_listLiteral() { |
| 3634 ListLiteral literal = ParserTestCase.parse5("parsePrimaryExpression", "[ ]",
[]); | 2697 ListLiteral literal = ParserTestCase.parse6("parsePrimaryExpression", "[ ]",
[]); |
| 3635 JUnitTestCase.assertNotNull(literal); | 2698 JUnitTestCase.assertNotNull(literal); |
| 3636 } | 2699 } |
| 3637 void test_parsePrimaryExpression_listLiteral_index() { | 2700 void test_parsePrimaryExpression_listLiteral_index() { |
| 3638 ListLiteral literal = ParserTestCase.parse5("parsePrimaryExpression", "[]",
[]); | 2701 ListLiteral literal = ParserTestCase.parse6("parsePrimaryExpression", "[]",
[]); |
| 3639 JUnitTestCase.assertNotNull(literal); | 2702 JUnitTestCase.assertNotNull(literal); |
| 3640 } | 2703 } |
| 3641 void test_parsePrimaryExpression_listLiteral_typed() { | 2704 void test_parsePrimaryExpression_listLiteral_typed() { |
| 3642 ListLiteral literal = ParserTestCase.parse5("parsePrimaryExpression", "<A>[
]", []); | 2705 ListLiteral literal = ParserTestCase.parse6("parsePrimaryExpression", "<A>[
]", []); |
| 3643 JUnitTestCase.assertNotNull(literal.typeArguments); | 2706 JUnitTestCase.assertNotNull(literal.typeArguments); |
| 3644 EngineTestCase.assertSize(1, literal.typeArguments.arguments); | 2707 EngineTestCase.assertSize(1, literal.typeArguments.arguments); |
| 3645 } | 2708 } |
| 3646 void test_parsePrimaryExpression_mapLiteral() { | 2709 void test_parsePrimaryExpression_mapLiteral() { |
| 3647 MapLiteral literal = ParserTestCase.parse5("parsePrimaryExpression", "{}", [
]); | 2710 MapLiteral literal = ParserTestCase.parse6("parsePrimaryExpression", "{}", [
]); |
| 3648 JUnitTestCase.assertNotNull(literal); | 2711 JUnitTestCase.assertNotNull(literal); |
| 3649 } | 2712 } |
| 3650 void test_parsePrimaryExpression_mapLiteral_typed() { | 2713 void test_parsePrimaryExpression_mapLiteral_typed() { |
| 3651 MapLiteral literal = ParserTestCase.parse5("parsePrimaryExpression", "<A>{}"
, []); | 2714 MapLiteral literal = ParserTestCase.parse6("parsePrimaryExpression", "<A>{}"
, []); |
| 3652 JUnitTestCase.assertNotNull(literal.typeArguments); | 2715 JUnitTestCase.assertNotNull(literal.typeArguments); |
| 3653 EngineTestCase.assertSize(1, literal.typeArguments.arguments); | 2716 EngineTestCase.assertSize(1, literal.typeArguments.arguments); |
| 3654 } | 2717 } |
| 3655 void test_parsePrimaryExpression_new() { | 2718 void test_parsePrimaryExpression_new() { |
| 3656 InstanceCreationExpression expression = ParserTestCase.parse5("parsePrimaryE
xpression", "new A()", []); | 2719 InstanceCreationExpression expression = ParserTestCase.parse6("parsePrimaryE
xpression", "new A()", []); |
| 3657 JUnitTestCase.assertNotNull(expression); | 2720 JUnitTestCase.assertNotNull(expression); |
| 3658 } | 2721 } |
| 3659 void test_parsePrimaryExpression_null() { | 2722 void test_parsePrimaryExpression_null() { |
| 3660 NullLiteral literal = ParserTestCase.parse5("parsePrimaryExpression", "null"
, []); | 2723 NullLiteral literal = ParserTestCase.parse6("parsePrimaryExpression", "null"
, []); |
| 3661 JUnitTestCase.assertNotNull(literal.literal); | 2724 JUnitTestCase.assertNotNull(literal.literal); |
| 3662 } | 2725 } |
| 3663 void test_parsePrimaryExpression_parenthesized() { | 2726 void test_parsePrimaryExpression_parenthesized() { |
| 3664 ParenthesizedExpression expression = ParserTestCase.parse5("parsePrimaryExpr
ession", "()", []); | 2727 ParenthesizedExpression expression = ParserTestCase.parse6("parsePrimaryExpr
ession", "()", []); |
| 3665 JUnitTestCase.assertNotNull(expression); | 2728 JUnitTestCase.assertNotNull(expression); |
| 3666 } | 2729 } |
| 3667 void test_parsePrimaryExpression_string() { | 2730 void test_parsePrimaryExpression_string() { |
| 3668 SimpleStringLiteral literal = ParserTestCase.parse5("parsePrimaryExpression"
, "\"string\"", []); | 2731 SimpleStringLiteral literal = ParserTestCase.parse6("parsePrimaryExpression"
, "\"string\"", []); |
| 3669 JUnitTestCase.assertFalse(literal.isMultiline()); | 2732 JUnitTestCase.assertFalse(literal.isMultiline()); |
| 3670 JUnitTestCase.assertEquals("string", literal.value); | 2733 JUnitTestCase.assertEquals("string", literal.value); |
| 3671 } | 2734 } |
| 3672 void test_parsePrimaryExpression_super() { | 2735 void test_parsePrimaryExpression_super() { |
| 3673 PropertyAccess propertyAccess = ParserTestCase.parse5("parsePrimaryExpressio
n", "super.x", []); | 2736 PropertyAccess propertyAccess = ParserTestCase.parse6("parsePrimaryExpressio
n", "super.x", []); |
| 3674 JUnitTestCase.assertTrue(propertyAccess.target is SuperExpression); | 2737 JUnitTestCase.assertTrue(propertyAccess.target is SuperExpression); |
| 3675 JUnitTestCase.assertNotNull(propertyAccess.operator); | 2738 JUnitTestCase.assertNotNull(propertyAccess.operator); |
| 3676 JUnitTestCase.assertEquals(TokenType.PERIOD, propertyAccess.operator.type); | 2739 JUnitTestCase.assertEquals(TokenType.PERIOD, propertyAccess.operator.type); |
| 3677 JUnitTestCase.assertNotNull(propertyAccess.propertyName); | 2740 JUnitTestCase.assertNotNull(propertyAccess.propertyName); |
| 3678 } | 2741 } |
| 3679 void test_parsePrimaryExpression_this() { | 2742 void test_parsePrimaryExpression_this() { |
| 3680 ThisExpression expression = ParserTestCase.parse5("parsePrimaryExpression",
"this", []); | 2743 ThisExpression expression = ParserTestCase.parse6("parsePrimaryExpression",
"this", []); |
| 3681 JUnitTestCase.assertNotNull(expression.keyword); | 2744 JUnitTestCase.assertNotNull(expression.keyword); |
| 3682 } | 2745 } |
| 3683 void test_parsePrimaryExpression_true() { | 2746 void test_parsePrimaryExpression_true() { |
| 3684 BooleanLiteral literal = ParserTestCase.parse5("parsePrimaryExpression", "tr
ue", []); | 2747 BooleanLiteral literal = ParserTestCase.parse6("parsePrimaryExpression", "tr
ue", []); |
| 3685 JUnitTestCase.assertNotNull(literal.literal); | 2748 JUnitTestCase.assertNotNull(literal.literal); |
| 3686 JUnitTestCase.assertTrue(literal.value); | 2749 JUnitTestCase.assertTrue(literal.value); |
| 3687 } | 2750 } |
| 3688 void test_Parser() { | 2751 void test_Parser() { |
| 3689 JUnitTestCase.assertNotNull(new Parser(null, null)); | 2752 JUnitTestCase.assertNotNull(new Parser(null, null)); |
| 3690 } | 2753 } |
| 3691 void test_parseRedirectingConstructorInvocation_named() { | 2754 void test_parseRedirectingConstructorInvocation_named() { |
| 3692 RedirectingConstructorInvocation invocation = ParserTestCase.parse5("parseRe
directingConstructorInvocation", "this.a()", []); | 2755 RedirectingConstructorInvocation invocation = ParserTestCase.parse6("parseRe
directingConstructorInvocation", "this.a()", []); |
| 3693 JUnitTestCase.assertNotNull(invocation.argumentList); | 2756 JUnitTestCase.assertNotNull(invocation.argumentList); |
| 3694 JUnitTestCase.assertNotNull(invocation.constructorName); | 2757 JUnitTestCase.assertNotNull(invocation.constructorName); |
| 3695 JUnitTestCase.assertNotNull(invocation.keyword); | 2758 JUnitTestCase.assertNotNull(invocation.keyword); |
| 3696 JUnitTestCase.assertNotNull(invocation.period); | 2759 JUnitTestCase.assertNotNull(invocation.period); |
| 3697 } | 2760 } |
| 3698 void test_parseRedirectingConstructorInvocation_unnamed() { | 2761 void test_parseRedirectingConstructorInvocation_unnamed() { |
| 3699 RedirectingConstructorInvocation invocation = ParserTestCase.parse5("parseRe
directingConstructorInvocation", "this()", []); | 2762 RedirectingConstructorInvocation invocation = ParserTestCase.parse6("parseRe
directingConstructorInvocation", "this()", []); |
| 3700 JUnitTestCase.assertNotNull(invocation.argumentList); | 2763 JUnitTestCase.assertNotNull(invocation.argumentList); |
| 3701 JUnitTestCase.assertNull(invocation.constructorName); | 2764 JUnitTestCase.assertNull(invocation.constructorName); |
| 3702 JUnitTestCase.assertNotNull(invocation.keyword); | 2765 JUnitTestCase.assertNotNull(invocation.keyword); |
| 3703 JUnitTestCase.assertNull(invocation.period); | 2766 JUnitTestCase.assertNull(invocation.period); |
| 3704 } | 2767 } |
| 3705 void test_parseRelationalExpression_as() { | 2768 void test_parseRelationalExpression_as() { |
| 3706 AsExpression expression = ParserTestCase.parse5("parseRelationalExpression",
"x as Y", []); | 2769 AsExpression expression = ParserTestCase.parse6("parseRelationalExpression",
"x as Y", []); |
| 3707 JUnitTestCase.assertNotNull(expression.expression); | 2770 JUnitTestCase.assertNotNull(expression.expression); |
| 3708 JUnitTestCase.assertNotNull(expression.asOperator); | 2771 JUnitTestCase.assertNotNull(expression.asOperator); |
| 3709 JUnitTestCase.assertNotNull(expression.type); | 2772 JUnitTestCase.assertNotNull(expression.type); |
| 3710 } | 2773 } |
| 3711 void test_parseRelationalExpression_is() { | 2774 void test_parseRelationalExpression_is() { |
| 3712 IsExpression expression = ParserTestCase.parse5("parseRelationalExpression",
"x is y", []); | 2775 IsExpression expression = ParserTestCase.parse6("parseRelationalExpression",
"x is y", []); |
| 3713 JUnitTestCase.assertNotNull(expression.expression); | 2776 JUnitTestCase.assertNotNull(expression.expression); |
| 3714 JUnitTestCase.assertNotNull(expression.isOperator); | 2777 JUnitTestCase.assertNotNull(expression.isOperator); |
| 3715 JUnitTestCase.assertNull(expression.notOperator); | 2778 JUnitTestCase.assertNull(expression.notOperator); |
| 3716 JUnitTestCase.assertNotNull(expression.type); | 2779 JUnitTestCase.assertNotNull(expression.type); |
| 3717 } | 2780 } |
| 3718 void test_parseRelationalExpression_isNot() { | 2781 void test_parseRelationalExpression_isNot() { |
| 3719 IsExpression expression = ParserTestCase.parse5("parseRelationalExpression",
"x is! y", []); | 2782 IsExpression expression = ParserTestCase.parse6("parseRelationalExpression",
"x is! y", []); |
| 3720 JUnitTestCase.assertNotNull(expression.expression); | 2783 JUnitTestCase.assertNotNull(expression.expression); |
| 3721 JUnitTestCase.assertNotNull(expression.isOperator); | 2784 JUnitTestCase.assertNotNull(expression.isOperator); |
| 3722 JUnitTestCase.assertNotNull(expression.notOperator); | 2785 JUnitTestCase.assertNotNull(expression.notOperator); |
| 3723 JUnitTestCase.assertNotNull(expression.type); | 2786 JUnitTestCase.assertNotNull(expression.type); |
| 3724 } | 2787 } |
| 3725 void test_parseRelationalExpression_normal() { | 2788 void test_parseRelationalExpression_normal() { |
| 3726 BinaryExpression expression = ParserTestCase.parse5("parseRelationalExpressi
on", "x < y", []); | 2789 BinaryExpression expression = ParserTestCase.parse6("parseRelationalExpressi
on", "x < y", []); |
| 3727 JUnitTestCase.assertNotNull(expression.leftOperand); | 2790 JUnitTestCase.assertNotNull(expression.leftOperand); |
| 3728 JUnitTestCase.assertNotNull(expression.operator); | 2791 JUnitTestCase.assertNotNull(expression.operator); |
| 3729 JUnitTestCase.assertEquals(TokenType.LT, expression.operator.type); | 2792 JUnitTestCase.assertEquals(TokenType.LT, expression.operator.type); |
| 3730 JUnitTestCase.assertNotNull(expression.rightOperand); | 2793 JUnitTestCase.assertNotNull(expression.rightOperand); |
| 3731 } | 2794 } |
| 3732 void test_parseRelationalExpression_super() { | 2795 void test_parseRelationalExpression_super() { |
| 3733 BinaryExpression expression = ParserTestCase.parse5("parseRelationalExpressi
on", "super < y", []); | 2796 BinaryExpression expression = ParserTestCase.parse6("parseRelationalExpressi
on", "super < y", []); |
| 3734 JUnitTestCase.assertNotNull(expression.leftOperand); | 2797 JUnitTestCase.assertNotNull(expression.leftOperand); |
| 3735 JUnitTestCase.assertNotNull(expression.operator); | 2798 JUnitTestCase.assertNotNull(expression.operator); |
| 3736 JUnitTestCase.assertEquals(TokenType.LT, expression.operator.type); | 2799 JUnitTestCase.assertEquals(TokenType.LT, expression.operator.type); |
| 3737 JUnitTestCase.assertNotNull(expression.rightOperand); | 2800 JUnitTestCase.assertNotNull(expression.rightOperand); |
| 3738 } | 2801 } |
| 3739 void test_parseReturnStatement_noValue() { | 2802 void test_parseReturnStatement_noValue() { |
| 3740 ReturnStatement statement = ParserTestCase.parse5("parseReturnStatement", "r
eturn;", []); | 2803 ReturnStatement statement = ParserTestCase.parse6("parseReturnStatement", "r
eturn;", []); |
| 3741 JUnitTestCase.assertNotNull(statement.keyword); | 2804 JUnitTestCase.assertNotNull(statement.keyword); |
| 3742 JUnitTestCase.assertNull(statement.expression); | 2805 JUnitTestCase.assertNull(statement.expression); |
| 3743 JUnitTestCase.assertNotNull(statement.semicolon); | 2806 JUnitTestCase.assertNotNull(statement.semicolon); |
| 3744 } | 2807 } |
| 3745 void test_parseReturnStatement_value() { | 2808 void test_parseReturnStatement_value() { |
| 3746 ReturnStatement statement = ParserTestCase.parse5("parseReturnStatement", "r
eturn x;", []); | 2809 ReturnStatement statement = ParserTestCase.parse6("parseReturnStatement", "r
eturn x;", []); |
| 3747 JUnitTestCase.assertNotNull(statement.keyword); | 2810 JUnitTestCase.assertNotNull(statement.keyword); |
| 3748 JUnitTestCase.assertNotNull(statement.expression); | 2811 JUnitTestCase.assertNotNull(statement.expression); |
| 3749 JUnitTestCase.assertNotNull(statement.semicolon); | 2812 JUnitTestCase.assertNotNull(statement.semicolon); |
| 3750 } | 2813 } |
| 3751 void test_parseReturnType_nonVoid() { | 2814 void test_parseReturnType_nonVoid() { |
| 3752 TypeName typeName = ParserTestCase.parse5("parseReturnType", "A<B>", []); | 2815 TypeName typeName = ParserTestCase.parse6("parseReturnType", "A<B>", []); |
| 3753 JUnitTestCase.assertNotNull(typeName.name); | 2816 JUnitTestCase.assertNotNull(typeName.name); |
| 3754 JUnitTestCase.assertNotNull(typeName.typeArguments); | 2817 JUnitTestCase.assertNotNull(typeName.typeArguments); |
| 3755 } | 2818 } |
| 3756 void test_parseReturnType_void() { | 2819 void test_parseReturnType_void() { |
| 3757 TypeName typeName = ParserTestCase.parse5("parseReturnType", "void", []); | 2820 TypeName typeName = ParserTestCase.parse6("parseReturnType", "void", []); |
| 3758 JUnitTestCase.assertNotNull(typeName.name); | 2821 JUnitTestCase.assertNotNull(typeName.name); |
| 3759 JUnitTestCase.assertNull(typeName.typeArguments); | 2822 JUnitTestCase.assertNull(typeName.typeArguments); |
| 3760 } | 2823 } |
| 3761 void test_parseSetter_nonStatic() { | 2824 void test_parseSetter_nonStatic() { |
| 3762 Comment comment = Comment.createDocumentationComment(new List<Token>(0)); | 2825 Comment comment = Comment.createDocumentationComment(new List<Token>(0)); |
| 3763 TypeName returnType = new TypeName.full(new SimpleIdentifier.full(null), nul
l); | 2826 TypeName returnType = new TypeName.full(new SimpleIdentifier.full(null), nul
l); |
| 3764 MethodDeclaration method = ParserTestCase.parse("parseSetter", <Object> [com
mentAndMetadata(comment, []), null, null, returnType], "set a(var x);"); | 2827 MethodDeclaration method = ParserTestCase.parse("parseSetter", <Object> [com
mentAndMetadata(comment, []), null, null, returnType], "set a(var x);"); |
| 3765 JUnitTestCase.assertNotNull(method.body); | 2828 JUnitTestCase.assertNotNull(method.body); |
| 3766 JUnitTestCase.assertEquals(comment, method.documentationComment); | 2829 JUnitTestCase.assertEquals(comment, method.documentationComment); |
| 3767 JUnitTestCase.assertNull(method.externalKeyword); | 2830 JUnitTestCase.assertNull(method.externalKeyword); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 3781 JUnitTestCase.assertEquals(comment, method.documentationComment); | 2844 JUnitTestCase.assertEquals(comment, method.documentationComment); |
| 3782 JUnitTestCase.assertNull(method.externalKeyword); | 2845 JUnitTestCase.assertNull(method.externalKeyword); |
| 3783 JUnitTestCase.assertEquals(staticKeyword, method.modifierKeyword); | 2846 JUnitTestCase.assertEquals(staticKeyword, method.modifierKeyword); |
| 3784 JUnitTestCase.assertNotNull(method.name); | 2847 JUnitTestCase.assertNotNull(method.name); |
| 3785 JUnitTestCase.assertNull(method.operatorKeyword); | 2848 JUnitTestCase.assertNull(method.operatorKeyword); |
| 3786 JUnitTestCase.assertNotNull(method.parameters); | 2849 JUnitTestCase.assertNotNull(method.parameters); |
| 3787 JUnitTestCase.assertNotNull(method.propertyKeyword); | 2850 JUnitTestCase.assertNotNull(method.propertyKeyword); |
| 3788 JUnitTestCase.assertEquals(returnType, method.returnType); | 2851 JUnitTestCase.assertEquals(returnType, method.returnType); |
| 3789 } | 2852 } |
| 3790 void test_parseShiftExpression_normal() { | 2853 void test_parseShiftExpression_normal() { |
| 3791 BinaryExpression expression = ParserTestCase.parse5("parseShiftExpression",
"x << y", []); | 2854 BinaryExpression expression = ParserTestCase.parse6("parseShiftExpression",
"x << y", []); |
| 3792 JUnitTestCase.assertNotNull(expression.leftOperand); | 2855 JUnitTestCase.assertNotNull(expression.leftOperand); |
| 3793 JUnitTestCase.assertNotNull(expression.operator); | 2856 JUnitTestCase.assertNotNull(expression.operator); |
| 3794 JUnitTestCase.assertEquals(TokenType.LT_LT, expression.operator.type); | 2857 JUnitTestCase.assertEquals(TokenType.LT_LT, expression.operator.type); |
| 3795 JUnitTestCase.assertNotNull(expression.rightOperand); | 2858 JUnitTestCase.assertNotNull(expression.rightOperand); |
| 3796 } | 2859 } |
| 3797 void test_parseShiftExpression_super() { | 2860 void test_parseShiftExpression_super() { |
| 3798 BinaryExpression expression = ParserTestCase.parse5("parseShiftExpression",
"super << y", []); | 2861 BinaryExpression expression = ParserTestCase.parse6("parseShiftExpression",
"super << y", []); |
| 3799 JUnitTestCase.assertNotNull(expression.leftOperand); | 2862 JUnitTestCase.assertNotNull(expression.leftOperand); |
| 3800 JUnitTestCase.assertNotNull(expression.operator); | 2863 JUnitTestCase.assertNotNull(expression.operator); |
| 3801 JUnitTestCase.assertEquals(TokenType.LT_LT, expression.operator.type); | 2864 JUnitTestCase.assertEquals(TokenType.LT_LT, expression.operator.type); |
| 3802 JUnitTestCase.assertNotNull(expression.rightOperand); | 2865 JUnitTestCase.assertNotNull(expression.rightOperand); |
| 3803 } | 2866 } |
| 3804 void test_parseSimpleIdentifier_builtInIdentifier() { | 2867 void test_parseSimpleIdentifier_builtInIdentifier() { |
| 3805 String lexeme = "as"; | 2868 String lexeme = "as"; |
| 3806 SimpleIdentifier identifier = ParserTestCase.parse5("parseSimpleIdentifier",
lexeme, []); | 2869 SimpleIdentifier identifier = ParserTestCase.parse6("parseSimpleIdentifier",
lexeme, []); |
| 3807 JUnitTestCase.assertNotNull(identifier.token); | 2870 JUnitTestCase.assertNotNull(identifier.token); |
| 3808 JUnitTestCase.assertEquals(lexeme, identifier.name); | 2871 JUnitTestCase.assertEquals(lexeme, identifier.name); |
| 3809 } | 2872 } |
| 3810 void test_parseSimpleIdentifier_normalIdentifier() { | 2873 void test_parseSimpleIdentifier_normalIdentifier() { |
| 3811 String lexeme = "foo"; | 2874 String lexeme = "foo"; |
| 3812 SimpleIdentifier identifier = ParserTestCase.parse5("parseSimpleIdentifier",
lexeme, []); | 2875 SimpleIdentifier identifier = ParserTestCase.parse6("parseSimpleIdentifier",
lexeme, []); |
| 3813 JUnitTestCase.assertNotNull(identifier.token); | 2876 JUnitTestCase.assertNotNull(identifier.token); |
| 3814 JUnitTestCase.assertEquals(lexeme, identifier.name); | 2877 JUnitTestCase.assertEquals(lexeme, identifier.name); |
| 3815 } | 2878 } |
| 3816 void test_parseSimpleIdentifier1_normalIdentifier() { | 2879 void test_parseSimpleIdentifier1_normalIdentifier() { |
| 3817 } | 2880 } |
| 3818 void test_parseStatement_functionDeclaration() { | 2881 void test_parseStatement_functionDeclaration() { |
| 3819 FunctionDeclarationStatement statement = ParserTestCase.parse5("parseStateme
nt", "int f(a, b) {};", []); | 2882 FunctionDeclarationStatement statement = ParserTestCase.parse6("parseStateme
nt", "int f(a, b) {};", []); |
| 3820 JUnitTestCase.assertNotNull(statement.functionDeclaration); | 2883 JUnitTestCase.assertNotNull(statement.functionDeclaration); |
| 3821 } | 2884 } |
| 3822 void test_parseStatement_mulipleLabels() { | 2885 void test_parseStatement_mulipleLabels() { |
| 3823 LabeledStatement statement = ParserTestCase.parse5("parseStatement", "l: m:
return x;", []); | 2886 LabeledStatement statement = ParserTestCase.parse6("parseStatement", "l: m:
return x;", []); |
| 3824 EngineTestCase.assertSize(2, statement.labels); | 2887 EngineTestCase.assertSize(2, statement.labels); |
| 3825 JUnitTestCase.assertNotNull(statement.statement); | 2888 JUnitTestCase.assertNotNull(statement.statement); |
| 3826 } | 2889 } |
| 3827 void test_parseStatement_noLabels() { | 2890 void test_parseStatement_noLabels() { |
| 3828 ParserTestCase.parse5("parseStatement", "return x;", []); | 2891 ParserTestCase.parse6("parseStatement", "return x;", []); |
| 3829 } | 2892 } |
| 3830 void test_parseStatement_singleLabel() { | 2893 void test_parseStatement_singleLabel() { |
| 3831 LabeledStatement statement = ParserTestCase.parse5("parseStatement", "l: ret
urn x;", []); | 2894 LabeledStatement statement = ParserTestCase.parse6("parseStatement", "l: ret
urn x;", []); |
| 3832 EngineTestCase.assertSize(1, statement.labels); | 2895 EngineTestCase.assertSize(1, statement.labels); |
| 3833 JUnitTestCase.assertNotNull(statement.statement); | 2896 JUnitTestCase.assertNotNull(statement.statement); |
| 3834 } | 2897 } |
| 3835 void test_parseStatements_multiple() { | 2898 void test_parseStatements_multiple() { |
| 3836 List<Statement> statements = ParserTestCase.parseStatements("return; return;
", 2, []); | 2899 List<Statement> statements = ParserTestCase.parseStatements("return; return;
", 2, []); |
| 3837 EngineTestCase.assertSize(2, statements); | 2900 EngineTestCase.assertSize(2, statements); |
| 3838 } | 2901 } |
| 3839 void test_parseStatements_single() { | 2902 void test_parseStatements_single() { |
| 3840 List<Statement> statements = ParserTestCase.parseStatements("return;", 1, []
); | 2903 List<Statement> statements = ParserTestCase.parseStatements("return;", 1, []
); |
| 3841 EngineTestCase.assertSize(1, statements); | 2904 EngineTestCase.assertSize(1, statements); |
| 3842 } | 2905 } |
| 3843 void test_parseStringLiteral_adjacent() { | 2906 void test_parseStringLiteral_adjacent() { |
| 3844 AdjacentStrings literal = ParserTestCase.parse5("parseStringLiteral", "'a' '
b'", []); | 2907 AdjacentStrings literal = ParserTestCase.parse6("parseStringLiteral", "'a' '
b'", []); |
| 3845 NodeList<StringLiteral> strings2 = literal.strings; | 2908 NodeList<StringLiteral> strings2 = literal.strings; |
| 3846 EngineTestCase.assertSize(2, strings2); | 2909 EngineTestCase.assertSize(2, strings2); |
| 3847 StringLiteral firstString = strings2[0]; | 2910 StringLiteral firstString = strings2[0]; |
| 3848 StringLiteral secondString = strings2[1]; | 2911 StringLiteral secondString = strings2[1]; |
| 3849 JUnitTestCase.assertEquals("a", ((firstString as SimpleStringLiteral)).value
); | 2912 JUnitTestCase.assertEquals("a", ((firstString as SimpleStringLiteral)).value
); |
| 3850 JUnitTestCase.assertEquals("b", ((secondString as SimpleStringLiteral)).valu
e); | 2913 JUnitTestCase.assertEquals("b", ((secondString as SimpleStringLiteral)).valu
e); |
| 3851 } | 2914 } |
| 3852 void test_parseStringLiteral_interpolated() { | 2915 void test_parseStringLiteral_interpolated() { |
| 3853 StringInterpolation literal = ParserTestCase.parse5("parseStringLiteral", "'
a \${b} c \$this d'", []); | 2916 StringInterpolation literal = ParserTestCase.parse6("parseStringLiteral", "'
a \${b} c \$this d'", []); |
| 3854 NodeList<InterpolationElement> elements2 = literal.elements; | 2917 NodeList<InterpolationElement> elements2 = literal.elements; |
| 3855 EngineTestCase.assertSize(5, elements2); | 2918 EngineTestCase.assertSize(5, elements2); |
| 3856 JUnitTestCase.assertTrue(elements2[0] is InterpolationString); | 2919 JUnitTestCase.assertTrue(elements2[0] is InterpolationString); |
| 3857 JUnitTestCase.assertTrue(elements2[1] is InterpolationExpression); | 2920 JUnitTestCase.assertTrue(elements2[1] is InterpolationExpression); |
| 3858 JUnitTestCase.assertTrue(elements2[2] is InterpolationString); | 2921 JUnitTestCase.assertTrue(elements2[2] is InterpolationString); |
| 3859 JUnitTestCase.assertTrue(elements2[3] is InterpolationExpression); | 2922 JUnitTestCase.assertTrue(elements2[3] is InterpolationExpression); |
| 3860 JUnitTestCase.assertTrue(elements2[4] is InterpolationString); | 2923 JUnitTestCase.assertTrue(elements2[4] is InterpolationString); |
| 3861 } | 2924 } |
| 3862 void test_parseStringLiteral_single() { | 2925 void test_parseStringLiteral_single() { |
| 3863 SimpleStringLiteral literal = ParserTestCase.parse5("parseStringLiteral", "'
a'", []); | 2926 SimpleStringLiteral literal = ParserTestCase.parse6("parseStringLiteral", "'
a'", []); |
| 3864 JUnitTestCase.assertNotNull(literal.literal); | 2927 JUnitTestCase.assertNotNull(literal.literal); |
| 3865 JUnitTestCase.assertEquals("a", literal.value); | 2928 JUnitTestCase.assertEquals("a", literal.value); |
| 3866 } | 2929 } |
| 3867 void test_parseSuperConstructorInvocation_named() { | 2930 void test_parseSuperConstructorInvocation_named() { |
| 3868 SuperConstructorInvocation invocation = ParserTestCase.parse5("parseSuperCon
structorInvocation", "super.a()", []); | 2931 SuperConstructorInvocation invocation = ParserTestCase.parse6("parseSuperCon
structorInvocation", "super.a()", []); |
| 3869 JUnitTestCase.assertNotNull(invocation.argumentList); | 2932 JUnitTestCase.assertNotNull(invocation.argumentList); |
| 3870 JUnitTestCase.assertNotNull(invocation.constructorName); | 2933 JUnitTestCase.assertNotNull(invocation.constructorName); |
| 3871 JUnitTestCase.assertNotNull(invocation.keyword); | 2934 JUnitTestCase.assertNotNull(invocation.keyword); |
| 3872 JUnitTestCase.assertNotNull(invocation.period); | 2935 JUnitTestCase.assertNotNull(invocation.period); |
| 3873 } | 2936 } |
| 3874 void test_parseSuperConstructorInvocation_unnamed() { | 2937 void test_parseSuperConstructorInvocation_unnamed() { |
| 3875 SuperConstructorInvocation invocation = ParserTestCase.parse5("parseSuperCon
structorInvocation", "super()", []); | 2938 SuperConstructorInvocation invocation = ParserTestCase.parse6("parseSuperCon
structorInvocation", "super()", []); |
| 3876 JUnitTestCase.assertNotNull(invocation.argumentList); | 2939 JUnitTestCase.assertNotNull(invocation.argumentList); |
| 3877 JUnitTestCase.assertNull(invocation.constructorName); | 2940 JUnitTestCase.assertNull(invocation.constructorName); |
| 3878 JUnitTestCase.assertNotNull(invocation.keyword); | 2941 JUnitTestCase.assertNotNull(invocation.keyword); |
| 3879 JUnitTestCase.assertNull(invocation.period); | 2942 JUnitTestCase.assertNull(invocation.period); |
| 3880 } | 2943 } |
| 3881 void test_parseSwitchStatement_case() { | 2944 void test_parseSwitchStatement_case() { |
| 3882 SwitchStatement statement = ParserTestCase.parse5("parseSwitchStatement", "s
witch (a) {case 1: return 'I';}", []); | 2945 SwitchStatement statement = ParserTestCase.parse6("parseSwitchStatement", "s
witch (a) {case 1: return 'I';}", []); |
| 3883 JUnitTestCase.assertNotNull(statement.keyword); | 2946 JUnitTestCase.assertNotNull(statement.keyword); |
| 3884 JUnitTestCase.assertNotNull(statement.leftParenthesis); | 2947 JUnitTestCase.assertNotNull(statement.leftParenthesis); |
| 3885 JUnitTestCase.assertNotNull(statement.expression); | 2948 JUnitTestCase.assertNotNull(statement.expression); |
| 3886 JUnitTestCase.assertNotNull(statement.rightParenthesis); | 2949 JUnitTestCase.assertNotNull(statement.rightParenthesis); |
| 3887 JUnitTestCase.assertNotNull(statement.leftBracket); | 2950 JUnitTestCase.assertNotNull(statement.leftBracket); |
| 3888 EngineTestCase.assertSize(1, statement.members); | 2951 EngineTestCase.assertSize(1, statement.members); |
| 3889 JUnitTestCase.assertNotNull(statement.rightBracket); | 2952 JUnitTestCase.assertNotNull(statement.rightBracket); |
| 3890 } | 2953 } |
| 3891 void test_parseSwitchStatement_empty() { | 2954 void test_parseSwitchStatement_empty() { |
| 3892 SwitchStatement statement = ParserTestCase.parse5("parseSwitchStatement", "s
witch (a) {}", []); | 2955 SwitchStatement statement = ParserTestCase.parse6("parseSwitchStatement", "s
witch (a) {}", []); |
| 3893 JUnitTestCase.assertNotNull(statement.keyword); | 2956 JUnitTestCase.assertNotNull(statement.keyword); |
| 3894 JUnitTestCase.assertNotNull(statement.leftParenthesis); | 2957 JUnitTestCase.assertNotNull(statement.leftParenthesis); |
| 3895 JUnitTestCase.assertNotNull(statement.expression); | 2958 JUnitTestCase.assertNotNull(statement.expression); |
| 3896 JUnitTestCase.assertNotNull(statement.rightParenthesis); | 2959 JUnitTestCase.assertNotNull(statement.rightParenthesis); |
| 3897 JUnitTestCase.assertNotNull(statement.leftBracket); | 2960 JUnitTestCase.assertNotNull(statement.leftBracket); |
| 3898 EngineTestCase.assertSize(0, statement.members); | 2961 EngineTestCase.assertSize(0, statement.members); |
| 3899 JUnitTestCase.assertNotNull(statement.rightBracket); | 2962 JUnitTestCase.assertNotNull(statement.rightBracket); |
| 3900 } | 2963 } |
| 3901 void test_parseSwitchStatement_labeledCase() { | 2964 void test_parseSwitchStatement_labeledCase() { |
| 3902 SwitchStatement statement = ParserTestCase.parse5("parseSwitchStatement", "s
witch (a) {l1: l2: l3: case(1):}", []); | 2965 SwitchStatement statement = ParserTestCase.parse6("parseSwitchStatement", "s
witch (a) {l1: l2: l3: case(1):}", []); |
| 3903 JUnitTestCase.assertNotNull(statement.keyword); | 2966 JUnitTestCase.assertNotNull(statement.keyword); |
| 3904 JUnitTestCase.assertNotNull(statement.leftParenthesis); | 2967 JUnitTestCase.assertNotNull(statement.leftParenthesis); |
| 3905 JUnitTestCase.assertNotNull(statement.expression); | 2968 JUnitTestCase.assertNotNull(statement.expression); |
| 3906 JUnitTestCase.assertNotNull(statement.rightParenthesis); | 2969 JUnitTestCase.assertNotNull(statement.rightParenthesis); |
| 3907 JUnitTestCase.assertNotNull(statement.leftBracket); | 2970 JUnitTestCase.assertNotNull(statement.leftBracket); |
| 3908 EngineTestCase.assertSize(1, statement.members); | 2971 EngineTestCase.assertSize(1, statement.members); |
| 3909 EngineTestCase.assertSize(3, statement.members[0].labels); | 2972 EngineTestCase.assertSize(3, statement.members[0].labels); |
| 3910 JUnitTestCase.assertNotNull(statement.rightBracket); | 2973 JUnitTestCase.assertNotNull(statement.rightBracket); |
| 3911 } | 2974 } |
| 3912 void test_parseSwitchStatement_labeledStatementInCase() { | 2975 void test_parseSwitchStatement_labeledStatementInCase() { |
| 3913 SwitchStatement statement = ParserTestCase.parse5("parseSwitchStatement", "s
witch (a) {case 0: f(); l1: g(); break;}", []); | 2976 SwitchStatement statement = ParserTestCase.parse6("parseSwitchStatement", "s
witch (a) {case 0: f(); l1: g(); break;}", []); |
| 3914 JUnitTestCase.assertNotNull(statement.keyword); | 2977 JUnitTestCase.assertNotNull(statement.keyword); |
| 3915 JUnitTestCase.assertNotNull(statement.leftParenthesis); | 2978 JUnitTestCase.assertNotNull(statement.leftParenthesis); |
| 3916 JUnitTestCase.assertNotNull(statement.expression); | 2979 JUnitTestCase.assertNotNull(statement.expression); |
| 3917 JUnitTestCase.assertNotNull(statement.rightParenthesis); | 2980 JUnitTestCase.assertNotNull(statement.rightParenthesis); |
| 3918 JUnitTestCase.assertNotNull(statement.leftBracket); | 2981 JUnitTestCase.assertNotNull(statement.leftBracket); |
| 3919 EngineTestCase.assertSize(1, statement.members); | 2982 EngineTestCase.assertSize(1, statement.members); |
| 3920 EngineTestCase.assertSize(3, statement.members[0].statements); | 2983 EngineTestCase.assertSize(3, statement.members[0].statements); |
| 3921 JUnitTestCase.assertNotNull(statement.rightBracket); | 2984 JUnitTestCase.assertNotNull(statement.rightBracket); |
| 3922 } | 2985 } |
| 3923 void test_parseThrowExpression_expression() { | 2986 void test_parseThrowExpression_expression() { |
| 3924 ThrowExpression statement = ParserTestCase.parse5("parseThrowExpression", "t
hrow x;", []); | 2987 ThrowExpression statement = ParserTestCase.parse6("parseThrowExpression", "t
hrow x;", []); |
| 3925 JUnitTestCase.assertNotNull(statement.keyword); | 2988 JUnitTestCase.assertNotNull(statement.keyword); |
| 3926 JUnitTestCase.assertNotNull(statement.expression); | 2989 JUnitTestCase.assertNotNull(statement.expression); |
| 3927 } | 2990 } |
| 3928 void test_parseThrowExpression_noExpression() { | 2991 void test_parseThrowExpression_noExpression() { |
| 3929 ThrowExpression statement = ParserTestCase.parse5("parseThrowExpression", "t
hrow;", []); | 2992 ThrowExpression statement = ParserTestCase.parse6("parseThrowExpression", "t
hrow;", []); |
| 3930 JUnitTestCase.assertNotNull(statement.keyword); | 2993 JUnitTestCase.assertNotNull(statement.keyword); |
| 3931 JUnitTestCase.assertNull(statement.expression); | 2994 JUnitTestCase.assertNull(statement.expression); |
| 3932 } | 2995 } |
| 3933 void test_parseThrowExpressionWithoutCascade_expression() { | 2996 void test_parseThrowExpressionWithoutCascade_expression() { |
| 3934 ThrowExpression statement = ParserTestCase.parse5("parseThrowExpressionWitho
utCascade", "throw x;", []); | 2997 ThrowExpression statement = ParserTestCase.parse6("parseThrowExpressionWitho
utCascade", "throw x;", []); |
| 3935 JUnitTestCase.assertNotNull(statement.keyword); | 2998 JUnitTestCase.assertNotNull(statement.keyword); |
| 3936 JUnitTestCase.assertNotNull(statement.expression); | 2999 JUnitTestCase.assertNotNull(statement.expression); |
| 3937 } | 3000 } |
| 3938 void test_parseThrowExpressionWithoutCascade_noExpression() { | 3001 void test_parseThrowExpressionWithoutCascade_noExpression() { |
| 3939 ThrowExpression statement = ParserTestCase.parse5("parseThrowExpressionWitho
utCascade", "throw;", []); | 3002 ThrowExpression statement = ParserTestCase.parse6("parseThrowExpressionWitho
utCascade", "throw;", []); |
| 3940 JUnitTestCase.assertNotNull(statement.keyword); | 3003 JUnitTestCase.assertNotNull(statement.keyword); |
| 3941 JUnitTestCase.assertNull(statement.expression); | 3004 JUnitTestCase.assertNull(statement.expression); |
| 3942 } | 3005 } |
| 3943 void test_parseTryStatement_catch() { | 3006 void test_parseTryStatement_catch() { |
| 3944 TryStatement statement = ParserTestCase.parse5("parseTryStatement", "try {}
catch (e) {}", []); | 3007 TryStatement statement = ParserTestCase.parse6("parseTryStatement", "try {}
catch (e) {}", []); |
| 3945 JUnitTestCase.assertNotNull(statement.tryKeyword); | 3008 JUnitTestCase.assertNotNull(statement.tryKeyword); |
| 3946 JUnitTestCase.assertNotNull(statement.body); | 3009 JUnitTestCase.assertNotNull(statement.body); |
| 3947 NodeList<CatchClause> catchClauses2 = statement.catchClauses; | 3010 NodeList<CatchClause> catchClauses2 = statement.catchClauses; |
| 3948 EngineTestCase.assertSize(1, catchClauses2); | 3011 EngineTestCase.assertSize(1, catchClauses2); |
| 3949 CatchClause clause = catchClauses2[0]; | 3012 CatchClause clause = catchClauses2[0]; |
| 3950 JUnitTestCase.assertNull(clause.onKeyword); | 3013 JUnitTestCase.assertNull(clause.onKeyword); |
| 3951 JUnitTestCase.assertNull(clause.exceptionType); | 3014 JUnitTestCase.assertNull(clause.exceptionType); |
| 3952 JUnitTestCase.assertNotNull(clause.catchKeyword); | 3015 JUnitTestCase.assertNotNull(clause.catchKeyword); |
| 3953 JUnitTestCase.assertNotNull(clause.exceptionParameter); | 3016 JUnitTestCase.assertNotNull(clause.exceptionParameter); |
| 3954 JUnitTestCase.assertNull(clause.comma); | 3017 JUnitTestCase.assertNull(clause.comma); |
| 3955 JUnitTestCase.assertNull(clause.stackTraceParameter); | 3018 JUnitTestCase.assertNull(clause.stackTraceParameter); |
| 3956 JUnitTestCase.assertNotNull(clause.body); | 3019 JUnitTestCase.assertNotNull(clause.body); |
| 3957 JUnitTestCase.assertNull(statement.finallyKeyword); | 3020 JUnitTestCase.assertNull(statement.finallyKeyword); |
| 3958 JUnitTestCase.assertNull(statement.finallyClause); | 3021 JUnitTestCase.assertNull(statement.finallyClause); |
| 3959 } | 3022 } |
| 3960 void test_parseTryStatement_catch_finally() { | 3023 void test_parseTryStatement_catch_finally() { |
| 3961 TryStatement statement = ParserTestCase.parse5("parseTryStatement", "try {}
catch (e, s) {} finally {}", []); | 3024 TryStatement statement = ParserTestCase.parse6("parseTryStatement", "try {}
catch (e, s) {} finally {}", []); |
| 3962 JUnitTestCase.assertNotNull(statement.tryKeyword); | 3025 JUnitTestCase.assertNotNull(statement.tryKeyword); |
| 3963 JUnitTestCase.assertNotNull(statement.body); | 3026 JUnitTestCase.assertNotNull(statement.body); |
| 3964 NodeList<CatchClause> catchClauses3 = statement.catchClauses; | 3027 NodeList<CatchClause> catchClauses3 = statement.catchClauses; |
| 3965 EngineTestCase.assertSize(1, catchClauses3); | 3028 EngineTestCase.assertSize(1, catchClauses3); |
| 3966 CatchClause clause = catchClauses3[0]; | 3029 CatchClause clause = catchClauses3[0]; |
| 3967 JUnitTestCase.assertNull(clause.onKeyword); | 3030 JUnitTestCase.assertNull(clause.onKeyword); |
| 3968 JUnitTestCase.assertNull(clause.exceptionType); | 3031 JUnitTestCase.assertNull(clause.exceptionType); |
| 3969 JUnitTestCase.assertNotNull(clause.catchKeyword); | 3032 JUnitTestCase.assertNotNull(clause.catchKeyword); |
| 3970 JUnitTestCase.assertNotNull(clause.exceptionParameter); | 3033 JUnitTestCase.assertNotNull(clause.exceptionParameter); |
| 3971 JUnitTestCase.assertNotNull(clause.comma); | 3034 JUnitTestCase.assertNotNull(clause.comma); |
| 3972 JUnitTestCase.assertNotNull(clause.stackTraceParameter); | 3035 JUnitTestCase.assertNotNull(clause.stackTraceParameter); |
| 3973 JUnitTestCase.assertNotNull(clause.body); | 3036 JUnitTestCase.assertNotNull(clause.body); |
| 3974 JUnitTestCase.assertNotNull(statement.finallyKeyword); | 3037 JUnitTestCase.assertNotNull(statement.finallyKeyword); |
| 3975 JUnitTestCase.assertNotNull(statement.finallyClause); | 3038 JUnitTestCase.assertNotNull(statement.finallyClause); |
| 3976 } | 3039 } |
| 3977 void test_parseTryStatement_finally() { | 3040 void test_parseTryStatement_finally() { |
| 3978 TryStatement statement = ParserTestCase.parse5("parseTryStatement", "try {}
finally {}", []); | 3041 TryStatement statement = ParserTestCase.parse6("parseTryStatement", "try {}
finally {}", []); |
| 3979 JUnitTestCase.assertNotNull(statement.tryKeyword); | 3042 JUnitTestCase.assertNotNull(statement.tryKeyword); |
| 3980 JUnitTestCase.assertNotNull(statement.body); | 3043 JUnitTestCase.assertNotNull(statement.body); |
| 3981 EngineTestCase.assertSize(0, statement.catchClauses); | 3044 EngineTestCase.assertSize(0, statement.catchClauses); |
| 3982 JUnitTestCase.assertNotNull(statement.finallyKeyword); | 3045 JUnitTestCase.assertNotNull(statement.finallyKeyword); |
| 3983 JUnitTestCase.assertNotNull(statement.finallyClause); | 3046 JUnitTestCase.assertNotNull(statement.finallyClause); |
| 3984 } | 3047 } |
| 3985 void test_parseTryStatement_multiple() { | 3048 void test_parseTryStatement_multiple() { |
| 3986 TryStatement statement = ParserTestCase.parse5("parseTryStatement", "try {}
on NPE catch (e) {} on Error {} catch (e) {}", []); | 3049 TryStatement statement = ParserTestCase.parse6("parseTryStatement", "try {}
on NPE catch (e) {} on Error {} catch (e) {}", []); |
| 3987 JUnitTestCase.assertNotNull(statement.tryKeyword); | 3050 JUnitTestCase.assertNotNull(statement.tryKeyword); |
| 3988 JUnitTestCase.assertNotNull(statement.body); | 3051 JUnitTestCase.assertNotNull(statement.body); |
| 3989 EngineTestCase.assertSize(3, statement.catchClauses); | 3052 EngineTestCase.assertSize(3, statement.catchClauses); |
| 3990 JUnitTestCase.assertNull(statement.finallyKeyword); | 3053 JUnitTestCase.assertNull(statement.finallyKeyword); |
| 3991 JUnitTestCase.assertNull(statement.finallyClause); | 3054 JUnitTestCase.assertNull(statement.finallyClause); |
| 3992 } | 3055 } |
| 3993 void test_parseTryStatement_on() { | 3056 void test_parseTryStatement_on() { |
| 3994 TryStatement statement = ParserTestCase.parse5("parseTryStatement", "try {}
on Error {}", []); | 3057 TryStatement statement = ParserTestCase.parse6("parseTryStatement", "try {}
on Error {}", []); |
| 3995 JUnitTestCase.assertNotNull(statement.tryKeyword); | 3058 JUnitTestCase.assertNotNull(statement.tryKeyword); |
| 3996 JUnitTestCase.assertNotNull(statement.body); | 3059 JUnitTestCase.assertNotNull(statement.body); |
| 3997 NodeList<CatchClause> catchClauses4 = statement.catchClauses; | 3060 NodeList<CatchClause> catchClauses4 = statement.catchClauses; |
| 3998 EngineTestCase.assertSize(1, catchClauses4); | 3061 EngineTestCase.assertSize(1, catchClauses4); |
| 3999 CatchClause clause = catchClauses4[0]; | 3062 CatchClause clause = catchClauses4[0]; |
| 4000 JUnitTestCase.assertNotNull(clause.onKeyword); | 3063 JUnitTestCase.assertNotNull(clause.onKeyword); |
| 4001 JUnitTestCase.assertNotNull(clause.exceptionType); | 3064 JUnitTestCase.assertNotNull(clause.exceptionType); |
| 4002 JUnitTestCase.assertNull(clause.catchKeyword); | 3065 JUnitTestCase.assertNull(clause.catchKeyword); |
| 4003 JUnitTestCase.assertNull(clause.exceptionParameter); | 3066 JUnitTestCase.assertNull(clause.exceptionParameter); |
| 4004 JUnitTestCase.assertNull(clause.comma); | 3067 JUnitTestCase.assertNull(clause.comma); |
| 4005 JUnitTestCase.assertNull(clause.stackTraceParameter); | 3068 JUnitTestCase.assertNull(clause.stackTraceParameter); |
| 4006 JUnitTestCase.assertNotNull(clause.body); | 3069 JUnitTestCase.assertNotNull(clause.body); |
| 4007 JUnitTestCase.assertNull(statement.finallyKeyword); | 3070 JUnitTestCase.assertNull(statement.finallyKeyword); |
| 4008 JUnitTestCase.assertNull(statement.finallyClause); | 3071 JUnitTestCase.assertNull(statement.finallyClause); |
| 4009 } | 3072 } |
| 4010 void test_parseTryStatement_on_catch() { | 3073 void test_parseTryStatement_on_catch() { |
| 4011 TryStatement statement = ParserTestCase.parse5("parseTryStatement", "try {}
on Error catch (e, s) {}", []); | 3074 TryStatement statement = ParserTestCase.parse6("parseTryStatement", "try {}
on Error catch (e, s) {}", []); |
| 4012 JUnitTestCase.assertNotNull(statement.tryKeyword); | 3075 JUnitTestCase.assertNotNull(statement.tryKeyword); |
| 4013 JUnitTestCase.assertNotNull(statement.body); | 3076 JUnitTestCase.assertNotNull(statement.body); |
| 4014 NodeList<CatchClause> catchClauses5 = statement.catchClauses; | 3077 NodeList<CatchClause> catchClauses5 = statement.catchClauses; |
| 4015 EngineTestCase.assertSize(1, catchClauses5); | 3078 EngineTestCase.assertSize(1, catchClauses5); |
| 4016 CatchClause clause = catchClauses5[0]; | 3079 CatchClause clause = catchClauses5[0]; |
| 4017 JUnitTestCase.assertNotNull(clause.onKeyword); | 3080 JUnitTestCase.assertNotNull(clause.onKeyword); |
| 4018 JUnitTestCase.assertNotNull(clause.exceptionType); | 3081 JUnitTestCase.assertNotNull(clause.exceptionType); |
| 4019 JUnitTestCase.assertNotNull(clause.catchKeyword); | 3082 JUnitTestCase.assertNotNull(clause.catchKeyword); |
| 4020 JUnitTestCase.assertNotNull(clause.exceptionParameter); | 3083 JUnitTestCase.assertNotNull(clause.exceptionParameter); |
| 4021 JUnitTestCase.assertNotNull(clause.comma); | 3084 JUnitTestCase.assertNotNull(clause.comma); |
| 4022 JUnitTestCase.assertNotNull(clause.stackTraceParameter); | 3085 JUnitTestCase.assertNotNull(clause.stackTraceParameter); |
| 4023 JUnitTestCase.assertNotNull(clause.body); | 3086 JUnitTestCase.assertNotNull(clause.body); |
| 4024 JUnitTestCase.assertNull(statement.finallyKeyword); | 3087 JUnitTestCase.assertNull(statement.finallyKeyword); |
| 4025 JUnitTestCase.assertNull(statement.finallyClause); | 3088 JUnitTestCase.assertNull(statement.finallyClause); |
| 4026 } | 3089 } |
| 4027 void test_parseTryStatement_on_catch_finally() { | 3090 void test_parseTryStatement_on_catch_finally() { |
| 4028 TryStatement statement = ParserTestCase.parse5("parseTryStatement", "try {}
on Error catch (e, s) {} finally {}", []); | 3091 TryStatement statement = ParserTestCase.parse6("parseTryStatement", "try {}
on Error catch (e, s) {} finally {}", []); |
| 4029 JUnitTestCase.assertNotNull(statement.tryKeyword); | 3092 JUnitTestCase.assertNotNull(statement.tryKeyword); |
| 4030 JUnitTestCase.assertNotNull(statement.body); | 3093 JUnitTestCase.assertNotNull(statement.body); |
| 4031 NodeList<CatchClause> catchClauses6 = statement.catchClauses; | 3094 NodeList<CatchClause> catchClauses6 = statement.catchClauses; |
| 4032 EngineTestCase.assertSize(1, catchClauses6); | 3095 EngineTestCase.assertSize(1, catchClauses6); |
| 4033 CatchClause clause = catchClauses6[0]; | 3096 CatchClause clause = catchClauses6[0]; |
| 4034 JUnitTestCase.assertNotNull(clause.onKeyword); | 3097 JUnitTestCase.assertNotNull(clause.onKeyword); |
| 4035 JUnitTestCase.assertNotNull(clause.exceptionType); | 3098 JUnitTestCase.assertNotNull(clause.exceptionType); |
| 4036 JUnitTestCase.assertNotNull(clause.catchKeyword); | 3099 JUnitTestCase.assertNotNull(clause.catchKeyword); |
| 4037 JUnitTestCase.assertNotNull(clause.exceptionParameter); | 3100 JUnitTestCase.assertNotNull(clause.exceptionParameter); |
| 4038 JUnitTestCase.assertNotNull(clause.comma); | 3101 JUnitTestCase.assertNotNull(clause.comma); |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4089 void test_parseTypeAlias_voidReturnType() { | 3152 void test_parseTypeAlias_voidReturnType() { |
| 4090 FunctionTypeAlias typeAlias = ParserTestCase.parse("parseTypeAlias", <Object
> [emptyCommentAndMetadata()], "typedef void F();"); | 3153 FunctionTypeAlias typeAlias = ParserTestCase.parse("parseTypeAlias", <Object
> [emptyCommentAndMetadata()], "typedef void F();"); |
| 4091 JUnitTestCase.assertNotNull(typeAlias.keyword); | 3154 JUnitTestCase.assertNotNull(typeAlias.keyword); |
| 4092 JUnitTestCase.assertNotNull(typeAlias.name); | 3155 JUnitTestCase.assertNotNull(typeAlias.name); |
| 4093 JUnitTestCase.assertNotNull(typeAlias.parameters); | 3156 JUnitTestCase.assertNotNull(typeAlias.parameters); |
| 4094 JUnitTestCase.assertNotNull(typeAlias.returnType); | 3157 JUnitTestCase.assertNotNull(typeAlias.returnType); |
| 4095 JUnitTestCase.assertNotNull(typeAlias.semicolon); | 3158 JUnitTestCase.assertNotNull(typeAlias.semicolon); |
| 4096 JUnitTestCase.assertNull(typeAlias.typeParameters); | 3159 JUnitTestCase.assertNull(typeAlias.typeParameters); |
| 4097 } | 3160 } |
| 4098 void test_parseTypeArgumentList_multiple() { | 3161 void test_parseTypeArgumentList_multiple() { |
| 4099 TypeArgumentList argumentList = ParserTestCase.parse5("parseTypeArgumentList
", "<int, int, int>", []); | 3162 TypeArgumentList argumentList = ParserTestCase.parse6("parseTypeArgumentList
", "<int, int, int>", []); |
| 4100 JUnitTestCase.assertNotNull(argumentList.leftBracket); | 3163 JUnitTestCase.assertNotNull(argumentList.leftBracket); |
| 4101 EngineTestCase.assertSize(3, argumentList.arguments); | 3164 EngineTestCase.assertSize(3, argumentList.arguments); |
| 4102 JUnitTestCase.assertNotNull(argumentList.rightBracket); | 3165 JUnitTestCase.assertNotNull(argumentList.rightBracket); |
| 4103 } | 3166 } |
| 4104 void test_parseTypeArgumentList_nested() { | 3167 void test_parseTypeArgumentList_nested() { |
| 4105 TypeArgumentList argumentList = ParserTestCase.parse5("parseTypeArgumentList
", "<A<B>>", []); | 3168 TypeArgumentList argumentList = ParserTestCase.parse6("parseTypeArgumentList
", "<A<B>>", []); |
| 4106 JUnitTestCase.assertNotNull(argumentList.leftBracket); | 3169 JUnitTestCase.assertNotNull(argumentList.leftBracket); |
| 4107 EngineTestCase.assertSize(1, argumentList.arguments); | 3170 EngineTestCase.assertSize(1, argumentList.arguments); |
| 4108 TypeName argument = argumentList.arguments[0]; | 3171 TypeName argument = argumentList.arguments[0]; |
| 4109 JUnitTestCase.assertNotNull(argument); | 3172 JUnitTestCase.assertNotNull(argument); |
| 4110 TypeArgumentList innerList = argument.typeArguments; | 3173 TypeArgumentList innerList = argument.typeArguments; |
| 4111 JUnitTestCase.assertNotNull(innerList); | 3174 JUnitTestCase.assertNotNull(innerList); |
| 4112 EngineTestCase.assertSize(1, innerList.arguments); | 3175 EngineTestCase.assertSize(1, innerList.arguments); |
| 4113 JUnitTestCase.assertNotNull(argumentList.rightBracket); | 3176 JUnitTestCase.assertNotNull(argumentList.rightBracket); |
| 4114 } | 3177 } |
| 4115 void test_parseTypeArgumentList_single() { | 3178 void test_parseTypeArgumentList_single() { |
| 4116 TypeArgumentList argumentList = ParserTestCase.parse5("parseTypeArgumentList
", "<int>", []); | 3179 TypeArgumentList argumentList = ParserTestCase.parse6("parseTypeArgumentList
", "<int>", []); |
| 4117 JUnitTestCase.assertNotNull(argumentList.leftBracket); | 3180 JUnitTestCase.assertNotNull(argumentList.leftBracket); |
| 4118 EngineTestCase.assertSize(1, argumentList.arguments); | 3181 EngineTestCase.assertSize(1, argumentList.arguments); |
| 4119 JUnitTestCase.assertNotNull(argumentList.rightBracket); | 3182 JUnitTestCase.assertNotNull(argumentList.rightBracket); |
| 4120 } | 3183 } |
| 4121 void test_parseTypeName_parameterized() { | 3184 void test_parseTypeName_parameterized() { |
| 4122 TypeName typeName = ParserTestCase.parse5("parseTypeName", "List<int>", []); | 3185 TypeName typeName = ParserTestCase.parse6("parseTypeName", "List<int>", []); |
| 4123 JUnitTestCase.assertNotNull(typeName.name); | 3186 JUnitTestCase.assertNotNull(typeName.name); |
| 4124 JUnitTestCase.assertNotNull(typeName.typeArguments); | 3187 JUnitTestCase.assertNotNull(typeName.typeArguments); |
| 4125 } | 3188 } |
| 4126 void test_parseTypeName_simple() { | 3189 void test_parseTypeName_simple() { |
| 4127 TypeName typeName = ParserTestCase.parse5("parseTypeName", "int", []); | 3190 TypeName typeName = ParserTestCase.parse6("parseTypeName", "int", []); |
| 4128 JUnitTestCase.assertNotNull(typeName.name); | 3191 JUnitTestCase.assertNotNull(typeName.name); |
| 4129 JUnitTestCase.assertNull(typeName.typeArguments); | 3192 JUnitTestCase.assertNull(typeName.typeArguments); |
| 4130 } | 3193 } |
| 4131 void test_parseTypeParameter_bounded() { | 3194 void test_parseTypeParameter_bounded() { |
| 4132 TypeParameter parameter = ParserTestCase.parse5("parseTypeParameter", "A ext
ends B", []); | 3195 TypeParameter parameter = ParserTestCase.parse6("parseTypeParameter", "A ext
ends B", []); |
| 4133 JUnitTestCase.assertNotNull(parameter.bound); | 3196 JUnitTestCase.assertNotNull(parameter.bound); |
| 4134 JUnitTestCase.assertNotNull(parameter.keyword); | 3197 JUnitTestCase.assertNotNull(parameter.keyword); |
| 4135 JUnitTestCase.assertNotNull(parameter.name); | 3198 JUnitTestCase.assertNotNull(parameter.name); |
| 4136 } | 3199 } |
| 4137 void test_parseTypeParameter_simple() { | 3200 void test_parseTypeParameter_simple() { |
| 4138 TypeParameter parameter = ParserTestCase.parse5("parseTypeParameter", "A", [
]); | 3201 TypeParameter parameter = ParserTestCase.parse6("parseTypeParameter", "A", [
]); |
| 4139 JUnitTestCase.assertNull(parameter.bound); | 3202 JUnitTestCase.assertNull(parameter.bound); |
| 4140 JUnitTestCase.assertNull(parameter.keyword); | 3203 JUnitTestCase.assertNull(parameter.keyword); |
| 4141 JUnitTestCase.assertNotNull(parameter.name); | 3204 JUnitTestCase.assertNotNull(parameter.name); |
| 4142 } | 3205 } |
| 4143 void test_parseTypeParameterList_multiple() { | 3206 void test_parseTypeParameterList_multiple() { |
| 4144 TypeParameterList parameterList = ParserTestCase.parse5("parseTypeParameterL
ist", "<A, B extends C, D>", []); | 3207 TypeParameterList parameterList = ParserTestCase.parse6("parseTypeParameterL
ist", "<A, B extends C, D>", []); |
| 4145 JUnitTestCase.assertNotNull(parameterList.leftBracket); | 3208 JUnitTestCase.assertNotNull(parameterList.leftBracket); |
| 4146 JUnitTestCase.assertNotNull(parameterList.rightBracket); | 3209 JUnitTestCase.assertNotNull(parameterList.rightBracket); |
| 4147 EngineTestCase.assertSize(3, parameterList.typeParameters); | 3210 EngineTestCase.assertSize(3, parameterList.typeParameters); |
| 4148 } | 3211 } |
| 4149 void test_parseTypeParameterList_parameterizedWithTrailingEquals() { | 3212 void test_parseTypeParameterList_parameterizedWithTrailingEquals() { |
| 4150 TypeParameterList parameterList = ParserTestCase.parse5("parseTypeParameterL
ist", "<A extends B<E>>=", []); | 3213 TypeParameterList parameterList = ParserTestCase.parse6("parseTypeParameterL
ist", "<A extends B<E>>=", []); |
| 4151 JUnitTestCase.assertNotNull(parameterList.leftBracket); | 3214 JUnitTestCase.assertNotNull(parameterList.leftBracket); |
| 4152 JUnitTestCase.assertNotNull(parameterList.rightBracket); | 3215 JUnitTestCase.assertNotNull(parameterList.rightBracket); |
| 4153 EngineTestCase.assertSize(1, parameterList.typeParameters); | 3216 EngineTestCase.assertSize(1, parameterList.typeParameters); |
| 4154 } | 3217 } |
| 4155 void test_parseTypeParameterList_single() { | 3218 void test_parseTypeParameterList_single() { |
| 4156 TypeParameterList parameterList = ParserTestCase.parse5("parseTypeParameterL
ist", "<A>", []); | 3219 TypeParameterList parameterList = ParserTestCase.parse6("parseTypeParameterL
ist", "<A>", []); |
| 4157 JUnitTestCase.assertNotNull(parameterList.leftBracket); | 3220 JUnitTestCase.assertNotNull(parameterList.leftBracket); |
| 4158 JUnitTestCase.assertNotNull(parameterList.rightBracket); | 3221 JUnitTestCase.assertNotNull(parameterList.rightBracket); |
| 4159 EngineTestCase.assertSize(1, parameterList.typeParameters); | 3222 EngineTestCase.assertSize(1, parameterList.typeParameters); |
| 4160 } | 3223 } |
| 4161 void test_parseTypeParameterList_withTrailingEquals() { | 3224 void test_parseTypeParameterList_withTrailingEquals() { |
| 4162 TypeParameterList parameterList = ParserTestCase.parse5("parseTypeParameterL
ist", "<A>=", []); | 3225 TypeParameterList parameterList = ParserTestCase.parse6("parseTypeParameterL
ist", "<A>=", []); |
| 4163 JUnitTestCase.assertNotNull(parameterList.leftBracket); | 3226 JUnitTestCase.assertNotNull(parameterList.leftBracket); |
| 4164 JUnitTestCase.assertNotNull(parameterList.rightBracket); | 3227 JUnitTestCase.assertNotNull(parameterList.rightBracket); |
| 4165 EngineTestCase.assertSize(1, parameterList.typeParameters); | 3228 EngineTestCase.assertSize(1, parameterList.typeParameters); |
| 4166 } | 3229 } |
| 4167 void test_parseUnaryExpression_decrement_normal() { | 3230 void test_parseUnaryExpression_decrement_normal() { |
| 4168 PrefixExpression expression = ParserTestCase.parse5("parseUnaryExpression",
"--x", []); | 3231 PrefixExpression expression = ParserTestCase.parse6("parseUnaryExpression",
"--x", []); |
| 4169 JUnitTestCase.assertNotNull(expression.operator); | 3232 JUnitTestCase.assertNotNull(expression.operator); |
| 4170 JUnitTestCase.assertEquals(TokenType.MINUS_MINUS, expression.operator.type); | 3233 JUnitTestCase.assertEquals(TokenType.MINUS_MINUS, expression.operator.type); |
| 4171 JUnitTestCase.assertNotNull(expression.operand); | 3234 JUnitTestCase.assertNotNull(expression.operand); |
| 4172 } | 3235 } |
| 4173 void test_parseUnaryExpression_decrement_super() { | 3236 void test_parseUnaryExpression_decrement_super() { |
| 4174 PrefixExpression expression = ParserTestCase.parse5("parseUnaryExpression",
"--super", []); | 3237 PrefixExpression expression = ParserTestCase.parse6("parseUnaryExpression",
"--super", []); |
| 4175 JUnitTestCase.assertNotNull(expression.operator); | 3238 JUnitTestCase.assertNotNull(expression.operator); |
| 4176 JUnitTestCase.assertEquals(TokenType.MINUS, expression.operator.type); | 3239 JUnitTestCase.assertEquals(TokenType.MINUS, expression.operator.type); |
| 4177 Expression innerExpression = expression.operand; | 3240 Expression innerExpression = expression.operand; |
| 4178 JUnitTestCase.assertNotNull(innerExpression); | 3241 JUnitTestCase.assertNotNull(innerExpression); |
| 4179 JUnitTestCase.assertTrue(innerExpression is PrefixExpression); | 3242 JUnitTestCase.assertTrue(innerExpression is PrefixExpression); |
| 4180 PrefixExpression operand = (innerExpression as PrefixExpression); | 3243 PrefixExpression operand = innerExpression as PrefixExpression; |
| 4181 JUnitTestCase.assertNotNull(operand.operator); | 3244 JUnitTestCase.assertNotNull(operand.operator); |
| 4182 JUnitTestCase.assertEquals(TokenType.MINUS, operand.operator.type); | 3245 JUnitTestCase.assertEquals(TokenType.MINUS, operand.operator.type); |
| 4183 JUnitTestCase.assertNotNull(operand.operand); | 3246 JUnitTestCase.assertNotNull(operand.operand); |
| 4184 } | 3247 } |
| 4185 void test_parseUnaryExpression_increment_normal() { | 3248 void test_parseUnaryExpression_increment_normal() { |
| 4186 PrefixExpression expression = ParserTestCase.parse5("parseUnaryExpression",
"++x", []); | 3249 PrefixExpression expression = ParserTestCase.parse6("parseUnaryExpression",
"++x", []); |
| 4187 JUnitTestCase.assertNotNull(expression.operator); | 3250 JUnitTestCase.assertNotNull(expression.operator); |
| 4188 JUnitTestCase.assertEquals(TokenType.PLUS_PLUS, expression.operator.type); | 3251 JUnitTestCase.assertEquals(TokenType.PLUS_PLUS, expression.operator.type); |
| 4189 JUnitTestCase.assertNotNull(expression.operand); | 3252 JUnitTestCase.assertNotNull(expression.operand); |
| 4190 } | 3253 } |
| 4191 void test_parseUnaryExpression_minus_normal() { | 3254 void test_parseUnaryExpression_minus_normal() { |
| 4192 PrefixExpression expression = ParserTestCase.parse5("parseUnaryExpression",
"-x", []); | 3255 PrefixExpression expression = ParserTestCase.parse6("parseUnaryExpression",
"-x", []); |
| 4193 JUnitTestCase.assertNotNull(expression.operator); | 3256 JUnitTestCase.assertNotNull(expression.operator); |
| 4194 JUnitTestCase.assertEquals(TokenType.MINUS, expression.operator.type); | 3257 JUnitTestCase.assertEquals(TokenType.MINUS, expression.operator.type); |
| 4195 JUnitTestCase.assertNotNull(expression.operand); | 3258 JUnitTestCase.assertNotNull(expression.operand); |
| 4196 } | 3259 } |
| 4197 void test_parseUnaryExpression_minus_super() { | 3260 void test_parseUnaryExpression_minus_super() { |
| 4198 PrefixExpression expression = ParserTestCase.parse5("parseUnaryExpression",
"-super", []); | 3261 PrefixExpression expression = ParserTestCase.parse6("parseUnaryExpression",
"-super", []); |
| 4199 JUnitTestCase.assertNotNull(expression.operator); | 3262 JUnitTestCase.assertNotNull(expression.operator); |
| 4200 JUnitTestCase.assertEquals(TokenType.MINUS, expression.operator.type); | 3263 JUnitTestCase.assertEquals(TokenType.MINUS, expression.operator.type); |
| 4201 JUnitTestCase.assertNotNull(expression.operand); | 3264 JUnitTestCase.assertNotNull(expression.operand); |
| 4202 } | 3265 } |
| 4203 void test_parseUnaryExpression_not_normal() { | 3266 void test_parseUnaryExpression_not_normal() { |
| 4204 PrefixExpression expression = ParserTestCase.parse5("parseUnaryExpression",
"!x", []); | 3267 PrefixExpression expression = ParserTestCase.parse6("parseUnaryExpression",
"!x", []); |
| 4205 JUnitTestCase.assertNotNull(expression.operator); | 3268 JUnitTestCase.assertNotNull(expression.operator); |
| 4206 JUnitTestCase.assertEquals(TokenType.BANG, expression.operator.type); | 3269 JUnitTestCase.assertEquals(TokenType.BANG, expression.operator.type); |
| 4207 JUnitTestCase.assertNotNull(expression.operand); | 3270 JUnitTestCase.assertNotNull(expression.operand); |
| 4208 } | 3271 } |
| 4209 void test_parseUnaryExpression_not_super() { | 3272 void test_parseUnaryExpression_not_super() { |
| 4210 PrefixExpression expression = ParserTestCase.parse5("parseUnaryExpression",
"!super", []); | 3273 PrefixExpression expression = ParserTestCase.parse6("parseUnaryExpression",
"!super", []); |
| 4211 JUnitTestCase.assertNotNull(expression.operator); | 3274 JUnitTestCase.assertNotNull(expression.operator); |
| 4212 JUnitTestCase.assertEquals(TokenType.BANG, expression.operator.type); | 3275 JUnitTestCase.assertEquals(TokenType.BANG, expression.operator.type); |
| 4213 JUnitTestCase.assertNotNull(expression.operand); | 3276 JUnitTestCase.assertNotNull(expression.operand); |
| 4214 } | 3277 } |
| 4215 void test_parseUnaryExpression_tilda_normal() { | 3278 void test_parseUnaryExpression_tilda_normal() { |
| 4216 PrefixExpression expression = ParserTestCase.parse5("parseUnaryExpression",
"~x", []); | 3279 PrefixExpression expression = ParserTestCase.parse6("parseUnaryExpression",
"~x", []); |
| 4217 JUnitTestCase.assertNotNull(expression.operator); | 3280 JUnitTestCase.assertNotNull(expression.operator); |
| 4218 JUnitTestCase.assertEquals(TokenType.TILDE, expression.operator.type); | 3281 JUnitTestCase.assertEquals(TokenType.TILDE, expression.operator.type); |
| 4219 JUnitTestCase.assertNotNull(expression.operand); | 3282 JUnitTestCase.assertNotNull(expression.operand); |
| 4220 } | 3283 } |
| 4221 void test_parseUnaryExpression_tilda_super() { | 3284 void test_parseUnaryExpression_tilda_super() { |
| 4222 PrefixExpression expression = ParserTestCase.parse5("parseUnaryExpression",
"~super", []); | 3285 PrefixExpression expression = ParserTestCase.parse6("parseUnaryExpression",
"~super", []); |
| 4223 JUnitTestCase.assertNotNull(expression.operator); | 3286 JUnitTestCase.assertNotNull(expression.operator); |
| 4224 JUnitTestCase.assertEquals(TokenType.TILDE, expression.operator.type); | 3287 JUnitTestCase.assertEquals(TokenType.TILDE, expression.operator.type); |
| 4225 JUnitTestCase.assertNotNull(expression.operand); | 3288 JUnitTestCase.assertNotNull(expression.operand); |
| 4226 } | 3289 } |
| 4227 void test_parseVariableDeclaration_equals() { | 3290 void test_parseVariableDeclaration_equals() { |
| 4228 VariableDeclaration declaration = ParserTestCase.parse5("parseVariableDeclar
ation", "a = b", []); | 3291 VariableDeclaration declaration = ParserTestCase.parse6("parseVariableDeclar
ation", "a = b", []); |
| 4229 JUnitTestCase.assertNotNull(declaration.name); | 3292 JUnitTestCase.assertNotNull(declaration.name); |
| 4230 JUnitTestCase.assertNotNull(declaration.equals); | 3293 JUnitTestCase.assertNotNull(declaration.equals); |
| 4231 JUnitTestCase.assertNotNull(declaration.initializer); | 3294 JUnitTestCase.assertNotNull(declaration.initializer); |
| 4232 } | 3295 } |
| 4233 void test_parseVariableDeclaration_noEquals() { | 3296 void test_parseVariableDeclaration_noEquals() { |
| 4234 VariableDeclaration declaration = ParserTestCase.parse5("parseVariableDeclar
ation", "a", []); | 3297 VariableDeclaration declaration = ParserTestCase.parse6("parseVariableDeclar
ation", "a", []); |
| 4235 JUnitTestCase.assertNotNull(declaration.name); | 3298 JUnitTestCase.assertNotNull(declaration.name); |
| 4236 JUnitTestCase.assertNull(declaration.equals); | 3299 JUnitTestCase.assertNull(declaration.equals); |
| 4237 JUnitTestCase.assertNull(declaration.initializer); | 3300 JUnitTestCase.assertNull(declaration.initializer); |
| 4238 } | 3301 } |
| 4239 void test_parseVariableDeclarationList_const_noType() { | 3302 void test_parseVariableDeclarationList_const_noType() { |
| 4240 VariableDeclarationList declarationList = ParserTestCase.parse5("parseVariab
leDeclarationList", "const a", []); | 3303 VariableDeclarationList declarationList = ParserTestCase.parse6("parseVariab
leDeclarationList", "const a", []); |
| 4241 JUnitTestCase.assertNotNull(declarationList.keyword); | 3304 JUnitTestCase.assertNotNull(declarationList.keyword); |
| 4242 JUnitTestCase.assertNull(declarationList.type); | 3305 JUnitTestCase.assertNull(declarationList.type); |
| 4243 EngineTestCase.assertSize(1, declarationList.variables); | 3306 EngineTestCase.assertSize(1, declarationList.variables); |
| 4244 } | 3307 } |
| 4245 void test_parseVariableDeclarationList_const_type() { | 3308 void test_parseVariableDeclarationList_const_type() { |
| 4246 VariableDeclarationList declarationList = ParserTestCase.parse5("parseVariab
leDeclarationList", "const A a", []); | 3309 VariableDeclarationList declarationList = ParserTestCase.parse6("parseVariab
leDeclarationList", "const A a", []); |
| 4247 JUnitTestCase.assertNotNull(declarationList.keyword); | 3310 JUnitTestCase.assertNotNull(declarationList.keyword); |
| 4248 JUnitTestCase.assertNotNull(declarationList.type); | 3311 JUnitTestCase.assertNotNull(declarationList.type); |
| 4249 EngineTestCase.assertSize(1, declarationList.variables); | 3312 EngineTestCase.assertSize(1, declarationList.variables); |
| 4250 } | 3313 } |
| 4251 void test_parseVariableDeclarationList_final_noType() { | 3314 void test_parseVariableDeclarationList_final_noType() { |
| 4252 VariableDeclarationList declarationList = ParserTestCase.parse5("parseVariab
leDeclarationList", "final a", []); | 3315 VariableDeclarationList declarationList = ParserTestCase.parse6("parseVariab
leDeclarationList", "final a", []); |
| 4253 JUnitTestCase.assertNotNull(declarationList.keyword); | 3316 JUnitTestCase.assertNotNull(declarationList.keyword); |
| 4254 JUnitTestCase.assertNull(declarationList.type); | 3317 JUnitTestCase.assertNull(declarationList.type); |
| 4255 EngineTestCase.assertSize(1, declarationList.variables); | 3318 EngineTestCase.assertSize(1, declarationList.variables); |
| 4256 } | 3319 } |
| 4257 void test_parseVariableDeclarationList_final_type() { | 3320 void test_parseVariableDeclarationList_final_type() { |
| 4258 VariableDeclarationList declarationList = ParserTestCase.parse5("parseVariab
leDeclarationList", "final A a", []); | 3321 VariableDeclarationList declarationList = ParserTestCase.parse6("parseVariab
leDeclarationList", "final A a", []); |
| 4259 JUnitTestCase.assertNotNull(declarationList.keyword); | 3322 JUnitTestCase.assertNotNull(declarationList.keyword); |
| 4260 JUnitTestCase.assertNotNull(declarationList.type); | 3323 JUnitTestCase.assertNotNull(declarationList.type); |
| 4261 EngineTestCase.assertSize(1, declarationList.variables); | 3324 EngineTestCase.assertSize(1, declarationList.variables); |
| 4262 } | 3325 } |
| 4263 void test_parseVariableDeclarationList_type_multiple() { | 3326 void test_parseVariableDeclarationList_type_multiple() { |
| 4264 VariableDeclarationList declarationList = ParserTestCase.parse5("parseVariab
leDeclarationList", "A a, b, c", []); | 3327 VariableDeclarationList declarationList = ParserTestCase.parse6("parseVariab
leDeclarationList", "A a, b, c", []); |
| 4265 JUnitTestCase.assertNull(declarationList.keyword); | 3328 JUnitTestCase.assertNull(declarationList.keyword); |
| 4266 JUnitTestCase.assertNotNull(declarationList.type); | 3329 JUnitTestCase.assertNotNull(declarationList.type); |
| 4267 EngineTestCase.assertSize(3, declarationList.variables); | 3330 EngineTestCase.assertSize(3, declarationList.variables); |
| 4268 } | 3331 } |
| 4269 void test_parseVariableDeclarationList_type_single() { | 3332 void test_parseVariableDeclarationList_type_single() { |
| 4270 VariableDeclarationList declarationList = ParserTestCase.parse5("parseVariab
leDeclarationList", "A a", []); | 3333 VariableDeclarationList declarationList = ParserTestCase.parse6("parseVariab
leDeclarationList", "A a", []); |
| 4271 JUnitTestCase.assertNull(declarationList.keyword); | 3334 JUnitTestCase.assertNull(declarationList.keyword); |
| 4272 JUnitTestCase.assertNotNull(declarationList.type); | 3335 JUnitTestCase.assertNotNull(declarationList.type); |
| 4273 EngineTestCase.assertSize(1, declarationList.variables); | 3336 EngineTestCase.assertSize(1, declarationList.variables); |
| 4274 } | 3337 } |
| 4275 void test_parseVariableDeclarationList_var_multiple() { | 3338 void test_parseVariableDeclarationList_var_multiple() { |
| 4276 VariableDeclarationList declarationList = ParserTestCase.parse5("parseVariab
leDeclarationList", "var a, b, c", []); | 3339 VariableDeclarationList declarationList = ParserTestCase.parse6("parseVariab
leDeclarationList", "var a, b, c", []); |
| 4277 JUnitTestCase.assertNotNull(declarationList.keyword); | 3340 JUnitTestCase.assertNotNull(declarationList.keyword); |
| 4278 JUnitTestCase.assertNull(declarationList.type); | 3341 JUnitTestCase.assertNull(declarationList.type); |
| 4279 EngineTestCase.assertSize(3, declarationList.variables); | 3342 EngineTestCase.assertSize(3, declarationList.variables); |
| 4280 } | 3343 } |
| 4281 void test_parseVariableDeclarationList_var_single() { | 3344 void test_parseVariableDeclarationList_var_single() { |
| 4282 VariableDeclarationList declarationList = ParserTestCase.parse5("parseVariab
leDeclarationList", "var a", []); | 3345 VariableDeclarationList declarationList = ParserTestCase.parse6("parseVariab
leDeclarationList", "var a", []); |
| 4283 JUnitTestCase.assertNotNull(declarationList.keyword); | 3346 JUnitTestCase.assertNotNull(declarationList.keyword); |
| 4284 JUnitTestCase.assertNull(declarationList.type); | 3347 JUnitTestCase.assertNull(declarationList.type); |
| 4285 EngineTestCase.assertSize(1, declarationList.variables); | 3348 EngineTestCase.assertSize(1, declarationList.variables); |
| 4286 } | 3349 } |
| 4287 void test_parseVariableDeclarationList2_type() { | 3350 void test_parseVariableDeclarationList2_type() { |
| 4288 TypeName type = new TypeName.full(new SimpleIdentifier.full(null), null); | 3351 TypeName type = new TypeName.full(new SimpleIdentifier.full(null), null); |
| 4289 VariableDeclarationList declarationList = ParserTestCase.parse("parseVariabl
eDeclarationList", <Object> [null, type], "a"); | 3352 VariableDeclarationList declarationList = ParserTestCase.parse("parseVariabl
eDeclarationList", <Object> [null, type], "a"); |
| 4290 JUnitTestCase.assertNull(declarationList.keyword); | 3353 JUnitTestCase.assertNull(declarationList.keyword); |
| 4291 JUnitTestCase.assertEquals(type, declarationList.type); | 3354 JUnitTestCase.assertEquals(type, declarationList.type); |
| 4292 EngineTestCase.assertSize(1, declarationList.variables); | 3355 EngineTestCase.assertSize(1, declarationList.variables); |
| 4293 } | 3356 } |
| 4294 void test_parseVariableDeclarationList2_var() { | 3357 void test_parseVariableDeclarationList2_var() { |
| 4295 Token keyword = TokenFactory.token(Keyword.VAR); | 3358 Token keyword = TokenFactory.token(Keyword.VAR); |
| 4296 VariableDeclarationList declarationList = ParserTestCase.parse("parseVariabl
eDeclarationList", <Object> [keyword, null], "a, b, c"); | 3359 VariableDeclarationList declarationList = ParserTestCase.parse("parseVariabl
eDeclarationList", <Object> [keyword, null], "a, b, c"); |
| 4297 JUnitTestCase.assertEquals(keyword, declarationList.keyword); | 3360 JUnitTestCase.assertEquals(keyword, declarationList.keyword); |
| 4298 JUnitTestCase.assertNull(declarationList.type); | 3361 JUnitTestCase.assertNull(declarationList.type); |
| 4299 EngineTestCase.assertSize(3, declarationList.variables); | 3362 EngineTestCase.assertSize(3, declarationList.variables); |
| 4300 } | 3363 } |
| 4301 void test_parseVariableDeclarationStatement_multiple() { | 3364 void test_parseVariableDeclarationStatement_multiple() { |
| 4302 VariableDeclarationStatement statement = ParserTestCase.parse5("parseVariabl
eDeclarationStatement", "var x, y, z;", []); | 3365 VariableDeclarationStatement statement = ParserTestCase.parse6("parseVariabl
eDeclarationStatement", "var x, y, z;", []); |
| 4303 JUnitTestCase.assertNotNull(statement.semicolon); | 3366 JUnitTestCase.assertNotNull(statement.semicolon); |
| 4304 VariableDeclarationList variableList = statement.variables; | 3367 VariableDeclarationList variableList = statement.variables; |
| 4305 JUnitTestCase.assertNotNull(variableList); | 3368 JUnitTestCase.assertNotNull(variableList); |
| 4306 EngineTestCase.assertSize(3, variableList.variables); | 3369 EngineTestCase.assertSize(3, variableList.variables); |
| 4307 } | 3370 } |
| 4308 void test_parseVariableDeclarationStatement_single() { | 3371 void test_parseVariableDeclarationStatement_single() { |
| 4309 VariableDeclarationStatement statement = ParserTestCase.parse5("parseVariabl
eDeclarationStatement", "var x;", []); | 3372 VariableDeclarationStatement statement = ParserTestCase.parse6("parseVariabl
eDeclarationStatement", "var x;", []); |
| 4310 JUnitTestCase.assertNotNull(statement.semicolon); | 3373 JUnitTestCase.assertNotNull(statement.semicolon); |
| 4311 VariableDeclarationList variableList = statement.variables; | 3374 VariableDeclarationList variableList = statement.variables; |
| 4312 JUnitTestCase.assertNotNull(variableList); | 3375 JUnitTestCase.assertNotNull(variableList); |
| 4313 EngineTestCase.assertSize(1, variableList.variables); | 3376 EngineTestCase.assertSize(1, variableList.variables); |
| 4314 } | 3377 } |
| 4315 void test_parseWhileStatement() { | 3378 void test_parseWhileStatement() { |
| 4316 WhileStatement statement = ParserTestCase.parse5("parseWhileStatement", "whi
le (x) {}", []); | 3379 WhileStatement statement = ParserTestCase.parse6("parseWhileStatement", "whi
le (x) {}", []); |
| 4317 JUnitTestCase.assertNotNull(statement.keyword); | 3380 JUnitTestCase.assertNotNull(statement.keyword); |
| 4318 JUnitTestCase.assertNotNull(statement.leftParenthesis); | 3381 JUnitTestCase.assertNotNull(statement.leftParenthesis); |
| 4319 JUnitTestCase.assertNotNull(statement.condition); | 3382 JUnitTestCase.assertNotNull(statement.condition); |
| 4320 JUnitTestCase.assertNotNull(statement.rightParenthesis); | 3383 JUnitTestCase.assertNotNull(statement.rightParenthesis); |
| 4321 JUnitTestCase.assertNotNull(statement.body); | 3384 JUnitTestCase.assertNotNull(statement.body); |
| 4322 } | 3385 } |
| 4323 void test_parseWithClause_multiple() { | 3386 void test_parseWithClause_multiple() { |
| 4324 WithClause clause = ParserTestCase.parse5("parseWithClause", "with A, B, C",
[]); | 3387 WithClause clause = ParserTestCase.parse6("parseWithClause", "with A, B, C",
[]); |
| 4325 JUnitTestCase.assertNotNull(clause.withKeyword); | 3388 JUnitTestCase.assertNotNull(clause.withKeyword); |
| 4326 EngineTestCase.assertSize(3, clause.mixinTypes); | 3389 EngineTestCase.assertSize(3, clause.mixinTypes); |
| 4327 } | 3390 } |
| 4328 void test_parseWithClause_single() { | 3391 void test_parseWithClause_single() { |
| 4329 WithClause clause = ParserTestCase.parse5("parseWithClause", "with M", []); | 3392 WithClause clause = ParserTestCase.parse6("parseWithClause", "with M", []); |
| 4330 JUnitTestCase.assertNotNull(clause.withKeyword); | 3393 JUnitTestCase.assertNotNull(clause.withKeyword); |
| 4331 EngineTestCase.assertSize(1, clause.mixinTypes); | 3394 EngineTestCase.assertSize(1, clause.mixinTypes); |
| 4332 } | 3395 } |
| 4333 void test_skipPrefixedIdentifier_invalid() { | 3396 void test_skipPrefixedIdentifier_invalid() { |
| 4334 Token following = skip("skipPrefixedIdentifier", "+"); | 3397 Token following = skip("skipPrefixedIdentifier", "+"); |
| 4335 JUnitTestCase.assertNull(following); | 3398 JUnitTestCase.assertNull(following); |
| 4336 } | 3399 } |
| 4337 void test_skipPrefixedIdentifier_notPrefixed() { | 3400 void test_skipPrefixedIdentifier_notPrefixed() { |
| 4338 Token following = skip("skipPrefixedIdentifier", "a +"); | 3401 Token following = skip("skipPrefixedIdentifier", "a +"); |
| 4339 JUnitTestCase.assertNotNull(following); | 3402 JUnitTestCase.assertNotNull(following); |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4419 JUnitTestCase.assertNotNull(following); | 3482 JUnitTestCase.assertNotNull(following); |
| 4420 JUnitTestCase.assertEquals(TokenType.PLUS, following.type); | 3483 JUnitTestCase.assertEquals(TokenType.PLUS, following.type); |
| 4421 } | 3484 } |
| 4422 /** | 3485 /** |
| 4423 * Invoke the method {@link Parser#computeStringValue(String)} with the given
argument. | 3486 * Invoke the method {@link Parser#computeStringValue(String)} with the given
argument. |
| 4424 * @param lexeme the argument to the method | 3487 * @param lexeme the argument to the method |
| 4425 * @return the result of invoking the method | 3488 * @return the result of invoking the method |
| 4426 * @throws Exception if the method could not be invoked or throws an exception | 3489 * @throws Exception if the method could not be invoked or throws an exception |
| 4427 */ | 3490 */ |
| 4428 String computeStringValue(String lexeme) { | 3491 String computeStringValue(String lexeme) { |
| 4429 AnalysisErrorListener listener = new AnalysisErrorListener_10(); | 3492 AnalysisErrorListener listener = new AnalysisErrorListener_12(); |
| 4430 Parser parser = new Parser(null, listener); | 3493 Parser parser = new Parser(null, listener); |
| 4431 return (invokeParserMethodImpl(parser, "computeStringValue", <Object> [lexem
e], null) as String); | 3494 return invokeParserMethodImpl(parser, "computeStringValue", <Object> [lexeme
], null) as String; |
| 4432 } | 3495 } |
| 4433 /** | 3496 /** |
| 4434 * Invoke the method {@link Parser#createSyntheticIdentifier()} with the parse
r set to the token | 3497 * Invoke the method {@link Parser#createSyntheticIdentifier()} with the parse
r set to the token |
| 4435 * stream produced by scanning the given source. | 3498 * stream produced by scanning the given source. |
| 4436 * @param source the source to be scanned to produce the token stream being te
sted | 3499 * @param source the source to be scanned to produce the token stream being te
sted |
| 4437 * @return the result of invoking the method | 3500 * @return the result of invoking the method |
| 4438 * @throws Exception if the method could not be invoked or throws an exception | 3501 * @throws Exception if the method could not be invoked or throws an exception |
| 4439 */ | 3502 */ |
| 4440 SimpleIdentifier createSyntheticIdentifier() { | 3503 SimpleIdentifier createSyntheticIdentifier() { |
| 4441 GatheringErrorListener listener = new GatheringErrorListener(); | 3504 GatheringErrorListener listener = new GatheringErrorListener(); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 4468 * produced by scanning the given source. | 3531 * produced by scanning the given source. |
| 4469 * @param source the source to be scanned to produce the token stream being te
sted | 3532 * @param source the source to be scanned to produce the token stream being te
sted |
| 4470 * @return the result of invoking the method | 3533 * @return the result of invoking the method |
| 4471 * @throws Exception if the method could not be invoked or throws an exception | 3534 * @throws Exception if the method could not be invoked or throws an exception |
| 4472 */ | 3535 */ |
| 4473 bool isFunctionExpression(String source) { | 3536 bool isFunctionExpression(String source) { |
| 4474 GatheringErrorListener listener = new GatheringErrorListener(); | 3537 GatheringErrorListener listener = new GatheringErrorListener(); |
| 4475 StringScanner scanner = new StringScanner(null, source, listener); | 3538 StringScanner scanner = new StringScanner(null, source, listener); |
| 4476 Token tokenStream = scanner.tokenize(); | 3539 Token tokenStream = scanner.tokenize(); |
| 4477 Parser parser = new Parser(null, listener); | 3540 Parser parser = new Parser(null, listener); |
| 4478 return (invokeParserMethodImpl(parser, "isFunctionExpression", <Object> [tok
enStream], tokenStream) as bool); | 3541 return invokeParserMethodImpl(parser, "isFunctionExpression", <Object> [toke
nStream], tokenStream) as bool; |
| 4479 } | 3542 } |
| 4480 /** | 3543 /** |
| 4481 * Invoke the method {@link Parser#isInitializedVariableDeclaration()} with th
e parser set to the | 3544 * Invoke the method {@link Parser#isInitializedVariableDeclaration()} with th
e parser set to the |
| 4482 * token stream produced by scanning the given source. | 3545 * token stream produced by scanning the given source. |
| 4483 * @param source the source to be scanned to produce the token stream being te
sted | 3546 * @param source the source to be scanned to produce the token stream being te
sted |
| 4484 * @return the result of invoking the method | 3547 * @return the result of invoking the method |
| 4485 * @throws Exception if the method could not be invoked or throws an exception | 3548 * @throws Exception if the method could not be invoked or throws an exception |
| 4486 */ | 3549 */ |
| 4487 bool isInitializedVariableDeclaration(String source) { | 3550 bool isInitializedVariableDeclaration(String source) { |
| 4488 GatheringErrorListener listener = new GatheringErrorListener(); | 3551 GatheringErrorListener listener = new GatheringErrorListener(); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 4506 * @param source the source to be processed by the method | 3569 * @param source the source to be processed by the method |
| 4507 * @return the result of invoking the method | 3570 * @return the result of invoking the method |
| 4508 * @throws Exception if the method could not be invoked or throws an exception | 3571 * @throws Exception if the method could not be invoked or throws an exception |
| 4509 * @throws AssertionFailedError if the result is {@code null} | 3572 * @throws AssertionFailedError if the result is {@code null} |
| 4510 */ | 3573 */ |
| 4511 Token skip(String methodName, String source) { | 3574 Token skip(String methodName, String source) { |
| 4512 GatheringErrorListener listener = new GatheringErrorListener(); | 3575 GatheringErrorListener listener = new GatheringErrorListener(); |
| 4513 StringScanner scanner = new StringScanner(null, source, listener); | 3576 StringScanner scanner = new StringScanner(null, source, listener); |
| 4514 Token tokenStream = scanner.tokenize(); | 3577 Token tokenStream = scanner.tokenize(); |
| 4515 Parser parser = new Parser(null, listener); | 3578 Parser parser = new Parser(null, listener); |
| 4516 return (invokeParserMethodImpl(parser, methodName, <Object> [tokenStream], t
okenStream) as Token); | 3579 return invokeParserMethodImpl(parser, methodName, <Object> [tokenStream], to
kenStream) as Token; |
| 4517 } | 3580 } |
| 4518 static dartSuite() { | 3581 static dartSuite() { |
| 4519 _ut.group('SimpleParserTest', () { | 3582 _ut.group('SimpleParserTest', () { |
| 4520 _ut.test('test_Parser', () { | 3583 _ut.test('test_Parser', () { |
| 4521 final __test = new SimpleParserTest(); | 3584 final __test = new SimpleParserTest(); |
| 4522 runJUnitTest(__test, __test.test_Parser); | 3585 runJUnitTest(__test, __test.test_Parser); |
| 4523 }); | 3586 }); |
| 4524 _ut.test('test_computeStringValue_emptyInterpolationPrefix', () { | 3587 _ut.test('test_computeStringValue_emptyInterpolationPrefix', () { |
| 4525 final __test = new SimpleParserTest(); | 3588 final __test = new SimpleParserTest(); |
| 4526 runJUnitTest(__test, __test.test_computeStringValue_emptyInterpolationPr
efix); | 3589 runJUnitTest(__test, __test.test_computeStringValue_emptyInterpolationPr
efix); |
| (...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4902 runJUnitTest(__test, __test.test_parseCascadeSection_ia); | 3965 runJUnitTest(__test, __test.test_parseCascadeSection_ia); |
| 4903 }); | 3966 }); |
| 4904 _ut.test('test_parseCascadeSection_p', () { | 3967 _ut.test('test_parseCascadeSection_p', () { |
| 4905 final __test = new SimpleParserTest(); | 3968 final __test = new SimpleParserTest(); |
| 4906 runJUnitTest(__test, __test.test_parseCascadeSection_p); | 3969 runJUnitTest(__test, __test.test_parseCascadeSection_p); |
| 4907 }); | 3970 }); |
| 4908 _ut.test('test_parseCascadeSection_p_assign', () { | 3971 _ut.test('test_parseCascadeSection_p_assign', () { |
| 4909 final __test = new SimpleParserTest(); | 3972 final __test = new SimpleParserTest(); |
| 4910 runJUnitTest(__test, __test.test_parseCascadeSection_p_assign); | 3973 runJUnitTest(__test, __test.test_parseCascadeSection_p_assign); |
| 4911 }); | 3974 }); |
| 3975 _ut.test('test_parseCascadeSection_p_assign_withCascade', () { |
| 3976 final __test = new SimpleParserTest(); |
| 3977 runJUnitTest(__test, __test.test_parseCascadeSection_p_assign_withCascad
e); |
| 3978 }); |
| 4912 _ut.test('test_parseCascadeSection_p_builtIn', () { | 3979 _ut.test('test_parseCascadeSection_p_builtIn', () { |
| 4913 final __test = new SimpleParserTest(); | 3980 final __test = new SimpleParserTest(); |
| 4914 runJUnitTest(__test, __test.test_parseCascadeSection_p_builtIn); | 3981 runJUnitTest(__test, __test.test_parseCascadeSection_p_builtIn); |
| 4915 }); | 3982 }); |
| 4916 _ut.test('test_parseCascadeSection_pa', () { | 3983 _ut.test('test_parseCascadeSection_pa', () { |
| 4917 final __test = new SimpleParserTest(); | 3984 final __test = new SimpleParserTest(); |
| 4918 runJUnitTest(__test, __test.test_parseCascadeSection_pa); | 3985 runJUnitTest(__test, __test.test_parseCascadeSection_pa); |
| 4919 }); | 3986 }); |
| 4920 _ut.test('test_parseCascadeSection_paa', () { | 3987 _ut.test('test_parseCascadeSection_paa', () { |
| 4921 final __test = new SimpleParserTest(); | 3988 final __test = new SimpleParserTest(); |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5122 runJUnitTest(__test, __test.test_parseCommentReference_simple); | 4189 runJUnitTest(__test, __test.test_parseCommentReference_simple); |
| 5123 }); | 4190 }); |
| 5124 _ut.test('test_parseCommentReferences_multiLine', () { | 4191 _ut.test('test_parseCommentReferences_multiLine', () { |
| 5125 final __test = new SimpleParserTest(); | 4192 final __test = new SimpleParserTest(); |
| 5126 runJUnitTest(__test, __test.test_parseCommentReferences_multiLine); | 4193 runJUnitTest(__test, __test.test_parseCommentReferences_multiLine); |
| 5127 }); | 4194 }); |
| 5128 _ut.test('test_parseCommentReferences_singleLine', () { | 4195 _ut.test('test_parseCommentReferences_singleLine', () { |
| 5129 final __test = new SimpleParserTest(); | 4196 final __test = new SimpleParserTest(); |
| 5130 runJUnitTest(__test, __test.test_parseCommentReferences_singleLine); | 4197 runJUnitTest(__test, __test.test_parseCommentReferences_singleLine); |
| 5131 }); | 4198 }); |
| 4199 _ut.test('test_parseCompilationUnitMember_abstractAsPrefix', () { |
| 4200 final __test = new SimpleParserTest(); |
| 4201 runJUnitTest(__test, __test.test_parseCompilationUnitMember_abstractAsPr
efix); |
| 4202 }); |
| 5132 _ut.test('test_parseCompilationUnitMember_class', () { | 4203 _ut.test('test_parseCompilationUnitMember_class', () { |
| 5133 final __test = new SimpleParserTest(); | 4204 final __test = new SimpleParserTest(); |
| 5134 runJUnitTest(__test, __test.test_parseCompilationUnitMember_class); | 4205 runJUnitTest(__test, __test.test_parseCompilationUnitMember_class); |
| 5135 }); | 4206 }); |
| 5136 _ut.test('test_parseCompilationUnitMember_constVariable', () { | 4207 _ut.test('test_parseCompilationUnitMember_constVariable', () { |
| 5137 final __test = new SimpleParserTest(); | 4208 final __test = new SimpleParserTest(); |
| 5138 runJUnitTest(__test, __test.test_parseCompilationUnitMember_constVariabl
e); | 4209 runJUnitTest(__test, __test.test_parseCompilationUnitMember_constVariabl
e); |
| 5139 }); | 4210 }); |
| 5140 _ut.test('test_parseCompilationUnitMember_finalVariable', () { | 4211 _ut.test('test_parseCompilationUnitMember_finalVariable', () { |
| 5141 final __test = new SimpleParserTest(); | 4212 final __test = new SimpleParserTest(); |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5206 runJUnitTest(__test, __test.test_parseCompilationUnitMember_typedef_clas
s_noImplements); | 4277 runJUnitTest(__test, __test.test_parseCompilationUnitMember_typedef_clas
s_noImplements); |
| 5207 }); | 4278 }); |
| 5208 _ut.test('test_parseCompilationUnitMember_typedef_function', () { | 4279 _ut.test('test_parseCompilationUnitMember_typedef_function', () { |
| 5209 final __test = new SimpleParserTest(); | 4280 final __test = new SimpleParserTest(); |
| 5210 runJUnitTest(__test, __test.test_parseCompilationUnitMember_typedef_func
tion); | 4281 runJUnitTest(__test, __test.test_parseCompilationUnitMember_typedef_func
tion); |
| 5211 }); | 4282 }); |
| 5212 _ut.test('test_parseCompilationUnitMember_variable', () { | 4283 _ut.test('test_parseCompilationUnitMember_variable', () { |
| 5213 final __test = new SimpleParserTest(); | 4284 final __test = new SimpleParserTest(); |
| 5214 runJUnitTest(__test, __test.test_parseCompilationUnitMember_variable); | 4285 runJUnitTest(__test, __test.test_parseCompilationUnitMember_variable); |
| 5215 }); | 4286 }); |
| 4287 _ut.test('test_parseCompilationUnit_abstractAsPrefix_parameterized', () { |
| 4288 final __test = new SimpleParserTest(); |
| 4289 runJUnitTest(__test, __test.test_parseCompilationUnit_abstractAsPrefix_p
arameterized); |
| 4290 }); |
| 5216 _ut.test('test_parseCompilationUnit_directives_multiple', () { | 4291 _ut.test('test_parseCompilationUnit_directives_multiple', () { |
| 5217 final __test = new SimpleParserTest(); | 4292 final __test = new SimpleParserTest(); |
| 5218 runJUnitTest(__test, __test.test_parseCompilationUnit_directives_multipl
e); | 4293 runJUnitTest(__test, __test.test_parseCompilationUnit_directives_multipl
e); |
| 5219 }); | 4294 }); |
| 5220 _ut.test('test_parseCompilationUnit_directives_single', () { | 4295 _ut.test('test_parseCompilationUnit_directives_single', () { |
| 5221 final __test = new SimpleParserTest(); | 4296 final __test = new SimpleParserTest(); |
| 5222 runJUnitTest(__test, __test.test_parseCompilationUnit_directives_single)
; | 4297 runJUnitTest(__test, __test.test_parseCompilationUnit_directives_single)
; |
| 5223 }); | 4298 }); |
| 5224 _ut.test('test_parseCompilationUnit_empty', () { | 4299 _ut.test('test_parseCompilationUnit_empty', () { |
| 5225 final __test = new SimpleParserTest(); | 4300 final __test = new SimpleParserTest(); |
| 5226 runJUnitTest(__test, __test.test_parseCompilationUnit_empty); | 4301 runJUnitTest(__test, __test.test_parseCompilationUnit_empty); |
| 5227 }); | 4302 }); |
| 4303 _ut.test('test_parseCompilationUnit_exportAsPrefix', () { |
| 4304 final __test = new SimpleParserTest(); |
| 4305 runJUnitTest(__test, __test.test_parseCompilationUnit_exportAsPrefix); |
| 4306 }); |
| 4307 _ut.test('test_parseCompilationUnit_exportAsPrefix_parameterized', () { |
| 4308 final __test = new SimpleParserTest(); |
| 4309 runJUnitTest(__test, __test.test_parseCompilationUnit_exportAsPrefix_par
ameterized); |
| 4310 }); |
| 4311 _ut.test('test_parseCompilationUnit_operatorAsPrefix_parameterized', () { |
| 4312 final __test = new SimpleParserTest(); |
| 4313 runJUnitTest(__test, __test.test_parseCompilationUnit_operatorAsPrefix_p
arameterized); |
| 4314 }); |
| 5228 _ut.test('test_parseCompilationUnit_script', () { | 4315 _ut.test('test_parseCompilationUnit_script', () { |
| 5229 final __test = new SimpleParserTest(); | 4316 final __test = new SimpleParserTest(); |
| 5230 runJUnitTest(__test, __test.test_parseCompilationUnit_script); | 4317 runJUnitTest(__test, __test.test_parseCompilationUnit_script); |
| 5231 }); | 4318 }); |
| 5232 _ut.test('test_parseCompilationUnit_topLevelDeclaration', () { | 4319 _ut.test('test_parseCompilationUnit_topLevelDeclaration', () { |
| 5233 final __test = new SimpleParserTest(); | 4320 final __test = new SimpleParserTest(); |
| 5234 runJUnitTest(__test, __test.test_parseCompilationUnit_topLevelDeclaratio
n); | 4321 runJUnitTest(__test, __test.test_parseCompilationUnit_topLevelDeclaratio
n); |
| 5235 }); | 4322 }); |
| 4323 _ut.test('test_parseCompilationUnit_typedefAsPrefix', () { |
| 4324 final __test = new SimpleParserTest(); |
| 4325 runJUnitTest(__test, __test.test_parseCompilationUnit_typedefAsPrefix); |
| 4326 }); |
| 5236 _ut.test('test_parseConditionalExpression', () { | 4327 _ut.test('test_parseConditionalExpression', () { |
| 5237 final __test = new SimpleParserTest(); | 4328 final __test = new SimpleParserTest(); |
| 5238 runJUnitTest(__test, __test.test_parseConditionalExpression); | 4329 runJUnitTest(__test, __test.test_parseConditionalExpression); |
| 5239 }); | 4330 }); |
| 5240 _ut.test('test_parseConstExpression_instanceCreation', () { | 4331 _ut.test('test_parseConstExpression_instanceCreation', () { |
| 5241 final __test = new SimpleParserTest(); | 4332 final __test = new SimpleParserTest(); |
| 5242 runJUnitTest(__test, __test.test_parseConstExpression_instanceCreation); | 4333 runJUnitTest(__test, __test.test_parseConstExpression_instanceCreation); |
| 5243 }); | 4334 }); |
| 5244 _ut.test('test_parseConstExpression_listLiteral_typed', () { | 4335 _ut.test('test_parseConstExpression_listLiteral_typed', () { |
| 5245 final __test = new SimpleParserTest(); | 4336 final __test = new SimpleParserTest(); |
| (...skipping 1231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6477 final __test = new SimpleParserTest(); | 5568 final __test = new SimpleParserTest(); |
| 6478 runJUnitTest(__test, __test.test_skipTypeName_parameterized); | 5569 runJUnitTest(__test, __test.test_skipTypeName_parameterized); |
| 6479 }); | 5570 }); |
| 6480 _ut.test('test_skipTypeName_simple', () { | 5571 _ut.test('test_skipTypeName_simple', () { |
| 6481 final __test = new SimpleParserTest(); | 5572 final __test = new SimpleParserTest(); |
| 6482 runJUnitTest(__test, __test.test_skipTypeName_simple); | 5573 runJUnitTest(__test, __test.test_skipTypeName_simple); |
| 6483 }); | 5574 }); |
| 6484 }); | 5575 }); |
| 6485 } | 5576 } |
| 6486 } | 5577 } |
| 6487 class AnalysisErrorListener_10 implements AnalysisErrorListener { | 5578 class AnalysisErrorListener_12 implements AnalysisErrorListener { |
| 6488 void onError(AnalysisError event) { | 5579 void onError(AnalysisError event) { |
| 6489 JUnitTestCase.fail("Unexpected compilation error: ${event.message} (${event.
offset}, ${event.length})"); | 5580 JUnitTestCase.fail("Unexpected compilation error: ${event.message} (${event.
offset}, ${event.length})"); |
| 6490 } | 5581 } |
| 6491 } | 5582 } |
| 6492 /** | 5583 /** |
| 6493 * The class {@code ComplexParserTest} defines parser tests that test the parsin
g of more complex | 5584 * The class {@code ComplexParserTest} defines parser tests that test the parsin
g of more complex |
| 6494 * code fragments or the interactions between multiple parsing methods. For exam
ple, tests to ensure | 5585 * code fragments or the interactions between multiple parsing methods. For exam
ple, tests to ensure |
| 6495 * that the precedence of operations is being handled correctly should be define
d in this class. | 5586 * that the precedence of operations is being handled correctly should be define
d in this class. |
| 6496 * <p> | 5587 * <p> |
| 6497 * Simpler tests should be defined in the class {@link SimpleParserTest}. | 5588 * Simpler tests should be defined in the class {@link SimpleParserTest}. |
| (...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6889 final __test = new ComplexParserTest(); | 5980 final __test = new ComplexParserTest(); |
| 6890 runJUnitTest(__test, __test.test_shiftExpression_precedence_additive_rig
ht); | 5981 runJUnitTest(__test, __test.test_shiftExpression_precedence_additive_rig
ht); |
| 6891 }); | 5982 }); |
| 6892 _ut.test('test_shiftExpression_super', () { | 5983 _ut.test('test_shiftExpression_super', () { |
| 6893 final __test = new ComplexParserTest(); | 5984 final __test = new ComplexParserTest(); |
| 6894 runJUnitTest(__test, __test.test_shiftExpression_super); | 5985 runJUnitTest(__test, __test.test_shiftExpression_super); |
| 6895 }); | 5986 }); |
| 6896 }); | 5987 }); |
| 6897 } | 5988 } |
| 6898 } | 5989 } |
| 5990 /** |
| 5991 * Instances of the class {@code ASTValidator} are used to validate the correct
construction of an |
| 5992 * AST structure. |
| 5993 */ |
| 5994 class ASTValidator extends GeneralizingASTVisitor<Object> { |
| 5995 /** |
| 5996 * A list containing the errors found while traversing the AST structure. |
| 5997 */ |
| 5998 List<String> _errors = new List<String>(); |
| 5999 /** |
| 6000 * Assert that no errors were found while traversing any of the AST structures
that have been |
| 6001 * visited. |
| 6002 */ |
| 6003 void assertValid() { |
| 6004 if (!_errors.isEmpty) { |
| 6005 StringBuffer builder = new StringBuffer(); |
| 6006 builder.write("Invalid AST structure:"); |
| 6007 for (String message in _errors) { |
| 6008 builder.write("\r\n "); |
| 6009 builder.write(message); |
| 6010 } |
| 6011 JUnitTestCase.fail(builder.toString()); |
| 6012 } |
| 6013 } |
| 6014 Object visitNode(ASTNode node) { |
| 6015 validate(node); |
| 6016 return super.visitNode(node); |
| 6017 } |
| 6018 /** |
| 6019 * Validate that the given AST node is correctly constructed. |
| 6020 * @param node the AST node being validated |
| 6021 */ |
| 6022 void validate(ASTNode node) { |
| 6023 ASTNode parent20 = node.parent; |
| 6024 if (node is CompilationUnit) { |
| 6025 if (parent20 != null) { |
| 6026 _errors.add("Compilation units should not have a parent"); |
| 6027 } |
| 6028 } else { |
| 6029 if (parent20 == null) { |
| 6030 _errors.add("No parent for ${node.runtimeType.toString()}"); |
| 6031 } |
| 6032 } |
| 6033 if (node.beginToken == null) { |
| 6034 _errors.add("No begin token for ${node.runtimeType.toString()}"); |
| 6035 } |
| 6036 if (node.endToken == null) { |
| 6037 _errors.add("No end token for ${node.runtimeType.toString()}"); |
| 6038 } |
| 6039 int nodeStart = node.offset; |
| 6040 int nodeLength = node.length; |
| 6041 if (nodeStart < 0 || nodeLength < 0) { |
| 6042 _errors.add("No source info for ${node.runtimeType.toString()}"); |
| 6043 } |
| 6044 if (parent20 != null) { |
| 6045 int nodeEnd = nodeStart + nodeLength; |
| 6046 int parentStart = parent20.offset; |
| 6047 int parentEnd = parentStart + parent20.length; |
| 6048 if (nodeStart < parentStart) { |
| 6049 _errors.add("Invalid source start (${nodeStart}) for ${node.runtimeType.
toString()} inside ${parent20.runtimeType.toString()} (${parentStart})"); |
| 6050 } |
| 6051 if (nodeEnd > parentEnd) { |
| 6052 _errors.add("Invalid source end (${nodeEnd}) for ${node.runtimeType.toSt
ring()} inside ${parent20.runtimeType.toString()} (${parentStart})"); |
| 6053 } |
| 6054 } |
| 6055 } |
| 6056 } |
| 6057 class ParserTestCase extends EngineTestCase { |
| 6058 /** |
| 6059 * An empty array of objects used as arguments to zero-argument methods. |
| 6060 */ |
| 6061 static List<Object> _EMPTY_ARGUMENTS = new List<Object>(0); |
| 6062 /** |
| 6063 * Invoke a parse method in {@link Parser}. The method is assumed to have the
given number and |
| 6064 * type of parameters and will be invoked with the given arguments. |
| 6065 * <p> |
| 6066 * The given source is scanned and the parser is initialized to start with the
first token in the |
| 6067 * source before the parse method is invoked. |
| 6068 * @param methodName the name of the parse method that should be invoked to pa
rse the source |
| 6069 * @param objects the values of the arguments to the method |
| 6070 * @param source the source to be parsed by the parse method |
| 6071 * @return the result of invoking the method |
| 6072 * @throws Exception if the method could not be invoked or throws an exception |
| 6073 * @throws AssertionFailedError if the result is {@code null} or if any errors
are produced |
| 6074 */ |
| 6075 static Object parse(String methodName, List<Object> objects, String source) =>
parse4(methodName, objects, source, new List<AnalysisError>(0)); |
| 6076 /** |
| 6077 * Invoke a parse method in {@link Parser}. The method is assumed to have the
given number and |
| 6078 * type of parameters and will be invoked with the given arguments. |
| 6079 * <p> |
| 6080 * The given source is scanned and the parser is initialized to start with the
first token in the |
| 6081 * source before the parse method is invoked. |
| 6082 * @param methodName the name of the parse method that should be invoked to pa
rse the source |
| 6083 * @param objects the values of the arguments to the method |
| 6084 * @param source the source to be parsed by the parse method |
| 6085 * @param errorCodes the error codes of the errors that should be generated |
| 6086 * @return the result of invoking the method |
| 6087 * @throws Exception if the method could not be invoked or throws an exception |
| 6088 * @throws AssertionFailedError if the result is {@code null} or the errors pr
oduced while |
| 6089 * scanning and parsing the source do not match the expected errors |
| 6090 */ |
| 6091 static Object parse4(String methodName, List<Object> objects, String source, L
ist<AnalysisError> errors) { |
| 6092 GatheringErrorListener listener = new GatheringErrorListener(); |
| 6093 Object result = invokeParserMethod(methodName, objects, source, listener); |
| 6094 listener.assertErrors(errors); |
| 6095 return result; |
| 6096 } |
| 6097 /** |
| 6098 * Invoke a parse method in {@link Parser}. The method is assumed to have the
given number and |
| 6099 * type of parameters and will be invoked with the given arguments. |
| 6100 * <p> |
| 6101 * The given source is scanned and the parser is initialized to start with the
first token in the |
| 6102 * source before the parse method is invoked. |
| 6103 * @param methodName the name of the parse method that should be invoked to pa
rse the source |
| 6104 * @param objects the values of the arguments to the method |
| 6105 * @param source the source to be parsed by the parse method |
| 6106 * @param errorCodes the error codes of the errors that should be generated |
| 6107 * @return the result of invoking the method |
| 6108 * @throws Exception if the method could not be invoked or throws an exception |
| 6109 * @throws AssertionFailedError if the result is {@code null} or the errors pr
oduced while |
| 6110 * scanning and parsing the source do not match the expected errors |
| 6111 */ |
| 6112 static Object parse5(String methodName, List<Object> objects, String source, L
ist<ErrorCode> errorCodes) { |
| 6113 GatheringErrorListener listener = new GatheringErrorListener(); |
| 6114 Object result = invokeParserMethod(methodName, objects, source, listener); |
| 6115 listener.assertErrors2(errorCodes); |
| 6116 return result; |
| 6117 } |
| 6118 /** |
| 6119 * Invoke a parse method in {@link Parser}. The method is assumed to have no a
rguments. |
| 6120 * <p> |
| 6121 * The given source is scanned and the parser is initialized to start with the
first token in the |
| 6122 * source before the parse method is invoked. |
| 6123 * @param methodName the name of the parse method that should be invoked to pa
rse the source |
| 6124 * @param source the source to be parsed by the parse method |
| 6125 * @param errorCodes the error codes of the errors that should be generated |
| 6126 * @return the result of invoking the method |
| 6127 * @throws Exception if the method could not be invoked or throws an exception |
| 6128 * @throws AssertionFailedError if the result is {@code null} or the errors pr
oduced while |
| 6129 * scanning and parsing the source do not match the expected errors |
| 6130 */ |
| 6131 static Object parse6(String methodName, String source, List<ErrorCode> errorCo
des) => parse5(methodName, _EMPTY_ARGUMENTS, source, errorCodes); |
| 6132 /** |
| 6133 * Parse the given source as a compilation unit. |
| 6134 * @param source the source to be parsed |
| 6135 * @param errorCodes the error codes of the errors that are expected to be fou
nd |
| 6136 * @return the compilation unit that was parsed |
| 6137 * @throws Exception if the source could not be parsed, if the compilation err
ors in the source do |
| 6138 * not match those that are expected, or if the result would have been {@code
null} |
| 6139 */ |
| 6140 static CompilationUnit parseCompilationUnit(String source, List<ErrorCode> err
orCodes) { |
| 6141 GatheringErrorListener listener = new GatheringErrorListener(); |
| 6142 StringScanner scanner = new StringScanner(null, source, listener); |
| 6143 listener.setLineInfo(new TestSource(), scanner.lineStarts); |
| 6144 Token token = scanner.tokenize(); |
| 6145 Parser parser = new Parser(null, listener); |
| 6146 CompilationUnit unit = parser.parseCompilationUnit(token); |
| 6147 JUnitTestCase.assertNotNull(unit); |
| 6148 listener.assertErrors2(errorCodes); |
| 6149 return unit; |
| 6150 } |
| 6151 /** |
| 6152 * Parse the given source as an expression. |
| 6153 * @param source the source to be parsed |
| 6154 * @param errorCodes the error codes of the errors that are expected to be fou
nd |
| 6155 * @return the expression that was parsed |
| 6156 * @throws Exception if the source could not be parsed, if the compilation err
ors in the source do |
| 6157 * not match those that are expected, or if the result would have been {@code
null} |
| 6158 */ |
| 6159 static Expression parseExpression(String source, List<ErrorCode> errorCodes) { |
| 6160 GatheringErrorListener listener = new GatheringErrorListener(); |
| 6161 StringScanner scanner = new StringScanner(null, source, listener); |
| 6162 listener.setLineInfo(new TestSource(), scanner.lineStarts); |
| 6163 Token token = scanner.tokenize(); |
| 6164 Parser parser = new Parser(null, listener); |
| 6165 Expression expression = parser.parseExpression(token); |
| 6166 JUnitTestCase.assertNotNull(expression); |
| 6167 listener.assertErrors2(errorCodes); |
| 6168 return expression as Expression; |
| 6169 } |
| 6170 /** |
| 6171 * Parse the given source as a statement. |
| 6172 * @param source the source to be parsed |
| 6173 * @param errorCodes the error codes of the errors that are expected to be fou
nd |
| 6174 * @return the statement that was parsed |
| 6175 * @throws Exception if the source could not be parsed, if the compilation err
ors in the source do |
| 6176 * not match those that are expected, or if the result would have been {@code
null} |
| 6177 */ |
| 6178 static Statement parseStatement(String source, List<ErrorCode> errorCodes) { |
| 6179 GatheringErrorListener listener = new GatheringErrorListener(); |
| 6180 StringScanner scanner = new StringScanner(null, source, listener); |
| 6181 listener.setLineInfo(new TestSource(), scanner.lineStarts); |
| 6182 Token token = scanner.tokenize(); |
| 6183 Parser parser = new Parser(null, listener); |
| 6184 Statement statement = parser.parseStatement(token); |
| 6185 JUnitTestCase.assertNotNull(statement); |
| 6186 listener.assertErrors2(errorCodes); |
| 6187 return statement as Statement; |
| 6188 } |
| 6189 /** |
| 6190 * Parse the given source as a sequence of statements. |
| 6191 * @param source the source to be parsed |
| 6192 * @param expectedCount the number of statements that are expected |
| 6193 * @param errorCodes the error codes of the errors that are expected to be fou
nd |
| 6194 * @return the statements that were parsed |
| 6195 * @throws Exception if the source could not be parsed, if the number of state
ments does not match |
| 6196 * the expected count, if the compilation errors in the source do not match th
ose that |
| 6197 * are expected, or if the result would have been {@code null} |
| 6198 */ |
| 6199 static List<Statement> parseStatements(String source, int expectedCount, List<
ErrorCode> errorCodes) { |
| 6200 GatheringErrorListener listener = new GatheringErrorListener(); |
| 6201 StringScanner scanner = new StringScanner(null, source, listener); |
| 6202 listener.setLineInfo(new TestSource(), scanner.lineStarts); |
| 6203 Token token = scanner.tokenize(); |
| 6204 Parser parser = new Parser(null, listener); |
| 6205 List<Statement> statements = parser.parseStatements(token); |
| 6206 EngineTestCase.assertSize(expectedCount, statements); |
| 6207 listener.assertErrors2(errorCodes); |
| 6208 return statements; |
| 6209 } |
| 6210 /** |
| 6211 * Invoke a method in {@link Parser}. The method is assumed to have the given
number and type of |
| 6212 * parameters and will be invoked with the given arguments. |
| 6213 * <p> |
| 6214 * The given source is scanned and the parser is initialized to start with the
first token in the |
| 6215 * source before the method is invoked. |
| 6216 * @param methodName the name of the method that should be invoked |
| 6217 * @param objects the values of the arguments to the method |
| 6218 * @param source the source to be processed by the parse method |
| 6219 * @param listener the error listener that will be used for both scanning and
parsing |
| 6220 * @return the result of invoking the method |
| 6221 * @throws Exception if the method could not be invoked or throws an exception |
| 6222 * @throws AssertionFailedError if the result is {@code null} or the errors pr
oduced while |
| 6223 * scanning and parsing the source do not match the expected errors |
| 6224 */ |
| 6225 static Object invokeParserMethod(String methodName, List<Object> objects, Stri
ng source, GatheringErrorListener listener) { |
| 6226 StringScanner scanner = new StringScanner(null, source, listener); |
| 6227 Token tokenStream = scanner.tokenize(); |
| 6228 listener.setLineInfo(new TestSource(), scanner.lineStarts); |
| 6229 Parser parser = new Parser(null, listener); |
| 6230 Object result = invokeParserMethodImpl(parser, methodName, objects, tokenStr
eam); |
| 6231 JUnitTestCase.assertNotNull(result); |
| 6232 return result as Object; |
| 6233 } |
| 6234 /** |
| 6235 * Invoke a method in {@link Parser}. The method is assumed to have no argumen
ts. |
| 6236 * <p> |
| 6237 * The given source is scanned and the parser is initialized to start with the
first token in the |
| 6238 * source before the method is invoked. |
| 6239 * @param methodName the name of the method that should be invoked |
| 6240 * @param source the source to be processed by the parse method |
| 6241 * @param listener the error listener that will be used for both scanning and
parsing |
| 6242 * @return the result of invoking the method |
| 6243 * @throws Exception if the method could not be invoked or throws an exception |
| 6244 * @throws AssertionFailedError if the result is {@code null} or the errors pr
oduced while |
| 6245 * scanning and parsing the source do not match the expected errors |
| 6246 */ |
| 6247 static Object invokeParserMethod2(String methodName, String source, GatheringE
rrorListener listener) => invokeParserMethod(methodName, _EMPTY_ARGUMENTS, sourc
e, listener); |
| 6248 /** |
| 6249 * Return a CommentAndMetadata object with the given values that can be used f
or testing. |
| 6250 * @param comment the comment to be wrapped in the object |
| 6251 * @param annotations the annotations to be wrapped in the object |
| 6252 * @return a CommentAndMetadata object that can be used for testing |
| 6253 */ |
| 6254 CommentAndMetadata commentAndMetadata(Comment comment, List<Annotation> annota
tions) { |
| 6255 List<Annotation> metadata = new List<Annotation>(); |
| 6256 for (Annotation annotation in annotations) { |
| 6257 metadata.add(annotation); |
| 6258 } |
| 6259 return new CommentAndMetadata(comment, metadata); |
| 6260 } |
| 6261 /** |
| 6262 * Return an empty CommentAndMetadata object that can be used for testing. |
| 6263 * @return an empty CommentAndMetadata object that can be used for testing |
| 6264 */ |
| 6265 CommentAndMetadata emptyCommentAndMetadata() => new CommentAndMetadata(null, n
ew List<Annotation>()); |
| 6266 static dartSuite() { |
| 6267 _ut.group('ParserTestCase', () { |
| 6268 }); |
| 6269 } |
| 6270 } |
| 6271 /** |
| 6272 * The class {@code RecoveryParserTest} defines parser tests that test the parsi
ng of invalid code |
| 6273 * sequences to ensure that the correct recovery steps are taken in the parser. |
| 6274 */ |
| 6275 class RecoveryParserTest extends ParserTestCase { |
| 6276 void test_additiveExpression_missing_LHS() { |
| 6277 BinaryExpression expression = ParserTestCase.parseExpression("+ y", [ParserE
rrorCode.USE_OF_UNARY_PLUS_OPERATOR]); |
| 6278 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand); |
| 6279 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic()); |
| 6280 } |
| 6281 void test_additiveExpression_missing_LHS_RHS() { |
| 6282 BinaryExpression expression = ParserTestCase.parseExpression("+", [ParserErr
orCode.USE_OF_UNARY_PLUS_OPERATOR]); |
| 6283 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand); |
| 6284 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic()); |
| 6285 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); |
| 6286 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); |
| 6287 } |
| 6288 void test_additiveExpression_missing_RHS() { |
| 6289 BinaryExpression expression = ParserTestCase.parseExpression("x +", []); |
| 6290 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); |
| 6291 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); |
| 6292 } |
| 6293 void test_additiveExpression_missing_RHS_super() { |
| 6294 BinaryExpression expression = ParserTestCase.parseExpression("super +", []); |
| 6295 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); |
| 6296 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); |
| 6297 } |
| 6298 void test_additiveExpression_precedence_multiplicative_left() { |
| 6299 BinaryExpression expression = ParserTestCase.parseExpression("* +", [ParserE
rrorCode.USE_OF_UNARY_PLUS_OPERATOR]); |
| 6300 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); |
| 6301 } |
| 6302 void test_additiveExpression_precedence_multiplicative_right() { |
| 6303 BinaryExpression expression = ParserTestCase.parseExpression("+ *", [ParserE
rrorCode.USE_OF_UNARY_PLUS_OPERATOR]); |
| 6304 EngineTestCase.assertInstanceOf(BinaryExpression, expression.rightOperand); |
| 6305 } |
| 6306 void test_additiveExpression_super() { |
| 6307 BinaryExpression expression = ParserTestCase.parseExpression("super + +", [P
arserErrorCode.USE_OF_UNARY_PLUS_OPERATOR]); |
| 6308 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); |
| 6309 } |
| 6310 void test_argumentDefinitionTest_missing_identifier() { |
| 6311 ArgumentDefinitionTest expression = ParserTestCase.parseExpression("?", [Par
serErrorCode.MISSING_IDENTIFIER]); |
| 6312 JUnitTestCase.assertTrue(expression.identifier.isSynthetic()); |
| 6313 } |
| 6314 void test_assignmentExpression_missing_compound1() { |
| 6315 AssignmentExpression expression = ParserTestCase.parseExpression("= y = 0",
[]); |
| 6316 Expression syntheticExpression = expression.leftHandSide; |
| 6317 EngineTestCase.assertInstanceOf(SimpleIdentifier, syntheticExpression); |
| 6318 JUnitTestCase.assertTrue(syntheticExpression.isSynthetic()); |
| 6319 } |
| 6320 void test_assignmentExpression_missing_compound2() { |
| 6321 AssignmentExpression expression = ParserTestCase.parseExpression("x = = 0",
[]); |
| 6322 Expression syntheticExpression = ((expression.rightHandSide as AssignmentExp
ression)).leftHandSide; |
| 6323 EngineTestCase.assertInstanceOf(SimpleIdentifier, syntheticExpression); |
| 6324 JUnitTestCase.assertTrue(syntheticExpression.isSynthetic()); |
| 6325 } |
| 6326 void test_assignmentExpression_missing_compound3() { |
| 6327 AssignmentExpression expression = ParserTestCase.parseExpression("x = y =",
[]); |
| 6328 Expression syntheticExpression = ((expression.rightHandSide as AssignmentExp
ression)).rightHandSide; |
| 6329 EngineTestCase.assertInstanceOf(SimpleIdentifier, syntheticExpression); |
| 6330 JUnitTestCase.assertTrue(syntheticExpression.isSynthetic()); |
| 6331 } |
| 6332 void test_assignmentExpression_missing_LHS() { |
| 6333 AssignmentExpression expression = ParserTestCase.parseExpression("= 0", []); |
| 6334 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftHandSide); |
| 6335 JUnitTestCase.assertTrue(expression.leftHandSide.isSynthetic()); |
| 6336 } |
| 6337 void test_assignmentExpression_missing_RHS() { |
| 6338 AssignmentExpression expression = ParserTestCase.parseExpression("x =", []); |
| 6339 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftHandSide); |
| 6340 JUnitTestCase.assertTrue(expression.rightHandSide.isSynthetic()); |
| 6341 } |
| 6342 void test_bitwiseAndExpression_missing_LHS() { |
| 6343 BinaryExpression expression = ParserTestCase.parseExpression("& y", []); |
| 6344 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand); |
| 6345 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic()); |
| 6346 } |
| 6347 void test_bitwiseAndExpression_missing_LHS_RHS() { |
| 6348 BinaryExpression expression = ParserTestCase.parseExpression("&", []); |
| 6349 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand); |
| 6350 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic()); |
| 6351 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); |
| 6352 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); |
| 6353 } |
| 6354 void test_bitwiseAndExpression_missing_RHS() { |
| 6355 BinaryExpression expression = ParserTestCase.parseExpression("x &", []); |
| 6356 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); |
| 6357 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); |
| 6358 } |
| 6359 void test_bitwiseAndExpression_missing_RHS_super() { |
| 6360 BinaryExpression expression = ParserTestCase.parseExpression("super &", []); |
| 6361 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); |
| 6362 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); |
| 6363 } |
| 6364 void test_bitwiseAndExpression_precedence_equality_left() { |
| 6365 BinaryExpression expression = ParserTestCase.parseExpression("== &", []); |
| 6366 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); |
| 6367 } |
| 6368 void test_bitwiseAndExpression_precedence_equality_right() { |
| 6369 BinaryExpression expression = ParserTestCase.parseExpression("& ==", []); |
| 6370 EngineTestCase.assertInstanceOf(BinaryExpression, expression.rightOperand); |
| 6371 } |
| 6372 void test_bitwiseAndExpression_super() { |
| 6373 BinaryExpression expression = ParserTestCase.parseExpression("super & &", [
]); |
| 6374 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); |
| 6375 } |
| 6376 void test_bitwiseOrExpression_missing_LHS() { |
| 6377 BinaryExpression expression = ParserTestCase.parseExpression("| y", []); |
| 6378 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand); |
| 6379 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic()); |
| 6380 } |
| 6381 void test_bitwiseOrExpression_missing_LHS_RHS() { |
| 6382 BinaryExpression expression = ParserTestCase.parseExpression("|", []); |
| 6383 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand); |
| 6384 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic()); |
| 6385 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); |
| 6386 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); |
| 6387 } |
| 6388 void test_bitwiseOrExpression_missing_RHS() { |
| 6389 BinaryExpression expression = ParserTestCase.parseExpression("x |", []); |
| 6390 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); |
| 6391 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); |
| 6392 } |
| 6393 void test_bitwiseOrExpression_missing_RHS_super() { |
| 6394 BinaryExpression expression = ParserTestCase.parseExpression("super |", []); |
| 6395 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); |
| 6396 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); |
| 6397 } |
| 6398 void test_bitwiseOrExpression_precedence_xor_left() { |
| 6399 BinaryExpression expression = ParserTestCase.parseExpression("^ |", []); |
| 6400 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); |
| 6401 } |
| 6402 void test_bitwiseOrExpression_precedence_xor_right() { |
| 6403 BinaryExpression expression = ParserTestCase.parseExpression("| ^", []); |
| 6404 EngineTestCase.assertInstanceOf(BinaryExpression, expression.rightOperand); |
| 6405 } |
| 6406 void test_bitwiseOrExpression_super() { |
| 6407 BinaryExpression expression = ParserTestCase.parseExpression("super | |", [
]); |
| 6408 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); |
| 6409 } |
| 6410 void test_bitwiseXorExpression_missing_LHS() { |
| 6411 BinaryExpression expression = ParserTestCase.parseExpression("^ y", []); |
| 6412 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand); |
| 6413 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic()); |
| 6414 } |
| 6415 void test_bitwiseXorExpression_missing_LHS_RHS() { |
| 6416 BinaryExpression expression = ParserTestCase.parseExpression("^", []); |
| 6417 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand); |
| 6418 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic()); |
| 6419 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); |
| 6420 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); |
| 6421 } |
| 6422 void test_bitwiseXorExpression_missing_RHS() { |
| 6423 BinaryExpression expression = ParserTestCase.parseExpression("x ^", []); |
| 6424 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); |
| 6425 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); |
| 6426 } |
| 6427 void test_bitwiseXorExpression_missing_RHS_super() { |
| 6428 BinaryExpression expression = ParserTestCase.parseExpression("super ^", []); |
| 6429 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); |
| 6430 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); |
| 6431 } |
| 6432 void test_bitwiseXorExpression_precedence_and_left() { |
| 6433 BinaryExpression expression = ParserTestCase.parseExpression("& ^", []); |
| 6434 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); |
| 6435 } |
| 6436 void test_bitwiseXorExpression_precedence_and_right() { |
| 6437 BinaryExpression expression = ParserTestCase.parseExpression("^ &", []); |
| 6438 EngineTestCase.assertInstanceOf(BinaryExpression, expression.rightOperand); |
| 6439 } |
| 6440 void test_bitwiseXorExpression_super() { |
| 6441 BinaryExpression expression = ParserTestCase.parseExpression("super ^ ^", [
]); |
| 6442 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); |
| 6443 } |
| 6444 void test_conditionalExpression_missingElse() { |
| 6445 ConditionalExpression expression = ParserTestCase.parse6("parseConditionalEx
pression", "x ? y :", []); |
| 6446 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.elseExpression)
; |
| 6447 JUnitTestCase.assertTrue(expression.elseExpression.isSynthetic()); |
| 6448 } |
| 6449 void test_conditionalExpression_missingThen() { |
| 6450 ConditionalExpression expression = ParserTestCase.parse6("parseConditionalEx
pression", "x ? : z", []); |
| 6451 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.thenExpression)
; |
| 6452 JUnitTestCase.assertTrue(expression.thenExpression.isSynthetic()); |
| 6453 } |
| 6454 void test_equalityExpression_missing_LHS() { |
| 6455 BinaryExpression expression = ParserTestCase.parseExpression("== y", []); |
| 6456 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand); |
| 6457 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic()); |
| 6458 } |
| 6459 void test_equalityExpression_missing_LHS_RHS() { |
| 6460 BinaryExpression expression = ParserTestCase.parseExpression("==", []); |
| 6461 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand); |
| 6462 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic()); |
| 6463 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); |
| 6464 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); |
| 6465 } |
| 6466 void test_equalityExpression_missing_RHS() { |
| 6467 BinaryExpression expression = ParserTestCase.parseExpression("x ==", []); |
| 6468 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); |
| 6469 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); |
| 6470 } |
| 6471 void test_equalityExpression_missing_RHS_super() { |
| 6472 BinaryExpression expression = ParserTestCase.parseExpression("super ==", [])
; |
| 6473 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); |
| 6474 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); |
| 6475 } |
| 6476 void test_equalityExpression_precedence_relational_left() { |
| 6477 BinaryExpression expression = ParserTestCase.parseExpression("is ==", [Parse
rErrorCode.MISSING_IDENTIFIER]); |
| 6478 EngineTestCase.assertInstanceOf(IsExpression, expression.leftOperand); |
| 6479 } |
| 6480 void test_equalityExpression_precedence_relational_right() { |
| 6481 BinaryExpression expression = ParserTestCase.parseExpression("== is", [Parse
rErrorCode.MISSING_IDENTIFIER]); |
| 6482 EngineTestCase.assertInstanceOf(IsExpression, expression.rightOperand); |
| 6483 } |
| 6484 void test_equalityExpression_super() { |
| 6485 BinaryExpression expression = ParserTestCase.parseExpression("super == ==",
[]); |
| 6486 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); |
| 6487 } |
| 6488 void test_expressionList_multiple_end() { |
| 6489 List<Expression> result = ParserTestCase.parse6("parseExpressionList", ", 2,
3, 4", []); |
| 6490 EngineTestCase.assertSize(4, result); |
| 6491 Expression syntheticExpression = result[0]; |
| 6492 EngineTestCase.assertInstanceOf(SimpleIdentifier, syntheticExpression); |
| 6493 JUnitTestCase.assertTrue(syntheticExpression.isSynthetic()); |
| 6494 } |
| 6495 void test_expressionList_multiple_middle() { |
| 6496 List<Expression> result = ParserTestCase.parse6("parseExpressionList", "1, 2
, , 4", []); |
| 6497 EngineTestCase.assertSize(4, result); |
| 6498 Expression syntheticExpression = result[2]; |
| 6499 EngineTestCase.assertInstanceOf(SimpleIdentifier, syntheticExpression); |
| 6500 JUnitTestCase.assertTrue(syntheticExpression.isSynthetic()); |
| 6501 } |
| 6502 void test_expressionList_multiple_start() { |
| 6503 List<Expression> result = ParserTestCase.parse6("parseExpressionList", "1, 2
, 3,", []); |
| 6504 EngineTestCase.assertSize(4, result); |
| 6505 Expression syntheticExpression = result[3]; |
| 6506 EngineTestCase.assertInstanceOf(SimpleIdentifier, syntheticExpression); |
| 6507 JUnitTestCase.assertTrue(syntheticExpression.isSynthetic()); |
| 6508 } |
| 6509 void test_logicalAndExpression_missing_LHS() { |
| 6510 BinaryExpression expression = ParserTestCase.parseExpression("&& y", []); |
| 6511 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand); |
| 6512 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic()); |
| 6513 } |
| 6514 void test_logicalAndExpression_missing_LHS_RHS() { |
| 6515 BinaryExpression expression = ParserTestCase.parseExpression("&&", []); |
| 6516 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand); |
| 6517 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic()); |
| 6518 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); |
| 6519 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); |
| 6520 } |
| 6521 void test_logicalAndExpression_missing_RHS() { |
| 6522 BinaryExpression expression = ParserTestCase.parseExpression("x &&", []); |
| 6523 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); |
| 6524 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); |
| 6525 } |
| 6526 void test_logicalAndExpression_precedence_bitwiseOr_left() { |
| 6527 BinaryExpression expression = ParserTestCase.parseExpression("| &&", []); |
| 6528 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); |
| 6529 } |
| 6530 void test_logicalAndExpression_precedence_bitwiseOr_right() { |
| 6531 BinaryExpression expression = ParserTestCase.parseExpression("&& |", []); |
| 6532 EngineTestCase.assertInstanceOf(BinaryExpression, expression.rightOperand); |
| 6533 } |
| 6534 void test_logicalOrExpression_missing_LHS() { |
| 6535 BinaryExpression expression = ParserTestCase.parseExpression("|| y", []); |
| 6536 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand); |
| 6537 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic()); |
| 6538 } |
| 6539 void test_logicalOrExpression_missing_LHS_RHS() { |
| 6540 BinaryExpression expression = ParserTestCase.parseExpression("||", []); |
| 6541 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand); |
| 6542 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic()); |
| 6543 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); |
| 6544 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); |
| 6545 } |
| 6546 void test_logicalOrExpression_missing_RHS() { |
| 6547 BinaryExpression expression = ParserTestCase.parseExpression("x ||", []); |
| 6548 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); |
| 6549 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); |
| 6550 } |
| 6551 void test_logicalOrExpression_precedence_logicalAnd_left() { |
| 6552 BinaryExpression expression = ParserTestCase.parseExpression("&& ||", []); |
| 6553 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); |
| 6554 } |
| 6555 void test_logicalOrExpression_precedence_logicalAnd_right() { |
| 6556 BinaryExpression expression = ParserTestCase.parseExpression("|| &&", []); |
| 6557 EngineTestCase.assertInstanceOf(BinaryExpression, expression.rightOperand); |
| 6558 } |
| 6559 void test_multiplicativeExpression_missing_LHS() { |
| 6560 BinaryExpression expression = ParserTestCase.parseExpression("* y", []); |
| 6561 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand); |
| 6562 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic()); |
| 6563 } |
| 6564 void test_multiplicativeExpression_missing_LHS_RHS() { |
| 6565 BinaryExpression expression = ParserTestCase.parseExpression("*", []); |
| 6566 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand); |
| 6567 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic()); |
| 6568 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); |
| 6569 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); |
| 6570 } |
| 6571 void test_multiplicativeExpression_missing_RHS() { |
| 6572 BinaryExpression expression = ParserTestCase.parseExpression("x *", []); |
| 6573 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); |
| 6574 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); |
| 6575 } |
| 6576 void test_multiplicativeExpression_missing_RHS_super() { |
| 6577 BinaryExpression expression = ParserTestCase.parseExpression("super *", []); |
| 6578 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); |
| 6579 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); |
| 6580 } |
| 6581 void test_multiplicativeExpression_precedence_unary_left() { |
| 6582 BinaryExpression expression = ParserTestCase.parseExpression("-x *", []); |
| 6583 EngineTestCase.assertInstanceOf(PrefixExpression, expression.leftOperand); |
| 6584 } |
| 6585 void test_multiplicativeExpression_precedence_unary_right() { |
| 6586 BinaryExpression expression = ParserTestCase.parseExpression("* -y", []); |
| 6587 EngineTestCase.assertInstanceOf(PrefixExpression, expression.rightOperand); |
| 6588 } |
| 6589 void test_multiplicativeExpression_super() { |
| 6590 BinaryExpression expression = ParserTestCase.parseExpression("super == ==",
[]); |
| 6591 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); |
| 6592 } |
| 6593 void test_prefixExpression_missing_operand_minus() { |
| 6594 PrefixExpression expression = ParserTestCase.parseExpression("-", []); |
| 6595 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.operand); |
| 6596 JUnitTestCase.assertTrue(expression.operand.isSynthetic()); |
| 6597 JUnitTestCase.assertEquals(TokenType.MINUS, expression.operator.type); |
| 6598 } |
| 6599 void test_relationalExpression_missing_LHS() { |
| 6600 IsExpression expression = ParserTestCase.parseExpression("is y", []); |
| 6601 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.expression); |
| 6602 JUnitTestCase.assertTrue(expression.expression.isSynthetic()); |
| 6603 } |
| 6604 void test_relationalExpression_missing_LHS_RHS() { |
| 6605 IsExpression expression = ParserTestCase.parseExpression("is", [ParserErrorC
ode.MISSING_IDENTIFIER]); |
| 6606 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.expression); |
| 6607 JUnitTestCase.assertTrue(expression.expression.isSynthetic()); |
| 6608 EngineTestCase.assertInstanceOf(TypeName, expression.type); |
| 6609 JUnitTestCase.assertTrue(expression.type.isSynthetic()); |
| 6610 } |
| 6611 void test_relationalExpression_missing_RHS() { |
| 6612 IsExpression expression = ParserTestCase.parseExpression("x is", [ParserErro
rCode.MISSING_IDENTIFIER]); |
| 6613 EngineTestCase.assertInstanceOf(TypeName, expression.type); |
| 6614 JUnitTestCase.assertTrue(expression.type.isSynthetic()); |
| 6615 } |
| 6616 void test_relationalExpression_precedence_shift_right() { |
| 6617 IsExpression expression = ParserTestCase.parseExpression("<< is", [ParserErr
orCode.MISSING_IDENTIFIER]); |
| 6618 EngineTestCase.assertInstanceOf(BinaryExpression, expression.expression); |
| 6619 } |
| 6620 void test_shiftExpression_missing_LHS() { |
| 6621 BinaryExpression expression = ParserTestCase.parseExpression("<< y", []); |
| 6622 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand); |
| 6623 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic()); |
| 6624 } |
| 6625 void test_shiftExpression_missing_LHS_RHS() { |
| 6626 BinaryExpression expression = ParserTestCase.parseExpression("<<", []); |
| 6627 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand); |
| 6628 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic()); |
| 6629 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); |
| 6630 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); |
| 6631 } |
| 6632 void test_shiftExpression_missing_RHS() { |
| 6633 BinaryExpression expression = ParserTestCase.parseExpression("x <<", []); |
| 6634 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); |
| 6635 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); |
| 6636 } |
| 6637 void test_shiftExpression_missing_RHS_super() { |
| 6638 BinaryExpression expression = ParserTestCase.parseExpression("super <<", [])
; |
| 6639 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); |
| 6640 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); |
| 6641 } |
| 6642 void test_shiftExpression_precedence_unary_left() { |
| 6643 BinaryExpression expression = ParserTestCase.parseExpression("+ <<", [Parser
ErrorCode.USE_OF_UNARY_PLUS_OPERATOR]); |
| 6644 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); |
| 6645 } |
| 6646 void test_shiftExpression_precedence_unary_right() { |
| 6647 BinaryExpression expression = ParserTestCase.parseExpression("<< +", [Parser
ErrorCode.USE_OF_UNARY_PLUS_OPERATOR]); |
| 6648 EngineTestCase.assertInstanceOf(BinaryExpression, expression.rightOperand); |
| 6649 } |
| 6650 void test_shiftExpression_super() { |
| 6651 BinaryExpression expression = ParserTestCase.parseExpression("super << <<",
[]); |
| 6652 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); |
| 6653 } |
| 6654 void test_topLevelExternalFunction_extraSemicolon() { |
| 6655 CompilationUnit unit = ParserTestCase.parseCompilationUnit("external void f(
A a);", [ParserErrorCode.UNEXPECTED_TOKEN]); |
| 6656 NodeList<CompilationUnitMember> declarations3 = unit.declarations; |
| 6657 EngineTestCase.assertSize(1, declarations3); |
| 6658 FunctionDeclaration declaration = declarations3[0] as FunctionDeclaration; |
| 6659 JUnitTestCase.assertNotNull(declaration); |
| 6660 } |
| 6661 void test_typedef_eof() { |
| 6662 CompilationUnit unit = ParserTestCase.parseCompilationUnit("typedef n", [Par
serErrorCode.EXPECTED_TOKEN, ParserErrorCode.MISSING_TYPEDEF_PARAMETERS]); |
| 6663 NodeList<CompilationUnitMember> declarations4 = unit.declarations; |
| 6664 EngineTestCase.assertSize(1, declarations4); |
| 6665 CompilationUnitMember member = declarations4[0]; |
| 6666 EngineTestCase.assertInstanceOf(FunctionTypeAlias, member); |
| 6667 } |
| 6668 static dartSuite() { |
| 6669 _ut.group('RecoveryParserTest', () { |
| 6670 _ut.test('test_additiveExpression_missing_LHS', () { |
| 6671 final __test = new RecoveryParserTest(); |
| 6672 runJUnitTest(__test, __test.test_additiveExpression_missing_LHS); |
| 6673 }); |
| 6674 _ut.test('test_additiveExpression_missing_LHS_RHS', () { |
| 6675 final __test = new RecoveryParserTest(); |
| 6676 runJUnitTest(__test, __test.test_additiveExpression_missing_LHS_RHS); |
| 6677 }); |
| 6678 _ut.test('test_additiveExpression_missing_RHS', () { |
| 6679 final __test = new RecoveryParserTest(); |
| 6680 runJUnitTest(__test, __test.test_additiveExpression_missing_RHS); |
| 6681 }); |
| 6682 _ut.test('test_additiveExpression_missing_RHS_super', () { |
| 6683 final __test = new RecoveryParserTest(); |
| 6684 runJUnitTest(__test, __test.test_additiveExpression_missing_RHS_super); |
| 6685 }); |
| 6686 _ut.test('test_additiveExpression_precedence_multiplicative_left', () { |
| 6687 final __test = new RecoveryParserTest(); |
| 6688 runJUnitTest(__test, __test.test_additiveExpression_precedence_multiplic
ative_left); |
| 6689 }); |
| 6690 _ut.test('test_additiveExpression_precedence_multiplicative_right', () { |
| 6691 final __test = new RecoveryParserTest(); |
| 6692 runJUnitTest(__test, __test.test_additiveExpression_precedence_multiplic
ative_right); |
| 6693 }); |
| 6694 _ut.test('test_additiveExpression_super', () { |
| 6695 final __test = new RecoveryParserTest(); |
| 6696 runJUnitTest(__test, __test.test_additiveExpression_super); |
| 6697 }); |
| 6698 _ut.test('test_argumentDefinitionTest_missing_identifier', () { |
| 6699 final __test = new RecoveryParserTest(); |
| 6700 runJUnitTest(__test, __test.test_argumentDefinitionTest_missing_identifi
er); |
| 6701 }); |
| 6702 _ut.test('test_assignmentExpression_missing_LHS', () { |
| 6703 final __test = new RecoveryParserTest(); |
| 6704 runJUnitTest(__test, __test.test_assignmentExpression_missing_LHS); |
| 6705 }); |
| 6706 _ut.test('test_assignmentExpression_missing_RHS', () { |
| 6707 final __test = new RecoveryParserTest(); |
| 6708 runJUnitTest(__test, __test.test_assignmentExpression_missing_RHS); |
| 6709 }); |
| 6710 _ut.test('test_assignmentExpression_missing_compound1', () { |
| 6711 final __test = new RecoveryParserTest(); |
| 6712 runJUnitTest(__test, __test.test_assignmentExpression_missing_compound1)
; |
| 6713 }); |
| 6714 _ut.test('test_assignmentExpression_missing_compound2', () { |
| 6715 final __test = new RecoveryParserTest(); |
| 6716 runJUnitTest(__test, __test.test_assignmentExpression_missing_compound2)
; |
| 6717 }); |
| 6718 _ut.test('test_assignmentExpression_missing_compound3', () { |
| 6719 final __test = new RecoveryParserTest(); |
| 6720 runJUnitTest(__test, __test.test_assignmentExpression_missing_compound3)
; |
| 6721 }); |
| 6722 _ut.test('test_bitwiseAndExpression_missing_LHS', () { |
| 6723 final __test = new RecoveryParserTest(); |
| 6724 runJUnitTest(__test, __test.test_bitwiseAndExpression_missing_LHS); |
| 6725 }); |
| 6726 _ut.test('test_bitwiseAndExpression_missing_LHS_RHS', () { |
| 6727 final __test = new RecoveryParserTest(); |
| 6728 runJUnitTest(__test, __test.test_bitwiseAndExpression_missing_LHS_RHS); |
| 6729 }); |
| 6730 _ut.test('test_bitwiseAndExpression_missing_RHS', () { |
| 6731 final __test = new RecoveryParserTest(); |
| 6732 runJUnitTest(__test, __test.test_bitwiseAndExpression_missing_RHS); |
| 6733 }); |
| 6734 _ut.test('test_bitwiseAndExpression_missing_RHS_super', () { |
| 6735 final __test = new RecoveryParserTest(); |
| 6736 runJUnitTest(__test, __test.test_bitwiseAndExpression_missing_RHS_super)
; |
| 6737 }); |
| 6738 _ut.test('test_bitwiseAndExpression_precedence_equality_left', () { |
| 6739 final __test = new RecoveryParserTest(); |
| 6740 runJUnitTest(__test, __test.test_bitwiseAndExpression_precedence_equalit
y_left); |
| 6741 }); |
| 6742 _ut.test('test_bitwiseAndExpression_precedence_equality_right', () { |
| 6743 final __test = new RecoveryParserTest(); |
| 6744 runJUnitTest(__test, __test.test_bitwiseAndExpression_precedence_equalit
y_right); |
| 6745 }); |
| 6746 _ut.test('test_bitwiseAndExpression_super', () { |
| 6747 final __test = new RecoveryParserTest(); |
| 6748 runJUnitTest(__test, __test.test_bitwiseAndExpression_super); |
| 6749 }); |
| 6750 _ut.test('test_bitwiseOrExpression_missing_LHS', () { |
| 6751 final __test = new RecoveryParserTest(); |
| 6752 runJUnitTest(__test, __test.test_bitwiseOrExpression_missing_LHS); |
| 6753 }); |
| 6754 _ut.test('test_bitwiseOrExpression_missing_LHS_RHS', () { |
| 6755 final __test = new RecoveryParserTest(); |
| 6756 runJUnitTest(__test, __test.test_bitwiseOrExpression_missing_LHS_RHS); |
| 6757 }); |
| 6758 _ut.test('test_bitwiseOrExpression_missing_RHS', () { |
| 6759 final __test = new RecoveryParserTest(); |
| 6760 runJUnitTest(__test, __test.test_bitwiseOrExpression_missing_RHS); |
| 6761 }); |
| 6762 _ut.test('test_bitwiseOrExpression_missing_RHS_super', () { |
| 6763 final __test = new RecoveryParserTest(); |
| 6764 runJUnitTest(__test, __test.test_bitwiseOrExpression_missing_RHS_super); |
| 6765 }); |
| 6766 _ut.test('test_bitwiseOrExpression_precedence_xor_left', () { |
| 6767 final __test = new RecoveryParserTest(); |
| 6768 runJUnitTest(__test, __test.test_bitwiseOrExpression_precedence_xor_left
); |
| 6769 }); |
| 6770 _ut.test('test_bitwiseOrExpression_precedence_xor_right', () { |
| 6771 final __test = new RecoveryParserTest(); |
| 6772 runJUnitTest(__test, __test.test_bitwiseOrExpression_precedence_xor_righ
t); |
| 6773 }); |
| 6774 _ut.test('test_bitwiseOrExpression_super', () { |
| 6775 final __test = new RecoveryParserTest(); |
| 6776 runJUnitTest(__test, __test.test_bitwiseOrExpression_super); |
| 6777 }); |
| 6778 _ut.test('test_bitwiseXorExpression_missing_LHS', () { |
| 6779 final __test = new RecoveryParserTest(); |
| 6780 runJUnitTest(__test, __test.test_bitwiseXorExpression_missing_LHS); |
| 6781 }); |
| 6782 _ut.test('test_bitwiseXorExpression_missing_LHS_RHS', () { |
| 6783 final __test = new RecoveryParserTest(); |
| 6784 runJUnitTest(__test, __test.test_bitwiseXorExpression_missing_LHS_RHS); |
| 6785 }); |
| 6786 _ut.test('test_bitwiseXorExpression_missing_RHS', () { |
| 6787 final __test = new RecoveryParserTest(); |
| 6788 runJUnitTest(__test, __test.test_bitwiseXorExpression_missing_RHS); |
| 6789 }); |
| 6790 _ut.test('test_bitwiseXorExpression_missing_RHS_super', () { |
| 6791 final __test = new RecoveryParserTest(); |
| 6792 runJUnitTest(__test, __test.test_bitwiseXorExpression_missing_RHS_super)
; |
| 6793 }); |
| 6794 _ut.test('test_bitwiseXorExpression_precedence_and_left', () { |
| 6795 final __test = new RecoveryParserTest(); |
| 6796 runJUnitTest(__test, __test.test_bitwiseXorExpression_precedence_and_lef
t); |
| 6797 }); |
| 6798 _ut.test('test_bitwiseXorExpression_precedence_and_right', () { |
| 6799 final __test = new RecoveryParserTest(); |
| 6800 runJUnitTest(__test, __test.test_bitwiseXorExpression_precedence_and_rig
ht); |
| 6801 }); |
| 6802 _ut.test('test_bitwiseXorExpression_super', () { |
| 6803 final __test = new RecoveryParserTest(); |
| 6804 runJUnitTest(__test, __test.test_bitwiseXorExpression_super); |
| 6805 }); |
| 6806 _ut.test('test_conditionalExpression_missingElse', () { |
| 6807 final __test = new RecoveryParserTest(); |
| 6808 runJUnitTest(__test, __test.test_conditionalExpression_missingElse); |
| 6809 }); |
| 6810 _ut.test('test_conditionalExpression_missingThen', () { |
| 6811 final __test = new RecoveryParserTest(); |
| 6812 runJUnitTest(__test, __test.test_conditionalExpression_missingThen); |
| 6813 }); |
| 6814 _ut.test('test_equalityExpression_missing_LHS', () { |
| 6815 final __test = new RecoveryParserTest(); |
| 6816 runJUnitTest(__test, __test.test_equalityExpression_missing_LHS); |
| 6817 }); |
| 6818 _ut.test('test_equalityExpression_missing_LHS_RHS', () { |
| 6819 final __test = new RecoveryParserTest(); |
| 6820 runJUnitTest(__test, __test.test_equalityExpression_missing_LHS_RHS); |
| 6821 }); |
| 6822 _ut.test('test_equalityExpression_missing_RHS', () { |
| 6823 final __test = new RecoveryParserTest(); |
| 6824 runJUnitTest(__test, __test.test_equalityExpression_missing_RHS); |
| 6825 }); |
| 6826 _ut.test('test_equalityExpression_missing_RHS_super', () { |
| 6827 final __test = new RecoveryParserTest(); |
| 6828 runJUnitTest(__test, __test.test_equalityExpression_missing_RHS_super); |
| 6829 }); |
| 6830 _ut.test('test_equalityExpression_precedence_relational_left', () { |
| 6831 final __test = new RecoveryParserTest(); |
| 6832 runJUnitTest(__test, __test.test_equalityExpression_precedence_relationa
l_left); |
| 6833 }); |
| 6834 _ut.test('test_equalityExpression_precedence_relational_right', () { |
| 6835 final __test = new RecoveryParserTest(); |
| 6836 runJUnitTest(__test, __test.test_equalityExpression_precedence_relationa
l_right); |
| 6837 }); |
| 6838 _ut.test('test_equalityExpression_super', () { |
| 6839 final __test = new RecoveryParserTest(); |
| 6840 runJUnitTest(__test, __test.test_equalityExpression_super); |
| 6841 }); |
| 6842 _ut.test('test_expressionList_multiple_end', () { |
| 6843 final __test = new RecoveryParserTest(); |
| 6844 runJUnitTest(__test, __test.test_expressionList_multiple_end); |
| 6845 }); |
| 6846 _ut.test('test_expressionList_multiple_middle', () { |
| 6847 final __test = new RecoveryParserTest(); |
| 6848 runJUnitTest(__test, __test.test_expressionList_multiple_middle); |
| 6849 }); |
| 6850 _ut.test('test_expressionList_multiple_start', () { |
| 6851 final __test = new RecoveryParserTest(); |
| 6852 runJUnitTest(__test, __test.test_expressionList_multiple_start); |
| 6853 }); |
| 6854 _ut.test('test_logicalAndExpression_missing_LHS', () { |
| 6855 final __test = new RecoveryParserTest(); |
| 6856 runJUnitTest(__test, __test.test_logicalAndExpression_missing_LHS); |
| 6857 }); |
| 6858 _ut.test('test_logicalAndExpression_missing_LHS_RHS', () { |
| 6859 final __test = new RecoveryParserTest(); |
| 6860 runJUnitTest(__test, __test.test_logicalAndExpression_missing_LHS_RHS); |
| 6861 }); |
| 6862 _ut.test('test_logicalAndExpression_missing_RHS', () { |
| 6863 final __test = new RecoveryParserTest(); |
| 6864 runJUnitTest(__test, __test.test_logicalAndExpression_missing_RHS); |
| 6865 }); |
| 6866 _ut.test('test_logicalAndExpression_precedence_bitwiseOr_left', () { |
| 6867 final __test = new RecoveryParserTest(); |
| 6868 runJUnitTest(__test, __test.test_logicalAndExpression_precedence_bitwise
Or_left); |
| 6869 }); |
| 6870 _ut.test('test_logicalAndExpression_precedence_bitwiseOr_right', () { |
| 6871 final __test = new RecoveryParserTest(); |
| 6872 runJUnitTest(__test, __test.test_logicalAndExpression_precedence_bitwise
Or_right); |
| 6873 }); |
| 6874 _ut.test('test_logicalOrExpression_missing_LHS', () { |
| 6875 final __test = new RecoveryParserTest(); |
| 6876 runJUnitTest(__test, __test.test_logicalOrExpression_missing_LHS); |
| 6877 }); |
| 6878 _ut.test('test_logicalOrExpression_missing_LHS_RHS', () { |
| 6879 final __test = new RecoveryParserTest(); |
| 6880 runJUnitTest(__test, __test.test_logicalOrExpression_missing_LHS_RHS); |
| 6881 }); |
| 6882 _ut.test('test_logicalOrExpression_missing_RHS', () { |
| 6883 final __test = new RecoveryParserTest(); |
| 6884 runJUnitTest(__test, __test.test_logicalOrExpression_missing_RHS); |
| 6885 }); |
| 6886 _ut.test('test_logicalOrExpression_precedence_logicalAnd_left', () { |
| 6887 final __test = new RecoveryParserTest(); |
| 6888 runJUnitTest(__test, __test.test_logicalOrExpression_precedence_logicalA
nd_left); |
| 6889 }); |
| 6890 _ut.test('test_logicalOrExpression_precedence_logicalAnd_right', () { |
| 6891 final __test = new RecoveryParserTest(); |
| 6892 runJUnitTest(__test, __test.test_logicalOrExpression_precedence_logicalA
nd_right); |
| 6893 }); |
| 6894 _ut.test('test_multiplicativeExpression_missing_LHS', () { |
| 6895 final __test = new RecoveryParserTest(); |
| 6896 runJUnitTest(__test, __test.test_multiplicativeExpression_missing_LHS); |
| 6897 }); |
| 6898 _ut.test('test_multiplicativeExpression_missing_LHS_RHS', () { |
| 6899 final __test = new RecoveryParserTest(); |
| 6900 runJUnitTest(__test, __test.test_multiplicativeExpression_missing_LHS_RH
S); |
| 6901 }); |
| 6902 _ut.test('test_multiplicativeExpression_missing_RHS', () { |
| 6903 final __test = new RecoveryParserTest(); |
| 6904 runJUnitTest(__test, __test.test_multiplicativeExpression_missing_RHS); |
| 6905 }); |
| 6906 _ut.test('test_multiplicativeExpression_missing_RHS_super', () { |
| 6907 final __test = new RecoveryParserTest(); |
| 6908 runJUnitTest(__test, __test.test_multiplicativeExpression_missing_RHS_su
per); |
| 6909 }); |
| 6910 _ut.test('test_multiplicativeExpression_precedence_unary_left', () { |
| 6911 final __test = new RecoveryParserTest(); |
| 6912 runJUnitTest(__test, __test.test_multiplicativeExpression_precedence_una
ry_left); |
| 6913 }); |
| 6914 _ut.test('test_multiplicativeExpression_precedence_unary_right', () { |
| 6915 final __test = new RecoveryParserTest(); |
| 6916 runJUnitTest(__test, __test.test_multiplicativeExpression_precedence_una
ry_right); |
| 6917 }); |
| 6918 _ut.test('test_multiplicativeExpression_super', () { |
| 6919 final __test = new RecoveryParserTest(); |
| 6920 runJUnitTest(__test, __test.test_multiplicativeExpression_super); |
| 6921 }); |
| 6922 _ut.test('test_prefixExpression_missing_operand_minus', () { |
| 6923 final __test = new RecoveryParserTest(); |
| 6924 runJUnitTest(__test, __test.test_prefixExpression_missing_operand_minus)
; |
| 6925 }); |
| 6926 _ut.test('test_relationalExpression_missing_LHS', () { |
| 6927 final __test = new RecoveryParserTest(); |
| 6928 runJUnitTest(__test, __test.test_relationalExpression_missing_LHS); |
| 6929 }); |
| 6930 _ut.test('test_relationalExpression_missing_LHS_RHS', () { |
| 6931 final __test = new RecoveryParserTest(); |
| 6932 runJUnitTest(__test, __test.test_relationalExpression_missing_LHS_RHS); |
| 6933 }); |
| 6934 _ut.test('test_relationalExpression_missing_RHS', () { |
| 6935 final __test = new RecoveryParserTest(); |
| 6936 runJUnitTest(__test, __test.test_relationalExpression_missing_RHS); |
| 6937 }); |
| 6938 _ut.test('test_relationalExpression_precedence_shift_right', () { |
| 6939 final __test = new RecoveryParserTest(); |
| 6940 runJUnitTest(__test, __test.test_relationalExpression_precedence_shift_r
ight); |
| 6941 }); |
| 6942 _ut.test('test_shiftExpression_missing_LHS', () { |
| 6943 final __test = new RecoveryParserTest(); |
| 6944 runJUnitTest(__test, __test.test_shiftExpression_missing_LHS); |
| 6945 }); |
| 6946 _ut.test('test_shiftExpression_missing_LHS_RHS', () { |
| 6947 final __test = new RecoveryParserTest(); |
| 6948 runJUnitTest(__test, __test.test_shiftExpression_missing_LHS_RHS); |
| 6949 }); |
| 6950 _ut.test('test_shiftExpression_missing_RHS', () { |
| 6951 final __test = new RecoveryParserTest(); |
| 6952 runJUnitTest(__test, __test.test_shiftExpression_missing_RHS); |
| 6953 }); |
| 6954 _ut.test('test_shiftExpression_missing_RHS_super', () { |
| 6955 final __test = new RecoveryParserTest(); |
| 6956 runJUnitTest(__test, __test.test_shiftExpression_missing_RHS_super); |
| 6957 }); |
| 6958 _ut.test('test_shiftExpression_precedence_unary_left', () { |
| 6959 final __test = new RecoveryParserTest(); |
| 6960 runJUnitTest(__test, __test.test_shiftExpression_precedence_unary_left); |
| 6961 }); |
| 6962 _ut.test('test_shiftExpression_precedence_unary_right', () { |
| 6963 final __test = new RecoveryParserTest(); |
| 6964 runJUnitTest(__test, __test.test_shiftExpression_precedence_unary_right)
; |
| 6965 }); |
| 6966 _ut.test('test_shiftExpression_super', () { |
| 6967 final __test = new RecoveryParserTest(); |
| 6968 runJUnitTest(__test, __test.test_shiftExpression_super); |
| 6969 }); |
| 6970 _ut.test('test_topLevelExternalFunction_extraSemicolon', () { |
| 6971 final __test = new RecoveryParserTest(); |
| 6972 runJUnitTest(__test, __test.test_topLevelExternalFunction_extraSemicolon
); |
| 6973 }); |
| 6974 _ut.test('test_typedef_eof', () { |
| 6975 final __test = new RecoveryParserTest(); |
| 6976 runJUnitTest(__test, __test.test_typedef_eof); |
| 6977 }); |
| 6978 }); |
| 6979 } |
| 6980 } |
| 6899 /** | 6981 /** |
| 6900 * The class {@code ErrorParserTest} defines parser tests that test the parsing
of code to ensure | 6982 * The class {@code ErrorParserTest} defines parser tests that test the parsing
of code to ensure |
| 6901 * that errors are correctly reported, and in some cases, not reported. | 6983 * that errors are correctly reported, and in some cases, not reported. |
| 6902 */ | 6984 */ |
| 6903 class ErrorParserTest extends ParserTestCase { | 6985 class ErrorParserTest extends ParserTestCase { |
| 6904 void fail_expectedListOrMapLiteral() { | 6986 void fail_expectedListOrMapLiteral() { |
| 6905 TypedLiteral literal = ParserTestCase.parse4("parseListOrMapLiteral", <Objec
t> [null], "1", [ParserErrorCode.EXPECTED_LIST_OR_MAP_LITERAL]); | 6987 TypedLiteral literal = ParserTestCase.parse5("parseListOrMapLiteral", <Objec
t> [null], "1", [ParserErrorCode.EXPECTED_LIST_OR_MAP_LITERAL]); |
| 6906 JUnitTestCase.assertTrue(literal.isSynthetic()); | 6988 JUnitTestCase.assertTrue(literal.isSynthetic()); |
| 6907 } | 6989 } |
| 6908 void fail_illegalAssignmentToNonAssignable_superAssigned() { | 6990 void fail_illegalAssignmentToNonAssignable_superAssigned() { |
| 6909 ParserTestCase.parse5("parseExpression", "super = x;", [ParserErrorCode.ILLE
GAL_ASSIGNMENT_TO_NON_ASSIGNABLE]); | 6991 ParserTestCase.parse6("parseExpression", "super = x;", [ParserErrorCode.ILLE
GAL_ASSIGNMENT_TO_NON_ASSIGNABLE]); |
| 6910 } | 6992 } |
| 6911 void fail_invalidCommentReference__new_nonIdentifier() { | 6993 void fail_invalidCommentReference__new_nonIdentifier() { |
| 6912 ParserTestCase.parse4("parseCommentReference", <Object> ["new 42", 0], "", [
ParserErrorCode.INVALID_COMMENT_REFERENCE]); | 6994 ParserTestCase.parse5("parseCommentReference", <Object> ["new 42", 0], "", [
ParserErrorCode.INVALID_COMMENT_REFERENCE]); |
| 6913 } | 6995 } |
| 6914 void fail_invalidCommentReference__new_tooMuch() { | 6996 void fail_invalidCommentReference__new_tooMuch() { |
| 6915 ParserTestCase.parse4("parseCommentReference", <Object> ["new a.b.c.d", 0],
"", [ParserErrorCode.INVALID_COMMENT_REFERENCE]); | 6997 ParserTestCase.parse5("parseCommentReference", <Object> ["new a.b.c.d", 0],
"", [ParserErrorCode.INVALID_COMMENT_REFERENCE]); |
| 6916 } | 6998 } |
| 6917 void fail_invalidCommentReference__nonNew_nonIdentifier() { | 6999 void fail_invalidCommentReference__nonNew_nonIdentifier() { |
| 6918 ParserTestCase.parse4("parseCommentReference", <Object> ["42", 0], "", [Pars
erErrorCode.INVALID_COMMENT_REFERENCE]); | 7000 ParserTestCase.parse5("parseCommentReference", <Object> ["42", 0], "", [Pars
erErrorCode.INVALID_COMMENT_REFERENCE]); |
| 6919 } | 7001 } |
| 6920 void fail_invalidCommentReference__nonNew_tooMuch() { | 7002 void fail_invalidCommentReference__nonNew_tooMuch() { |
| 6921 ParserTestCase.parse4("parseCommentReference", <Object> ["a.b.c.d", 0], "",
[ParserErrorCode.INVALID_COMMENT_REFERENCE]); | 7003 ParserTestCase.parse5("parseCommentReference", <Object> ["a.b.c.d", 0], "",
[ParserErrorCode.INVALID_COMMENT_REFERENCE]); |
| 6922 } | 7004 } |
| 6923 void fail_missingFunctionParameters_local_nonVoid_block() { | 7005 void fail_missingFunctionParameters_local_nonVoid_block() { |
| 6924 ParserTestCase.parse5("parseStatement", "int f { return x;}", [ParserErrorCo
de.MISSING_FUNCTION_PARAMETERS]); | 7006 ParserTestCase.parse6("parseStatement", "int f { return x;}", [ParserErrorCo
de.MISSING_FUNCTION_PARAMETERS]); |
| 6925 } | 7007 } |
| 6926 void fail_missingFunctionParameters_local_nonVoid_expression() { | 7008 void fail_missingFunctionParameters_local_nonVoid_expression() { |
| 6927 ParserTestCase.parse5("parseStatement", "int f => x;", [ParserErrorCode.MISS
ING_FUNCTION_PARAMETERS]); | 7009 ParserTestCase.parse6("parseStatement", "int f => x;", [ParserErrorCode.MISS
ING_FUNCTION_PARAMETERS]); |
| 6928 } | 7010 } |
| 6929 void fail_unexpectedToken_invalidPostfixExpression() { | 7011 void fail_unexpectedToken_invalidPostfixExpression() { |
| 6930 ParserTestCase.parse5("parseExpression", "f()++", [ParserErrorCode.UNEXPECTE
D_TOKEN]); | 7012 ParserTestCase.parse6("parseExpression", "f()++", [ParserErrorCode.UNEXPECTE
D_TOKEN]); |
| 6931 } | 7013 } |
| 6932 void fail_voidVariable_initializer() { | 7014 void fail_voidVariable_initializer() { |
| 6933 ParserTestCase.parse5("parseStatement", "void x = 0;", [ParserErrorCode.VOID
_VARIABLE]); | 7015 ParserTestCase.parse6("parseStatement", "void x = 0;", [ParserErrorCode.VOID
_VARIABLE]); |
| 6934 } | 7016 } |
| 6935 void fail_voidVariable_noInitializer() { | 7017 void fail_voidVariable_noInitializer() { |
| 6936 ParserTestCase.parse5("parseStatement", "void x;", [ParserErrorCode.VOID_VAR
IABLE]); | 7018 ParserTestCase.parse6("parseStatement", "void x;", [ParserErrorCode.VOID_VAR
IABLE]); |
| 6937 } | 7019 } |
| 6938 void test_abstractClassMember_constructor() { | 7020 void test_abstractClassMember_constructor() { |
| 6939 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "abstract C.c();",
[ParserErrorCode.ABSTRACT_CLASS_MEMBER]); | 7021 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "abstract C.c();",
[ParserErrorCode.ABSTRACT_CLASS_MEMBER]); |
| 6940 } | 7022 } |
| 6941 void test_abstractClassMember_field() { | 7023 void test_abstractClassMember_field() { |
| 6942 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "abstract C f;", [
ParserErrorCode.ABSTRACT_CLASS_MEMBER]); | 7024 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "abstract C f;", [
ParserErrorCode.ABSTRACT_CLASS_MEMBER]); |
| 6943 } | 7025 } |
| 6944 void test_abstractClassMember_getter() { | 7026 void test_abstractClassMember_getter() { |
| 6945 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "abstract get m;",
[ParserErrorCode.ABSTRACT_CLASS_MEMBER]); | 7027 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "abstract get m;",
[ParserErrorCode.ABSTRACT_CLASS_MEMBER]); |
| 6946 } | 7028 } |
| 6947 void test_abstractClassMember_method() { | 7029 void test_abstractClassMember_method() { |
| 6948 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "abstract m();", [
ParserErrorCode.ABSTRACT_CLASS_MEMBER]); | 7030 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "abstract m();", [
ParserErrorCode.ABSTRACT_CLASS_MEMBER]); |
| 6949 } | 7031 } |
| 6950 void test_abstractClassMember_setter() { | 7032 void test_abstractClassMember_setter() { |
| 6951 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "abstract set m(v)
;", [ParserErrorCode.ABSTRACT_CLASS_MEMBER]); | 7033 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "abstract set m(v)
;", [ParserErrorCode.ABSTRACT_CLASS_MEMBER]); |
| 6952 } | 7034 } |
| 6953 void test_abstractTopLevelFunction_function() { | 7035 void test_abstractTopLevelFunction_function() { |
| 6954 ParserTestCase.parse5("parseCompilationUnit", "abstract f(v) {}", [ParserErr
orCode.ABSTRACT_TOP_LEVEL_FUNCTION]); | 7036 ParserTestCase.parse6("parseCompilationUnit", "abstract f(v) {}", [ParserErr
orCode.ABSTRACT_TOP_LEVEL_FUNCTION]); |
| 6955 } | 7037 } |
| 6956 void test_abstractTopLevelFunction_getter() { | 7038 void test_abstractTopLevelFunction_getter() { |
| 6957 ParserTestCase.parse5("parseCompilationUnit", "abstract get m {}", [ParserEr
rorCode.ABSTRACT_TOP_LEVEL_FUNCTION]); | 7039 ParserTestCase.parse6("parseCompilationUnit", "abstract get m {}", [ParserEr
rorCode.ABSTRACT_TOP_LEVEL_FUNCTION]); |
| 6958 } | 7040 } |
| 6959 void test_abstractTopLevelFunction_setter() { | 7041 void test_abstractTopLevelFunction_setter() { |
| 6960 ParserTestCase.parse5("parseCompilationUnit", "abstract set m(v) {}", [Parse
rErrorCode.ABSTRACT_TOP_LEVEL_FUNCTION]); | 7042 ParserTestCase.parse6("parseCompilationUnit", "abstract set m(v) {}", [Parse
rErrorCode.ABSTRACT_TOP_LEVEL_FUNCTION]); |
| 6961 } | 7043 } |
| 6962 void test_abstractTopLevelVariable() { | 7044 void test_abstractTopLevelVariable() { |
| 6963 ParserTestCase.parse5("parseCompilationUnit", "abstract C f;", [ParserErrorC
ode.ABSTRACT_TOP_LEVEL_VARIABLE]); | 7045 ParserTestCase.parse6("parseCompilationUnit", "abstract C f;", [ParserErrorC
ode.ABSTRACT_TOP_LEVEL_VARIABLE]); |
| 6964 } | 7046 } |
| 6965 void test_abstractTypeDef() { | 7047 void test_abstractTypeDef() { |
| 6966 ParserTestCase.parse5("parseCompilationUnit", "abstract typedef F();", [Pars
erErrorCode.ABSTRACT_TYPEDEF]); | 7048 ParserTestCase.parse6("parseCompilationUnit", "abstract typedef F();", [Pars
erErrorCode.ABSTRACT_TYPEDEF]); |
| 6967 } | 7049 } |
| 6968 void test_breakOutsideOfLoop_breakInDoStatement() { | 7050 void test_breakOutsideOfLoop_breakInDoStatement() { |
| 6969 ParserTestCase.parse5("parseDoStatement", "do {break;} while (x);", []); | 7051 ParserTestCase.parse6("parseDoStatement", "do {break;} while (x);", []); |
| 6970 } | 7052 } |
| 6971 void test_breakOutsideOfLoop_breakInForStatement() { | 7053 void test_breakOutsideOfLoop_breakInForStatement() { |
| 6972 ParserTestCase.parse5("parseForStatement", "for (; x;) {break;}", []); | 7054 ParserTestCase.parse6("parseForStatement", "for (; x;) {break;}", []); |
| 6973 } | 7055 } |
| 6974 void test_breakOutsideOfLoop_breakInIfStatement() { | 7056 void test_breakOutsideOfLoop_breakInIfStatement() { |
| 6975 ParserTestCase.parse5("parseIfStatement", "if (x) {break;}", [ParserErrorCod
e.BREAK_OUTSIDE_OF_LOOP]); | 7057 ParserTestCase.parse6("parseIfStatement", "if (x) {break;}", [ParserErrorCod
e.BREAK_OUTSIDE_OF_LOOP]); |
| 6976 } | 7058 } |
| 6977 void test_breakOutsideOfLoop_breakInSwitchStatement() { | 7059 void test_breakOutsideOfLoop_breakInSwitchStatement() { |
| 6978 ParserTestCase.parse5("parseSwitchStatement", "switch (x) {case 1: break;}",
[]); | 7060 ParserTestCase.parse6("parseSwitchStatement", "switch (x) {case 1: break;}",
[]); |
| 6979 } | 7061 } |
| 6980 void test_breakOutsideOfLoop_breakInWhileStatement() { | 7062 void test_breakOutsideOfLoop_breakInWhileStatement() { |
| 6981 ParserTestCase.parse5("parseWhileStatement", "while (x) {break;}", []); | 7063 ParserTestCase.parse6("parseWhileStatement", "while (x) {break;}", []); |
| 6982 } | 7064 } |
| 6983 void test_breakOutsideOfLoop_functionExpression_inALoop() { | 7065 void test_breakOutsideOfLoop_functionExpression_inALoop() { |
| 6984 ParserTestCase.parse5("parseStatement", "for(; x;) {() {break;};}", [ParserE
rrorCode.BREAK_OUTSIDE_OF_LOOP]); | 7066 ParserTestCase.parse6("parseStatement", "for(; x;) {() {break;};}", [ParserE
rrorCode.BREAK_OUTSIDE_OF_LOOP]); |
| 6985 } | 7067 } |
| 6986 void test_breakOutsideOfLoop_functionExpression_withALoop() { | 7068 void test_breakOutsideOfLoop_functionExpression_withALoop() { |
| 6987 ParserTestCase.parse5("parseStatement", "() {for (; x;) {break;}};", []); | 7069 ParserTestCase.parse6("parseStatement", "() {for (; x;) {break;}};", []); |
| 6988 } | 7070 } |
| 6989 void test_builtInIdentifierAsTypeDefName() { | 7071 void test_builtInIdentifierAsTypeDefName() { |
| 6990 ParserTestCase.parse4("parseTypeAlias", <Object> [emptyCommentAndMetadata()]
, "typedef as();", [ParserErrorCode.BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME]); | 7072 ParserTestCase.parse5("parseTypeAlias", <Object> [emptyCommentAndMetadata()]
, "typedef as();", [ParserErrorCode.BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME]); |
| 6991 } | 7073 } |
| 6992 void test_builtInIdentifierAsTypeName() { | 7074 void test_builtInIdentifierAsTypeName() { |
| 6993 ParserTestCase.parse4("parseClassDeclaration", <Object> [emptyCommentAndMeta
data(), null], "class as {}", [ParserErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE_NAME]
); | 7075 ParserTestCase.parse5("parseClassDeclaration", <Object> [emptyCommentAndMeta
data(), null], "class as {}", [ParserErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE_NAME]
); |
| 6994 } | 7076 } |
| 6995 void test_builtInIdentifierAsTypeVariableName() { | 7077 void test_builtInIdentifierAsTypeVariableName() { |
| 6996 ParserTestCase.parse5("parseTypeParameter", "as", [ParserErrorCode.BUILT_IN_
IDENTIFIER_AS_TYPE_VARIABLE_NAME]); | 7078 ParserTestCase.parse6("parseTypeParameter", "as", [ParserErrorCode.BUILT_IN_
IDENTIFIER_AS_TYPE_VARIABLE_NAME]); |
| 6997 } | 7079 } |
| 6998 void test_constAndFinal() { | 7080 void test_constAndFinal() { |
| 6999 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "const final int x
;", [ParserErrorCode.CONST_AND_FINAL]); | 7081 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "const final int x
;", [ParserErrorCode.CONST_AND_FINAL]); |
| 7000 } | 7082 } |
| 7001 void test_constAndVar() { | 7083 void test_constAndVar() { |
| 7002 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "const var x;", [P
arserErrorCode.CONST_AND_VAR]); | 7084 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "const var x;", [P
arserErrorCode.CONST_AND_VAR]); |
| 7003 } | 7085 } |
| 7004 void test_constClass() { | 7086 void test_constClass() { |
| 7005 ParserTestCase.parse5("parseCompilationUnit", "const class C {}", [ParserErr
orCode.CONST_CLASS]); | 7087 ParserTestCase.parse6("parseCompilationUnit", "const class C {}", [ParserErr
orCode.CONST_CLASS]); |
| 7006 } | 7088 } |
| 7007 void test_constMethod() { | 7089 void test_constMethod() { |
| 7008 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "const int m() {}"
, [ParserErrorCode.CONST_METHOD]); | 7090 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "const int m() {}"
, [ParserErrorCode.CONST_METHOD]); |
| 7009 } | 7091 } |
| 7010 void test_constTypedef() { | 7092 void test_constTypedef() { |
| 7011 ParserTestCase.parse5("parseCompilationUnit", "const typedef F();", [ParserE
rrorCode.CONST_TYPEDEF]); | 7093 ParserTestCase.parse6("parseCompilationUnit", "const typedef F();", [ParserE
rrorCode.CONST_TYPEDEF]); |
| 7012 } | 7094 } |
| 7013 void test_continueOutsideOfLoop_continueInDoStatement() { | 7095 void test_continueOutsideOfLoop_continueInDoStatement() { |
| 7014 ParserTestCase.parse5("parseDoStatement", "do {continue;} while (x);", []); | 7096 ParserTestCase.parse6("parseDoStatement", "do {continue;} while (x);", []); |
| 7015 } | 7097 } |
| 7016 void test_continueOutsideOfLoop_continueInForStatement() { | 7098 void test_continueOutsideOfLoop_continueInForStatement() { |
| 7017 ParserTestCase.parse5("parseForStatement", "for (; x;) {continue;}", []); | 7099 ParserTestCase.parse6("parseForStatement", "for (; x;) {continue;}", []); |
| 7018 } | 7100 } |
| 7019 void test_continueOutsideOfLoop_continueInIfStatement() { | 7101 void test_continueOutsideOfLoop_continueInIfStatement() { |
| 7020 ParserTestCase.parse5("parseIfStatement", "if (x) {continue;}", [ParserError
Code.CONTINUE_OUTSIDE_OF_LOOP]); | 7102 ParserTestCase.parse6("parseIfStatement", "if (x) {continue;}", [ParserError
Code.CONTINUE_OUTSIDE_OF_LOOP]); |
| 7021 } | 7103 } |
| 7022 void test_continueOutsideOfLoop_continueInSwitchStatement() { | 7104 void test_continueOutsideOfLoop_continueInSwitchStatement() { |
| 7023 ParserTestCase.parse5("parseSwitchStatement", "switch (x) {case 1: continue
a;}", []); | 7105 ParserTestCase.parse6("parseSwitchStatement", "switch (x) {case 1: continue
a;}", []); |
| 7024 } | 7106 } |
| 7025 void test_continueOutsideOfLoop_continueInWhileStatement() { | 7107 void test_continueOutsideOfLoop_continueInWhileStatement() { |
| 7026 ParserTestCase.parse5("parseWhileStatement", "while (x) {continue;}", []); | 7108 ParserTestCase.parse6("parseWhileStatement", "while (x) {continue;}", []); |
| 7027 } | 7109 } |
| 7028 void test_continueOutsideOfLoop_functionExpression_inALoop() { | 7110 void test_continueOutsideOfLoop_functionExpression_inALoop() { |
| 7029 ParserTestCase.parse5("parseStatement", "for(; x;) {() {continue;};}", [Pars
erErrorCode.CONTINUE_OUTSIDE_OF_LOOP]); | 7111 ParserTestCase.parse6("parseStatement", "for(; x;) {() {continue;};}", [Pars
erErrorCode.CONTINUE_OUTSIDE_OF_LOOP]); |
| 7030 } | 7112 } |
| 7031 void test_continueOutsideOfLoop_functionExpression_withALoop() { | 7113 void test_continueOutsideOfLoop_functionExpression_withALoop() { |
| 7032 ParserTestCase.parse5("parseStatement", "() {for (; x;) {continue;}};", []); | 7114 ParserTestCase.parse6("parseStatement", "() {for (; x;) {continue;}};", []); |
| 7033 } | 7115 } |
| 7034 void test_continueWithoutLabelInCase_error() { | 7116 void test_continueWithoutLabelInCase_error() { |
| 7035 ParserTestCase.parse5("parseSwitchStatement", "switch (x) {case 1: continue;
}", [ParserErrorCode.CONTINUE_WITHOUT_LABEL_IN_CASE]); | 7117 ParserTestCase.parse6("parseSwitchStatement", "switch (x) {case 1: continue;
}", [ParserErrorCode.CONTINUE_WITHOUT_LABEL_IN_CASE]); |
| 7036 } | 7118 } |
| 7037 void test_continueWithoutLabelInCase_noError() { | 7119 void test_continueWithoutLabelInCase_noError() { |
| 7038 ParserTestCase.parse5("parseSwitchStatement", "switch (x) {case 1: continue
a;}", []); | 7120 ParserTestCase.parse6("parseSwitchStatement", "switch (x) {case 1: continue
a;}", []); |
| 7039 } | 7121 } |
| 7040 void test_continueWithoutLabelInCase_noError_switchInLoop() { | 7122 void test_continueWithoutLabelInCase_noError_switchInLoop() { |
| 7041 ParserTestCase.parse5("parseWhileStatement", "while (a) { switch (b) {defaul
t: continue;}}", []); | 7123 ParserTestCase.parse6("parseWhileStatement", "while (a) { switch (b) {defaul
t: continue;}}", []); |
| 7042 } | 7124 } |
| 7043 void test_directiveAfterDeclaration_classBeforeDirective() { | 7125 void test_directiveAfterDeclaration_classBeforeDirective() { |
| 7044 CompilationUnit unit = ParserTestCase.parse5("parseCompilationUnit", "class
Foo{} library l;", [ParserErrorCode.DIRECTIVE_AFTER_DECLARATION]); | 7126 CompilationUnit unit = ParserTestCase.parse6("parseCompilationUnit", "class
Foo{} library l;", [ParserErrorCode.DIRECTIVE_AFTER_DECLARATION]); |
| 7045 JUnitTestCase.assertNotNull(unit); | 7127 JUnitTestCase.assertNotNull(unit); |
| 7046 } | 7128 } |
| 7047 void test_directiveAfterDeclaration_classBetweenDirectives() { | 7129 void test_directiveAfterDeclaration_classBetweenDirectives() { |
| 7048 CompilationUnit unit = ParserTestCase.parse5("parseCompilationUnit", "librar
y l;\nclass Foo{}\npart 'a.dart';", [ParserErrorCode.DIRECTIVE_AFTER_DECLARATION
]); | 7130 CompilationUnit unit = ParserTestCase.parse6("parseCompilationUnit", "librar
y l;\nclass Foo{}\npart 'a.dart';", [ParserErrorCode.DIRECTIVE_AFTER_DECLARATION
]); |
| 7049 JUnitTestCase.assertNotNull(unit); | 7131 JUnitTestCase.assertNotNull(unit); |
| 7050 } | 7132 } |
| 7051 void test_duplicatedModifier_const() { | 7133 void test_duplicatedModifier_const() { |
| 7052 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "const const m;",
[ParserErrorCode.DUPLICATED_MODIFIER]); | 7134 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "const const m;",
[ParserErrorCode.DUPLICATED_MODIFIER]); |
| 7053 } | 7135 } |
| 7054 void test_duplicatedModifier_external() { | 7136 void test_duplicatedModifier_external() { |
| 7055 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "external external
f();", [ParserErrorCode.DUPLICATED_MODIFIER]); | 7137 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "external external
f();", [ParserErrorCode.DUPLICATED_MODIFIER]); |
| 7056 } | 7138 } |
| 7057 void test_duplicatedModifier_factory() { | 7139 void test_duplicatedModifier_factory() { |
| 7058 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "factory factory C
() {}", [ParserErrorCode.DUPLICATED_MODIFIER]); | 7140 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "factory factory C
() {}", [ParserErrorCode.DUPLICATED_MODIFIER]); |
| 7059 } | 7141 } |
| 7060 void test_duplicatedModifier_final() { | 7142 void test_duplicatedModifier_final() { |
| 7061 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "final final m;",
[ParserErrorCode.DUPLICATED_MODIFIER]); | 7143 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "final final m;",
[ParserErrorCode.DUPLICATED_MODIFIER]); |
| 7062 } | 7144 } |
| 7063 void test_duplicatedModifier_static() { | 7145 void test_duplicatedModifier_static() { |
| 7064 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "static static m;"
, [ParserErrorCode.DUPLICATED_MODIFIER]); | 7146 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "static static m;"
, [ParserErrorCode.DUPLICATED_MODIFIER]); |
| 7065 } | 7147 } |
| 7066 void test_duplicatedModifier_var() { | 7148 void test_duplicatedModifier_var() { |
| 7067 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "var var m;", [Par
serErrorCode.DUPLICATED_MODIFIER]); | 7149 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "var var m;", [Par
serErrorCode.DUPLICATED_MODIFIER]); |
| 7068 } | 7150 } |
| 7069 void test_duplicateLabelInSwitchStatement() { | 7151 void test_duplicateLabelInSwitchStatement() { |
| 7070 ParserTestCase.parse5("parseSwitchStatement", "switch (e) {l1: case 0: break
; l1: case 1: break;}", [ParserErrorCode.DUPLICATE_LABEL_IN_SWITCH_STATEMENT]); | 7152 ParserTestCase.parse6("parseSwitchStatement", "switch (e) {l1: case 0: break
; l1: case 1: break;}", [ParserErrorCode.DUPLICATE_LABEL_IN_SWITCH_STATEMENT]); |
| 7071 } | 7153 } |
| 7072 void test_expectedCaseOrDefault() { | 7154 void test_expectedCaseOrDefault() { |
| 7073 ParserTestCase.parse5("parseSwitchStatement", "switch (e) {break;}", [Parser
ErrorCode.EXPECTED_CASE_OR_DEFAULT]); | 7155 ParserTestCase.parse6("parseSwitchStatement", "switch (e) {break;}", [Parser
ErrorCode.EXPECTED_CASE_OR_DEFAULT]); |
| 7074 } | 7156 } |
| 7075 void test_expectedStringLiteral() { | 7157 void test_expectedStringLiteral() { |
| 7076 StringLiteral expression = ParserTestCase.parse5("parseStringLiteral", "1",
[ParserErrorCode.EXPECTED_STRING_LITERAL]); | 7158 StringLiteral expression = ParserTestCase.parse6("parseStringLiteral", "1",
[ParserErrorCode.EXPECTED_STRING_LITERAL]); |
| 7077 JUnitTestCase.assertTrue(expression.isSynthetic()); | 7159 JUnitTestCase.assertTrue(expression.isSynthetic()); |
| 7078 } | 7160 } |
| 7079 void test_expectedToken_commaMissingInArgumentList() { | 7161 void test_expectedToken_commaMissingInArgumentList() { |
| 7080 ParserTestCase.parse5("parseArgumentList", "(x, y z)", [ParserErrorCode.EXPE
CTED_TOKEN]); | 7162 ParserTestCase.parse6("parseArgumentList", "(x, y z)", [ParserErrorCode.EXPE
CTED_TOKEN]); |
| 7081 } | 7163 } |
| 7082 void test_expectedToken_semicolonMissingAfterExpression() { | 7164 void test_expectedToken_semicolonMissingAfterExpression() { |
| 7083 ParserTestCase.parse5("parseStatement", "x", [ParserErrorCode.EXPECTED_TOKEN
]); | 7165 ParserTestCase.parse6("parseStatement", "x", [ParserErrorCode.EXPECTED_TOKEN
]); |
| 7084 } | 7166 } |
| 7085 void test_expectedToken_whileMissingInDoStatement() { | 7167 void test_expectedToken_whileMissingInDoStatement() { |
| 7086 ParserTestCase.parse5("parseStatement", "do {} (x);", [ParserErrorCode.EXPEC
TED_TOKEN]); | 7168 ParserTestCase.parse6("parseStatement", "do {} (x);", [ParserErrorCode.EXPEC
TED_TOKEN]); |
| 7087 } | 7169 } |
| 7088 void test_exportDirectiveAfterPartDirective() { | 7170 void test_exportDirectiveAfterPartDirective() { |
| 7089 ParserTestCase.parse5("parseCompilationUnit", "part 'a.dart'; export 'b.dart
';", [ParserErrorCode.EXPORT_DIRECTIVE_AFTER_PART_DIRECTIVE]); | 7171 ParserTestCase.parse6("parseCompilationUnit", "part 'a.dart'; export 'b.dart
';", [ParserErrorCode.EXPORT_DIRECTIVE_AFTER_PART_DIRECTIVE]); |
| 7090 } | 7172 } |
| 7091 void test_externalAfterConst() { | 7173 void test_externalAfterConst() { |
| 7092 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "const external C(
);", [ParserErrorCode.EXTERNAL_AFTER_CONST]); | 7174 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "const external C(
);", [ParserErrorCode.EXTERNAL_AFTER_CONST]); |
| 7093 } | 7175 } |
| 7094 void test_externalAfterFactory() { | 7176 void test_externalAfterFactory() { |
| 7095 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "factory external
C();", [ParserErrorCode.EXTERNAL_AFTER_FACTORY]); | 7177 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "factory external
C();", [ParserErrorCode.EXTERNAL_AFTER_FACTORY]); |
| 7096 } | 7178 } |
| 7097 void test_externalAfterStatic() { | 7179 void test_externalAfterStatic() { |
| 7098 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "static external i
nt m();", [ParserErrorCode.EXTERNAL_AFTER_STATIC]); | 7180 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "static external i
nt m();", [ParserErrorCode.EXTERNAL_AFTER_STATIC]); |
| 7099 } | 7181 } |
| 7100 void test_externalClass() { | 7182 void test_externalClass() { |
| 7101 ParserTestCase.parse5("parseCompilationUnit", "external class C {}", [Parser
ErrorCode.EXTERNAL_CLASS]); | 7183 ParserTestCase.parse6("parseCompilationUnit", "external class C {}", [Parser
ErrorCode.EXTERNAL_CLASS]); |
| 7102 } | 7184 } |
| 7103 void test_externalConstructorWithBody_factory() { | 7185 void test_externalConstructorWithBody_factory() { |
| 7104 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "external factory
C() {}", [ParserErrorCode.EXTERNAL_CONSTRUCTOR_WITH_BODY]); | 7186 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "external factory
C() {}", [ParserErrorCode.EXTERNAL_CONSTRUCTOR_WITH_BODY]); |
| 7105 } | 7187 } |
| 7106 void test_externalConstructorWithBody_named() { | 7188 void test_externalConstructorWithBody_named() { |
| 7107 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "external C.c() {}
", [ParserErrorCode.EXTERNAL_CONSTRUCTOR_WITH_BODY]); | 7189 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "external C.c() {}
", [ParserErrorCode.EXTERNAL_CONSTRUCTOR_WITH_BODY]); |
| 7108 } | 7190 } |
| 7109 void test_externalField_const() { | 7191 void test_externalField_const() { |
| 7110 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "external const A
f;", [ParserErrorCode.EXTERNAL_FIELD]); | 7192 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "external const A
f;", [ParserErrorCode.EXTERNAL_FIELD]); |
| 7111 } | 7193 } |
| 7112 void test_externalField_final() { | 7194 void test_externalField_final() { |
| 7113 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "external final A
f;", [ParserErrorCode.EXTERNAL_FIELD]); | 7195 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "external final A
f;", [ParserErrorCode.EXTERNAL_FIELD]); |
| 7114 } | 7196 } |
| 7115 void test_externalField_static() { | 7197 void test_externalField_static() { |
| 7116 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "external static A
f;", [ParserErrorCode.EXTERNAL_FIELD]); | 7198 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "external static A
f;", [ParserErrorCode.EXTERNAL_FIELD]); |
| 7117 } | 7199 } |
| 7118 void test_externalField_typed() { | 7200 void test_externalField_typed() { |
| 7119 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "external A f;", [
ParserErrorCode.EXTERNAL_FIELD]); | 7201 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "external A f;", [
ParserErrorCode.EXTERNAL_FIELD]); |
| 7120 } | 7202 } |
| 7121 void test_externalField_untyped() { | 7203 void test_externalField_untyped() { |
| 7122 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "external var f;",
[ParserErrorCode.EXTERNAL_FIELD]); | 7204 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "external var f;",
[ParserErrorCode.EXTERNAL_FIELD]); |
| 7123 } | 7205 } |
| 7124 void test_externalGetterWithBody() { | 7206 void test_externalGetterWithBody() { |
| 7125 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "external int get
x {}", [ParserErrorCode.EXTERNAL_GETTER_WITH_BODY]); | 7207 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "external int get
x {}", [ParserErrorCode.EXTERNAL_GETTER_WITH_BODY]); |
| 7126 } | 7208 } |
| 7127 void test_externalMethodWithBody() { | 7209 void test_externalMethodWithBody() { |
| 7128 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "external m() {}",
[ParserErrorCode.EXTERNAL_METHOD_WITH_BODY]); | 7210 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "external m() {}",
[ParserErrorCode.EXTERNAL_METHOD_WITH_BODY]); |
| 7129 } | 7211 } |
| 7130 void test_externalOperatorWithBody() { | 7212 void test_externalOperatorWithBody() { |
| 7131 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "external operator
+(int value) {}", [ParserErrorCode.EXTERNAL_OPERATOR_WITH_BODY]); | 7213 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "external operator
+(int value) {}", [ParserErrorCode.EXTERNAL_OPERATOR_WITH_BODY]); |
| 7132 } | 7214 } |
| 7133 void test_externalSetterWithBody() { | 7215 void test_externalSetterWithBody() { |
| 7134 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "external set x(in
t value) {}", [ParserErrorCode.EXTERNAL_SETTER_WITH_BODY]); | 7216 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "external set x(in
t value) {}", [ParserErrorCode.EXTERNAL_SETTER_WITH_BODY]); |
| 7135 } | 7217 } |
| 7136 void test_externalTypedef() { | 7218 void test_externalTypedef() { |
| 7137 ParserTestCase.parse5("parseCompilationUnit", "external typedef F();", [Pars
erErrorCode.EXTERNAL_TYPEDEF]); | 7219 ParserTestCase.parse6("parseCompilationUnit", "external typedef F();", [Pars
erErrorCode.EXTERNAL_TYPEDEF]); |
| 7138 } | 7220 } |
| 7139 void test_factoryTopLevelDeclaration_class() { | 7221 void test_factoryTopLevelDeclaration_class() { |
| 7140 ParserTestCase.parse5("parseCompilationUnit", "factory class C {}", [ParserE
rrorCode.FACTORY_TOP_LEVEL_DECLARATION]); | 7222 ParserTestCase.parse6("parseCompilationUnit", "factory class C {}", [ParserE
rrorCode.FACTORY_TOP_LEVEL_DECLARATION]); |
| 7141 } | 7223 } |
| 7142 void test_factoryTopLevelDeclaration_typedef() { | 7224 void test_factoryTopLevelDeclaration_typedef() { |
| 7143 ParserTestCase.parse5("parseCompilationUnit", "factory typedef F();", [Parse
rErrorCode.FACTORY_TOP_LEVEL_DECLARATION]); | 7225 ParserTestCase.parse6("parseCompilationUnit", "factory typedef F();", [Parse
rErrorCode.FACTORY_TOP_LEVEL_DECLARATION]); |
| 7144 } | 7226 } |
| 7145 void test_fieldInitializerOutsideConstructor() { | 7227 void test_fieldInitializerOutsideConstructor() { |
| 7146 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "void m(this.x);",
[ParserErrorCode.FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR]); | 7228 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "void m(this.x);",
[ParserErrorCode.FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR]); |
| 7147 } | 7229 } |
| 7148 void test_finalAndVar() { | 7230 void test_finalAndVar() { |
| 7149 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "final var x;", [P
arserErrorCode.FINAL_AND_VAR]); | 7231 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "final var x;", [P
arserErrorCode.FINAL_AND_VAR]); |
| 7150 } | 7232 } |
| 7151 void test_finalClass() { | 7233 void test_finalClass() { |
| 7152 ParserTestCase.parse5("parseCompilationUnit", "final class C {}", [ParserErr
orCode.FINAL_CLASS]); | 7234 ParserTestCase.parse6("parseCompilationUnit", "final class C {}", [ParserErr
orCode.FINAL_CLASS]); |
| 7153 } | 7235 } |
| 7154 void test_finalConstructor() { | 7236 void test_finalConstructor() { |
| 7155 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "final C() {}", [P
arserErrorCode.FINAL_CONSTRUCTOR]); | 7237 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "final C() {}", [P
arserErrorCode.FINAL_CONSTRUCTOR]); |
| 7156 } | 7238 } |
| 7157 void test_finalMethod() { | 7239 void test_finalMethod() { |
| 7158 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "final int m() {}"
, [ParserErrorCode.FINAL_METHOD]); | 7240 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "final int m() {}"
, [ParserErrorCode.FINAL_METHOD]); |
| 7159 } | 7241 } |
| 7160 void test_finalTypedef() { | 7242 void test_finalTypedef() { |
| 7161 ParserTestCase.parse5("parseCompilationUnit", "final typedef F();", [ParserE
rrorCode.FINAL_TYPEDEF]); | 7243 ParserTestCase.parse6("parseCompilationUnit", "final typedef F();", [ParserE
rrorCode.FINAL_TYPEDEF]); |
| 7162 } | 7244 } |
| 7163 void test_getterWithParameters() { | 7245 void test_getterWithParameters() { |
| 7164 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "int get x() {}",
[ParserErrorCode.GETTER_WITH_PARAMETERS]); | 7246 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "int get x() {}",
[ParserErrorCode.GETTER_WITH_PARAMETERS]); |
| 7165 } | 7247 } |
| 7166 void test_illegalAssignmentToNonAssignable_superAssigned() { | 7248 void test_illegalAssignmentToNonAssignable_superAssigned() { |
| 7167 ParserTestCase.parse5("parseExpression", "super = x;", [ParserErrorCode.MISS
ING_ASSIGNABLE_SELECTOR, ParserErrorCode.ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE]); | 7249 ParserTestCase.parse6("parseExpression", "super = x;", [ParserErrorCode.MISS
ING_ASSIGNABLE_SELECTOR, ParserErrorCode.ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE]); |
| 7168 } | 7250 } |
| 7169 void test_implementsBeforeExtends() { | 7251 void test_implementsBeforeExtends() { |
| 7170 ParserTestCase.parse5("parseCompilationUnit", "class A implements B extends
C {}", [ParserErrorCode.IMPLEMENTS_BEFORE_EXTENDS]); | 7252 ParserTestCase.parse6("parseCompilationUnit", "class A implements B extends
C {}", [ParserErrorCode.IMPLEMENTS_BEFORE_EXTENDS]); |
| 7171 } | 7253 } |
| 7172 void test_implementsBeforeWith() { | 7254 void test_implementsBeforeWith() { |
| 7173 ParserTestCase.parse5("parseCompilationUnit", "class A extends B implements
C with D {}", [ParserErrorCode.IMPLEMENTS_BEFORE_WITH]); | 7255 ParserTestCase.parse6("parseCompilationUnit", "class A extends B implements
C with D {}", [ParserErrorCode.IMPLEMENTS_BEFORE_WITH]); |
| 7174 } | 7256 } |
| 7175 void test_importDirectiveAfterPartDirective() { | 7257 void test_importDirectiveAfterPartDirective() { |
| 7176 ParserTestCase.parse5("parseCompilationUnit", "part 'a.dart'; import 'b.dart
';", [ParserErrorCode.IMPORT_DIRECTIVE_AFTER_PART_DIRECTIVE]); | 7258 ParserTestCase.parse6("parseCompilationUnit", "part 'a.dart'; import 'b.dart
';", [ParserErrorCode.IMPORT_DIRECTIVE_AFTER_PART_DIRECTIVE]); |
| 7177 } | 7259 } |
| 7178 void test_initializedVariableInForEach() { | 7260 void test_initializedVariableInForEach() { |
| 7179 ParserTestCase.parse5("parseForStatement", "for (int a = 0 in foo) {}", [Par
serErrorCode.INITIALIZED_VARIABLE_IN_FOR_EACH]); | 7261 ParserTestCase.parse6("parseForStatement", "for (int a = 0 in foo) {}", [Par
serErrorCode.INITIALIZED_VARIABLE_IN_FOR_EACH]); |
| 7180 } | 7262 } |
| 7181 void test_invalidCodePoint() { | 7263 void test_invalidCodePoint() { |
| 7182 ParserTestCase.parse5("parseStringLiteral", "'\\uD900'", [ParserErrorCode.IN
VALID_CODE_POINT]); | 7264 ParserTestCase.parse6("parseStringLiteral", "'\\uD900'", [ParserErrorCode.IN
VALID_CODE_POINT]); |
| 7183 } | 7265 } |
| 7184 void test_invalidHexEscape_invalidDigit() { | 7266 void test_invalidHexEscape_invalidDigit() { |
| 7185 ParserTestCase.parse5("parseStringLiteral", "'\\x0 a'", [ParserErrorCode.INV
ALID_HEX_ESCAPE]); | 7267 ParserTestCase.parse6("parseStringLiteral", "'\\x0 a'", [ParserErrorCode.INV
ALID_HEX_ESCAPE]); |
| 7186 } | 7268 } |
| 7187 void test_invalidHexEscape_tooFewDigits() { | 7269 void test_invalidHexEscape_tooFewDigits() { |
| 7188 ParserTestCase.parse5("parseStringLiteral", "'\\x0'", [ParserErrorCode.INVAL
ID_HEX_ESCAPE]); | 7270 ParserTestCase.parse6("parseStringLiteral", "'\\x0'", [ParserErrorCode.INVAL
ID_HEX_ESCAPE]); |
| 7189 } | 7271 } |
| 7190 void test_invalidOperatorForSuper() { | 7272 void test_invalidOperatorForSuper() { |
| 7191 ParserTestCase.parse5("parseUnaryExpression", "++super", [ParserErrorCode.IN
VALID_OPERATOR_FOR_SUPER]); | 7273 ParserTestCase.parse6("parseUnaryExpression", "++super", [ParserErrorCode.IN
VALID_OPERATOR_FOR_SUPER]); |
| 7192 } | 7274 } |
| 7193 void test_invalidUnicodeEscape_incomplete_noDigits() { | 7275 void test_invalidUnicodeEscape_incomplete_noDigits() { |
| 7194 ParserTestCase.parse5("parseStringLiteral", "'\\u{'", [ParserErrorCode.INVAL
ID_UNICODE_ESCAPE]); | 7276 ParserTestCase.parse6("parseStringLiteral", "'\\u{'", [ParserErrorCode.INVAL
ID_UNICODE_ESCAPE]); |
| 7195 } | 7277 } |
| 7196 void test_invalidUnicodeEscape_incomplete_someDigits() { | 7278 void test_invalidUnicodeEscape_incomplete_someDigits() { |
| 7197 ParserTestCase.parse5("parseStringLiteral", "'\\u{0A'", [ParserErrorCode.INV
ALID_UNICODE_ESCAPE]); | 7279 ParserTestCase.parse6("parseStringLiteral", "'\\u{0A'", [ParserErrorCode.INV
ALID_UNICODE_ESCAPE]); |
| 7198 } | 7280 } |
| 7199 void test_invalidUnicodeEscape_invalidDigit() { | 7281 void test_invalidUnicodeEscape_invalidDigit() { |
| 7200 ParserTestCase.parse5("parseStringLiteral", "'\\u0 a'", [ParserErrorCode.INV
ALID_UNICODE_ESCAPE]); | 7282 ParserTestCase.parse6("parseStringLiteral", "'\\u0 a'", [ParserErrorCode.INV
ALID_UNICODE_ESCAPE]); |
| 7201 } | 7283 } |
| 7202 void test_invalidUnicodeEscape_tooFewDigits_fixed() { | 7284 void test_invalidUnicodeEscape_tooFewDigits_fixed() { |
| 7203 ParserTestCase.parse5("parseStringLiteral", "'\\u04'", [ParserErrorCode.INVA
LID_UNICODE_ESCAPE]); | 7285 ParserTestCase.parse6("parseStringLiteral", "'\\u04'", [ParserErrorCode.INVA
LID_UNICODE_ESCAPE]); |
| 7204 } | 7286 } |
| 7205 void test_invalidUnicodeEscape_tooFewDigits_variable() { | 7287 void test_invalidUnicodeEscape_tooFewDigits_variable() { |
| 7206 ParserTestCase.parse5("parseStringLiteral", "'\\u{}'", [ParserErrorCode.INVA
LID_UNICODE_ESCAPE]); | 7288 ParserTestCase.parse6("parseStringLiteral", "'\\u{}'", [ParserErrorCode.INVA
LID_UNICODE_ESCAPE]); |
| 7207 } | 7289 } |
| 7208 void test_invalidUnicodeEscape_tooManyDigits_variable() { | 7290 void test_invalidUnicodeEscape_tooManyDigits_variable() { |
| 7209 ParserTestCase.parse5("parseStringLiteral", "'\\u{12345678}'", [ParserErrorC
ode.INVALID_UNICODE_ESCAPE, ParserErrorCode.INVALID_CODE_POINT]); | 7291 ParserTestCase.parse6("parseStringLiteral", "'\\u{12345678}'", [ParserErrorC
ode.INVALID_UNICODE_ESCAPE, ParserErrorCode.INVALID_CODE_POINT]); |
| 7210 } | 7292 } |
| 7211 void test_libraryDirectiveNotFirst() { | 7293 void test_libraryDirectiveNotFirst() { |
| 7212 ParserTestCase.parse5("parseCompilationUnit", "import 'x.dart'; library l;",
[ParserErrorCode.LIBRARY_DIRECTIVE_NOT_FIRST]); | 7294 ParserTestCase.parse6("parseCompilationUnit", "import 'x.dart'; library l;",
[ParserErrorCode.LIBRARY_DIRECTIVE_NOT_FIRST]); |
| 7213 } | 7295 } |
| 7214 void test_libraryDirectiveNotFirst_afterPart() { | 7296 void test_libraryDirectiveNotFirst_afterPart() { |
| 7215 CompilationUnit unit = ParserTestCase.parse5("parseCompilationUnit", "part '
a.dart';\nlibrary l;", [ParserErrorCode.LIBRARY_DIRECTIVE_NOT_FIRST]); | 7297 CompilationUnit unit = ParserTestCase.parse6("parseCompilationUnit", "part '
a.dart';\nlibrary l;", [ParserErrorCode.LIBRARY_DIRECTIVE_NOT_FIRST]); |
| 7216 JUnitTestCase.assertNotNull(unit); | 7298 JUnitTestCase.assertNotNull(unit); |
| 7217 } | 7299 } |
| 7218 void test_missingAssignableSelector_identifiersAssigned() { | 7300 void test_missingAssignableSelector_identifiersAssigned() { |
| 7219 ParserTestCase.parse5("parseExpression", "x.y = y;", []); | 7301 ParserTestCase.parse6("parseExpression", "x.y = y;", []); |
| 7220 } | 7302 } |
| 7221 void test_missingAssignableSelector_primarySelectorPostfix() { | 7303 void test_missingAssignableSelector_primarySelectorPostfix() { |
| 7222 ParserTestCase.parse5("parseExpression", "x(y)(z)++", [ParserErrorCode.MISSI
NG_ASSIGNABLE_SELECTOR]); | 7304 ParserTestCase.parse6("parseExpression", "x(y)(z)++", [ParserErrorCode.MISSI
NG_ASSIGNABLE_SELECTOR]); |
| 7223 } | 7305 } |
| 7224 void test_missingAssignableSelector_selector() { | 7306 void test_missingAssignableSelector_selector() { |
| 7225 ParserTestCase.parse5("parseExpression", "x(y)(z).a++", []); | 7307 ParserTestCase.parse6("parseExpression", "x(y)(z).a++", []); |
| 7226 } | 7308 } |
| 7227 void test_missingAssignableSelector_superPrimaryExpression() { | 7309 void test_missingAssignableSelector_superPrimaryExpression() { |
| 7228 SuperExpression expression = ParserTestCase.parse5("parsePrimaryExpression",
"super", [ParserErrorCode.MISSING_ASSIGNABLE_SELECTOR]); | 7310 SuperExpression expression = ParserTestCase.parse6("parsePrimaryExpression",
"super", [ParserErrorCode.MISSING_ASSIGNABLE_SELECTOR]); |
| 7229 JUnitTestCase.assertNotNull(expression.keyword); | 7311 JUnitTestCase.assertNotNull(expression.keyword); |
| 7230 } | 7312 } |
| 7231 void test_missingAssignableSelector_superPropertyAccessAssigned() { | 7313 void test_missingAssignableSelector_superPropertyAccessAssigned() { |
| 7232 ParserTestCase.parse5("parseExpression", "super.x = x;", []); | 7314 ParserTestCase.parse6("parseExpression", "super.x = x;", []); |
| 7233 } | 7315 } |
| 7234 void test_missingCatchOrFinally() { | 7316 void test_missingCatchOrFinally() { |
| 7235 TryStatement statement = ParserTestCase.parse5("parseTryStatement", "try {}"
, [ParserErrorCode.MISSING_CATCH_OR_FINALLY]); | 7317 TryStatement statement = ParserTestCase.parse6("parseTryStatement", "try {}"
, [ParserErrorCode.MISSING_CATCH_OR_FINALLY]); |
| 7236 JUnitTestCase.assertNotNull(statement); | 7318 JUnitTestCase.assertNotNull(statement); |
| 7237 } | 7319 } |
| 7238 void test_missingClassBody() { | 7320 void test_missingClassBody() { |
| 7239 ParserTestCase.parse5("parseCompilationUnit", "class A class B {}", [ParserE
rrorCode.MISSING_CLASS_BODY]); | 7321 ParserTestCase.parse6("parseCompilationUnit", "class A class B {}", [ParserE
rrorCode.MISSING_CLASS_BODY]); |
| 7240 } | 7322 } |
| 7241 void test_missingConstFinalVarOrType() { | 7323 void test_missingConstFinalVarOrType() { |
| 7242 ParserTestCase.parse4("parseFinalConstVarOrType", <Object> [false], "a;", [P
arserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE]); | 7324 ParserTestCase.parse5("parseFinalConstVarOrType", <Object> [false], "a;", [P
arserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE]); |
| 7243 } | 7325 } |
| 7244 void test_missingFunctionBody_emptyNotAllowed() { | 7326 void test_missingFunctionBody_emptyNotAllowed() { |
| 7245 ParserTestCase.parse4("parseFunctionBody", <Object> [false, false], ";", [Pa
rserErrorCode.MISSING_FUNCTION_BODY]); | 7327 ParserTestCase.parse5("parseFunctionBody", <Object> [false, false], ";", [Pa
rserErrorCode.MISSING_FUNCTION_BODY]); |
| 7246 } | 7328 } |
| 7247 void test_missingFunctionBody_invalid() { | 7329 void test_missingFunctionBody_invalid() { |
| 7248 ParserTestCase.parse4("parseFunctionBody", <Object> [false, false], "return
0;", [ParserErrorCode.MISSING_FUNCTION_BODY]); | 7330 ParserTestCase.parse5("parseFunctionBody", <Object> [false, false], "return
0;", [ParserErrorCode.MISSING_FUNCTION_BODY]); |
| 7249 } | 7331 } |
| 7250 void test_missingFunctionParameters_local_void_block() { | 7332 void test_missingFunctionParameters_local_void_block() { |
| 7251 ParserTestCase.parse5("parseStatement", "void f { return x;}", [ParserErrorC
ode.MISSING_FUNCTION_PARAMETERS]); | 7333 ParserTestCase.parse6("parseStatement", "void f { return x;}", [ParserErrorC
ode.MISSING_FUNCTION_PARAMETERS]); |
| 7252 } | 7334 } |
| 7253 void test_missingFunctionParameters_local_void_expression() { | 7335 void test_missingFunctionParameters_local_void_expression() { |
| 7254 ParserTestCase.parse5("parseStatement", "void f => x;", [ParserErrorCode.MIS
SING_FUNCTION_PARAMETERS]); | 7336 ParserTestCase.parse6("parseStatement", "void f => x;", [ParserErrorCode.MIS
SING_FUNCTION_PARAMETERS]); |
| 7255 } | 7337 } |
| 7256 void test_missingFunctionParameters_topLevel_nonVoid_block() { | 7338 void test_missingFunctionParameters_topLevel_nonVoid_block() { |
| 7257 ParserTestCase.parse5("parseCompilationUnit", "int f { return x;}", [ParserE
rrorCode.MISSING_FUNCTION_PARAMETERS]); | 7339 ParserTestCase.parse6("parseCompilationUnit", "int f { return x;}", [ParserE
rrorCode.MISSING_FUNCTION_PARAMETERS]); |
| 7258 } | 7340 } |
| 7259 void test_missingFunctionParameters_topLevel_nonVoid_expression() { | 7341 void test_missingFunctionParameters_topLevel_nonVoid_expression() { |
| 7260 ParserTestCase.parse5("parseCompilationUnit", "int f => x;", [ParserErrorCod
e.MISSING_FUNCTION_PARAMETERS]); | 7342 ParserTestCase.parse6("parseCompilationUnit", "int f => x;", [ParserErrorCod
e.MISSING_FUNCTION_PARAMETERS]); |
| 7261 } | 7343 } |
| 7262 void test_missingFunctionParameters_topLevel_void_block() { | 7344 void test_missingFunctionParameters_topLevel_void_block() { |
| 7263 ParserTestCase.parse5("parseCompilationUnit", "void f { return x;}", [Parser
ErrorCode.MISSING_FUNCTION_PARAMETERS]); | 7345 ParserTestCase.parse6("parseCompilationUnit", "void f { return x;}", [Parser
ErrorCode.MISSING_FUNCTION_PARAMETERS]); |
| 7264 } | 7346 } |
| 7265 void test_missingFunctionParameters_topLevel_void_expression() { | 7347 void test_missingFunctionParameters_topLevel_void_expression() { |
| 7266 ParserTestCase.parse5("parseCompilationUnit", "void f => x;", [ParserErrorCo
de.MISSING_FUNCTION_PARAMETERS]); | 7348 ParserTestCase.parse6("parseCompilationUnit", "void f => x;", [ParserErrorCo
de.MISSING_FUNCTION_PARAMETERS]); |
| 7267 } | 7349 } |
| 7268 void test_missingIdentifier_functionDeclaration_returnTypeWithoutName() { | 7350 void test_missingIdentifier_functionDeclaration_returnTypeWithoutName() { |
| 7269 ParserTestCase.parse5("parseFunctionDeclarationStatement", "A<T> () {}", [Pa
rserErrorCode.MISSING_IDENTIFIER]); | 7351 ParserTestCase.parse6("parseFunctionDeclarationStatement", "A<T> () {}", [Pa
rserErrorCode.MISSING_IDENTIFIER]); |
| 7270 } | 7352 } |
| 7271 void test_missingIdentifier_number() { | 7353 void test_missingIdentifier_number() { |
| 7272 SimpleIdentifier expression = ParserTestCase.parse5("parseSimpleIdentifier",
"1", [ParserErrorCode.MISSING_IDENTIFIER]); | 7354 SimpleIdentifier expression = ParserTestCase.parse6("parseSimpleIdentifier",
"1", [ParserErrorCode.MISSING_IDENTIFIER]); |
| 7273 JUnitTestCase.assertTrue(expression.isSynthetic()); | 7355 JUnitTestCase.assertTrue(expression.isSynthetic()); |
| 7274 } | 7356 } |
| 7275 void test_missingNameInLibraryDirective() { | 7357 void test_missingNameInLibraryDirective() { |
| 7276 CompilationUnit unit = ParserTestCase.parse5("parseCompilationUnit", "librar
y;", [ParserErrorCode.MISSING_NAME_IN_LIBRARY_DIRECTIVE]); | 7358 CompilationUnit unit = ParserTestCase.parse6("parseCompilationUnit", "librar
y;", [ParserErrorCode.MISSING_NAME_IN_LIBRARY_DIRECTIVE]); |
| 7277 JUnitTestCase.assertNotNull(unit); | 7359 JUnitTestCase.assertNotNull(unit); |
| 7278 } | 7360 } |
| 7279 void test_missingNameInPartOfDirective() { | 7361 void test_missingNameInPartOfDirective() { |
| 7280 CompilationUnit unit = ParserTestCase.parse5("parseCompilationUnit", "part o
f;", [ParserErrorCode.MISSING_NAME_IN_PART_OF_DIRECTIVE]); | 7362 CompilationUnit unit = ParserTestCase.parse6("parseCompilationUnit", "part o
f;", [ParserErrorCode.MISSING_NAME_IN_PART_OF_DIRECTIVE]); |
| 7281 JUnitTestCase.assertNotNull(unit); | 7363 JUnitTestCase.assertNotNull(unit); |
| 7364 } |
| 7365 void test_missingTerminatorForParameterGroup_named() { |
| 7366 ParserTestCase.parse6("parseFormalParameterList", "(a, {b: 0)", [ParserError
Code.MISSING_TERMINATOR_FOR_PARAMETER_GROUP]); |
| 7367 } |
| 7368 void test_missingTerminatorForParameterGroup_optional() { |
| 7369 ParserTestCase.parse6("parseFormalParameterList", "(a, [b = 0)", [ParserErro
rCode.MISSING_TERMINATOR_FOR_PARAMETER_GROUP]); |
| 7282 } | 7370 } |
| 7283 void test_missingTypedefParameters_nonVoid() { | 7371 void test_missingTypedefParameters_nonVoid() { |
| 7284 ParserTestCase.parse5("parseCompilationUnit", "typedef int F;", [ParserError
Code.MISSING_TYPEDEF_PARAMETERS]); | 7372 ParserTestCase.parse6("parseCompilationUnit", "typedef int F;", [ParserError
Code.MISSING_TYPEDEF_PARAMETERS]); |
| 7285 } | 7373 } |
| 7286 void test_missingTypedefParameters_typeParameters() { | 7374 void test_missingTypedefParameters_typeParameters() { |
| 7287 ParserTestCase.parse5("parseCompilationUnit", "typedef F<E>;", [ParserErrorC
ode.MISSING_TYPEDEF_PARAMETERS]); | 7375 ParserTestCase.parse6("parseCompilationUnit", "typedef F<E>;", [ParserErrorC
ode.MISSING_TYPEDEF_PARAMETERS]); |
| 7288 } | 7376 } |
| 7289 void test_missingTypedefParameters_void() { | 7377 void test_missingTypedefParameters_void() { |
| 7290 ParserTestCase.parse5("parseCompilationUnit", "typedef void F;", [ParserErro
rCode.MISSING_TYPEDEF_PARAMETERS]); | 7378 ParserTestCase.parse6("parseCompilationUnit", "typedef void F;", [ParserErro
rCode.MISSING_TYPEDEF_PARAMETERS]); |
| 7291 } | 7379 } |
| 7292 void test_missingVariableInForEach() { | 7380 void test_missingVariableInForEach() { |
| 7293 ParserTestCase.parse5("parseForStatement", "for (a < b in foo) {}", [ParserE
rrorCode.MISSING_VARIABLE_IN_FOR_EACH]); | 7381 ParserTestCase.parse6("parseForStatement", "for (a < b in foo) {}", [ParserE
rrorCode.MISSING_VARIABLE_IN_FOR_EACH]); |
| 7294 } | 7382 } |
| 7295 void test_mixedParameterGroups_namedPositional() { | 7383 void test_mixedParameterGroups_namedPositional() { |
| 7296 ParserTestCase.parse5("parseFormalParameterList", "(a, {b}, [c])", [ParserEr
rorCode.MIXED_PARAMETER_GROUPS]); | 7384 ParserTestCase.parse6("parseFormalParameterList", "(a, {b}, [c])", [ParserEr
rorCode.MIXED_PARAMETER_GROUPS]); |
| 7297 } | 7385 } |
| 7298 void test_mixedParameterGroups_positionalNamed() { | 7386 void test_mixedParameterGroups_positionalNamed() { |
| 7299 ParserTestCase.parse5("parseFormalParameterList", "(a, [b], {c})", [ParserEr
rorCode.MIXED_PARAMETER_GROUPS]); | 7387 ParserTestCase.parse6("parseFormalParameterList", "(a, [b], {c})", [ParserEr
rorCode.MIXED_PARAMETER_GROUPS]); |
| 7300 } | 7388 } |
| 7301 void test_multipleLibraryDirectives() { | 7389 void test_multipleLibraryDirectives() { |
| 7302 ParserTestCase.parse5("parseCompilationUnit", "library l; library m;", [Pars
erErrorCode.MULTIPLE_LIBRARY_DIRECTIVES]); | 7390 ParserTestCase.parse6("parseCompilationUnit", "library l; library m;", [Pars
erErrorCode.MULTIPLE_LIBRARY_DIRECTIVES]); |
| 7303 } | 7391 } |
| 7304 void test_multipleNamedParameterGroups() { | 7392 void test_multipleNamedParameterGroups() { |
| 7305 ParserTestCase.parse5("parseFormalParameterList", "(a, {b}, {c})", [ParserEr
rorCode.MULTIPLE_NAMED_PARAMETER_GROUPS]); | 7393 ParserTestCase.parse6("parseFormalParameterList", "(a, {b}, {c})", [ParserEr
rorCode.MULTIPLE_NAMED_PARAMETER_GROUPS]); |
| 7306 } | 7394 } |
| 7307 void test_multiplePartOfDirectives() { | 7395 void test_multiplePartOfDirectives() { |
| 7308 ParserTestCase.parse5("parseCompilationUnit", "part of l; part of m;", [Pars
erErrorCode.MULTIPLE_PART_OF_DIRECTIVES]); | 7396 ParserTestCase.parse6("parseCompilationUnit", "part of l; part of m;", [Pars
erErrorCode.MULTIPLE_PART_OF_DIRECTIVES]); |
| 7309 } | 7397 } |
| 7310 void test_multiplePositionalParameterGroups() { | 7398 void test_multiplePositionalParameterGroups() { |
| 7311 ParserTestCase.parse5("parseFormalParameterList", "(a, [b], [c])", [ParserEr
rorCode.MULTIPLE_POSITIONAL_PARAMETER_GROUPS]); | 7399 ParserTestCase.parse6("parseFormalParameterList", "(a, [b], [c])", [ParserEr
rorCode.MULTIPLE_POSITIONAL_PARAMETER_GROUPS]); |
| 7312 } | 7400 } |
| 7313 void test_multipleVariablesInForEach() { | 7401 void test_multipleVariablesInForEach() { |
| 7314 ParserTestCase.parse5("parseForStatement", "for (int a, b in foo) {}", [Pars
erErrorCode.MULTIPLE_VARIABLES_IN_FOR_EACH]); | 7402 ParserTestCase.parse6("parseForStatement", "for (int a, b in foo) {}", [Pars
erErrorCode.MULTIPLE_VARIABLES_IN_FOR_EACH]); |
| 7315 } | 7403 } |
| 7316 void test_namedParameterOutsideGroup() { | 7404 void test_namedParameterOutsideGroup() { |
| 7317 ParserTestCase.parse5("parseFormalParameterList", "(a, b : 0)", [ParserError
Code.NAMED_PARAMETER_OUTSIDE_GROUP]); | 7405 ParserTestCase.parse6("parseFormalParameterList", "(a, b : 0)", [ParserError
Code.NAMED_PARAMETER_OUTSIDE_GROUP]); |
| 7318 } | 7406 } |
| 7319 void test_nonConstructorFactory_field() { | 7407 void test_nonConstructorFactory_field() { |
| 7320 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "factory int x;",
[ParserErrorCode.NON_CONSTRUCTOR_FACTORY]); | 7408 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "factory int x;",
[ParserErrorCode.NON_CONSTRUCTOR_FACTORY]); |
| 7321 } | 7409 } |
| 7322 void test_nonConstructorFactory_method() { | 7410 void test_nonConstructorFactory_method() { |
| 7323 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "factory int m() {
}", [ParserErrorCode.NON_CONSTRUCTOR_FACTORY]); | 7411 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "factory int m() {
}", [ParserErrorCode.NON_CONSTRUCTOR_FACTORY]); |
| 7324 } | 7412 } |
| 7325 void test_nonIdentifierLibraryName_library() { | 7413 void test_nonIdentifierLibraryName_library() { |
| 7326 CompilationUnit unit = ParserTestCase.parse5("parseCompilationUnit", "librar
y 'lib';", [ParserErrorCode.NON_IDENTIFIER_LIBRARY_NAME]); | 7414 CompilationUnit unit = ParserTestCase.parse6("parseCompilationUnit", "librar
y 'lib';", [ParserErrorCode.NON_IDENTIFIER_LIBRARY_NAME]); |
| 7327 JUnitTestCase.assertNotNull(unit); | 7415 JUnitTestCase.assertNotNull(unit); |
| 7328 } | 7416 } |
| 7329 void test_nonIdentifierLibraryName_partOf() { | 7417 void test_nonIdentifierLibraryName_partOf() { |
| 7330 CompilationUnit unit = ParserTestCase.parse5("parseCompilationUnit", "part o
f 'lib';", [ParserErrorCode.NON_IDENTIFIER_LIBRARY_NAME]); | 7418 CompilationUnit unit = ParserTestCase.parse6("parseCompilationUnit", "part o
f 'lib';", [ParserErrorCode.NON_IDENTIFIER_LIBRARY_NAME]); |
| 7331 JUnitTestCase.assertNotNull(unit); | 7419 JUnitTestCase.assertNotNull(unit); |
| 7332 } | 7420 } |
| 7333 void test_nonPartOfDirectiveInPart_after() { | 7421 void test_nonPartOfDirectiveInPart_after() { |
| 7334 ParserTestCase.parse5("parseCompilationUnit", "part of l; part 'f.dart';", [
ParserErrorCode.NON_PART_OF_DIRECTIVE_IN_PART]); | 7422 ParserTestCase.parse6("parseCompilationUnit", "part of l; part 'f.dart';", [
ParserErrorCode.NON_PART_OF_DIRECTIVE_IN_PART]); |
| 7335 } | 7423 } |
| 7336 void test_nonPartOfDirectiveInPart_before() { | 7424 void test_nonPartOfDirectiveInPart_before() { |
| 7337 ParserTestCase.parse5("parseCompilationUnit", "part 'f.dart'; part of m;", [
ParserErrorCode.NON_PART_OF_DIRECTIVE_IN_PART]); | 7425 ParserTestCase.parse6("parseCompilationUnit", "part 'f.dart'; part of m;", [
ParserErrorCode.NON_PART_OF_DIRECTIVE_IN_PART]); |
| 7338 } | 7426 } |
| 7339 void test_nonUserDefinableOperator() { | 7427 void test_nonUserDefinableOperator() { |
| 7340 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "operator +=(int x
) => x + 1;", [ParserErrorCode.NON_USER_DEFINABLE_OPERATOR]); | 7428 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "operator +=(int x
) => x + 1;", [ParserErrorCode.NON_USER_DEFINABLE_OPERATOR]); |
| 7341 } | 7429 } |
| 7342 void test_positionalAfterNamedArgument() { | 7430 void test_positionalAfterNamedArgument() { |
| 7343 ParserTestCase.parse5("parseArgumentList", "(x: 1, 2)", [ParserErrorCode.POS
ITIONAL_AFTER_NAMED_ARGUMENT]); | 7431 ParserTestCase.parse6("parseArgumentList", "(x: 1, 2)", [ParserErrorCode.POS
ITIONAL_AFTER_NAMED_ARGUMENT]); |
| 7344 } | 7432 } |
| 7345 void test_positionalParameterOutsideGroup() { | 7433 void test_positionalParameterOutsideGroup() { |
| 7346 ParserTestCase.parse5("parseFormalParameterList", "(a, b = 0)", [ParserError
Code.POSITIONAL_PARAMETER_OUTSIDE_GROUP]); | 7434 ParserTestCase.parse6("parseFormalParameterList", "(a, b = 0)", [ParserError
Code.POSITIONAL_PARAMETER_OUTSIDE_GROUP]); |
| 7347 } | 7435 } |
| 7348 void test_staticAfterConst() { | 7436 void test_staticAfterConst() { |
| 7349 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "final static int
f;", [ParserErrorCode.STATIC_AFTER_FINAL]); | 7437 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "final static int
f;", [ParserErrorCode.STATIC_AFTER_FINAL]); |
| 7350 } | 7438 } |
| 7351 void test_staticAfterFinal() { | 7439 void test_staticAfterFinal() { |
| 7352 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "const static int
f;", [ParserErrorCode.STATIC_AFTER_CONST]); | 7440 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "const static int
f;", [ParserErrorCode.STATIC_AFTER_CONST]); |
| 7353 } | 7441 } |
| 7354 void test_staticAfterVar() { | 7442 void test_staticAfterVar() { |
| 7355 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "var static f;", [
ParserErrorCode.STATIC_AFTER_VAR]); | 7443 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "var static f;", [
ParserErrorCode.STATIC_AFTER_VAR]); |
| 7356 } | 7444 } |
| 7357 void test_staticConstructor() { | 7445 void test_staticConstructor() { |
| 7358 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "static C.m() {}",
[ParserErrorCode.STATIC_CONSTRUCTOR]); | 7446 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "static C.m() {}",
[ParserErrorCode.STATIC_CONSTRUCTOR]); |
| 7359 } | 7447 } |
| 7360 void test_staticOperator_noReturnType() { | 7448 void test_staticOperator_noReturnType() { |
| 7361 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "static operator +
(int x) => x + 1;", [ParserErrorCode.STATIC_OPERATOR]); | 7449 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "static operator +
(int x) => x + 1;", [ParserErrorCode.STATIC_OPERATOR]); |
| 7362 } | 7450 } |
| 7363 void test_staticOperator_returnType() { | 7451 void test_staticOperator_returnType() { |
| 7364 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "static int operat
or +(int x) => x + 1;", [ParserErrorCode.STATIC_OPERATOR]); | 7452 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "static int operat
or +(int x) => x + 1;", [ParserErrorCode.STATIC_OPERATOR]); |
| 7365 } | 7453 } |
| 7366 void test_staticTopLevelDeclaration_class() { | 7454 void test_staticTopLevelDeclaration_class() { |
| 7367 ParserTestCase.parse5("parseCompilationUnit", "static class C {}", [ParserEr
rorCode.STATIC_TOP_LEVEL_DECLARATION]); | 7455 ParserTestCase.parse6("parseCompilationUnit", "static class C {}", [ParserEr
rorCode.STATIC_TOP_LEVEL_DECLARATION]); |
| 7368 } | 7456 } |
| 7369 void test_staticTopLevelDeclaration_typedef() { | 7457 void test_staticTopLevelDeclaration_typedef() { |
| 7370 ParserTestCase.parse5("parseCompilationUnit", "static typedef F();", [Parser
ErrorCode.STATIC_TOP_LEVEL_DECLARATION]); | 7458 ParserTestCase.parse6("parseCompilationUnit", "static typedef F();", [Parser
ErrorCode.STATIC_TOP_LEVEL_DECLARATION]); |
| 7371 } | 7459 } |
| 7372 void test_staticTopLevelDeclaration_variable() { | 7460 void test_staticTopLevelDeclaration_variable() { |
| 7373 ParserTestCase.parse5("parseCompilationUnit", "static var x;", [ParserErrorC
ode.STATIC_TOP_LEVEL_DECLARATION]); | 7461 ParserTestCase.parse6("parseCompilationUnit", "static var x;", [ParserErrorC
ode.STATIC_TOP_LEVEL_DECLARATION]); |
| 7462 } |
| 7463 void test_unexpectedTerminatorForParameterGroup_named() { |
| 7464 ParserTestCase.parse6("parseFormalParameterList", "(a, b})", [ParserErrorCod
e.UNEXPECTED_TERMINATOR_FOR_PARAMETER_GROUP]); |
| 7465 } |
| 7466 void test_unexpectedTerminatorForParameterGroup_optional() { |
| 7467 ParserTestCase.parse6("parseFormalParameterList", "(a, b])", [ParserErrorCod
e.UNEXPECTED_TERMINATOR_FOR_PARAMETER_GROUP]); |
| 7374 } | 7468 } |
| 7375 void test_unexpectedToken_semicolonBetweenClassMembers() { | 7469 void test_unexpectedToken_semicolonBetweenClassMembers() { |
| 7376 ParserTestCase.parse4("parseClassDeclaration", <Object> [emptyCommentAndMeta
data(), null], "class C { int x; ; int y;}", [ParserErrorCode.UNEXPECTED_TOKEN])
; | 7470 ParserTestCase.parse5("parseClassDeclaration", <Object> [emptyCommentAndMeta
data(), null], "class C { int x; ; int y;}", [ParserErrorCode.UNEXPECTED_TOKEN])
; |
| 7377 } | 7471 } |
| 7378 void test_unexpectedToken_semicolonBetweenCompilationUnitMembers() { | 7472 void test_unexpectedToken_semicolonBetweenCompilationUnitMembers() { |
| 7379 ParserTestCase.parse5("parseCompilationUnit", "int x; ; int y;", [ParserErro
rCode.UNEXPECTED_TOKEN]); | 7473 ParserTestCase.parse6("parseCompilationUnit", "int x; ; int y;", [ParserErro
rCode.UNEXPECTED_TOKEN]); |
| 7380 } | 7474 } |
| 7381 void test_useOfUnaryPlusOperator() { | 7475 void test_useOfUnaryPlusOperator() { |
| 7382 ParserTestCase.parse5("parseUnaryExpression", "+x", [ParserErrorCode.USE_OF_
UNARY_PLUS_OPERATOR]); | 7476 ParserTestCase.parse6("parseUnaryExpression", "+x", [ParserErrorCode.USE_OF_
UNARY_PLUS_OPERATOR]); |
| 7383 } | 7477 } |
| 7384 void test_varClass() { | 7478 void test_varClass() { |
| 7385 ParserTestCase.parse5("parseCompilationUnit", "var class C {}", [ParserError
Code.VAR_CLASS]); | 7479 ParserTestCase.parse6("parseCompilationUnit", "var class C {}", [ParserError
Code.VAR_CLASS]); |
| 7386 } | 7480 } |
| 7387 void test_varConstructor() { | 7481 void test_varConstructor() { |
| 7388 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "var C() {}", [Par
serErrorCode.CONSTRUCTOR_WITH_RETURN_TYPE]); | 7482 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "var C() {}", [Par
serErrorCode.CONSTRUCTOR_WITH_RETURN_TYPE]); |
| 7389 } | 7483 } |
| 7390 void test_varReturnType() { | 7484 void test_varReturnType() { |
| 7391 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "var m() {}", [Par
serErrorCode.VAR_RETURN_TYPE]); | 7485 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "var m() {}", [Par
serErrorCode.VAR_RETURN_TYPE]); |
| 7392 } | 7486 } |
| 7393 void test_varTypedef() { | 7487 void test_varTypedef() { |
| 7394 ParserTestCase.parse5("parseCompilationUnit", "var typedef F();", [ParserErr
orCode.VAR_TYPEDEF]); | 7488 ParserTestCase.parse6("parseCompilationUnit", "var typedef F();", [ParserErr
orCode.VAR_TYPEDEF]); |
| 7395 } | 7489 } |
| 7396 void test_voidField_initializer() { | 7490 void test_voidField_initializer() { |
| 7397 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "void x = 0;", [Pa
rserErrorCode.VOID_VARIABLE]); | 7491 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "void x = 0;", [Pa
rserErrorCode.VOID_VARIABLE]); |
| 7398 } | 7492 } |
| 7399 void test_voidField_noInitializer() { | 7493 void test_voidField_noInitializer() { |
| 7400 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "void x;", [Parser
ErrorCode.VOID_VARIABLE]); | 7494 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "void x;", [Parser
ErrorCode.VOID_VARIABLE]); |
| 7401 } | 7495 } |
| 7402 void test_voidParameter() { | 7496 void test_voidParameter() { |
| 7403 ParserTestCase.parse5("parseNormalFormalParameter", "void a)", [ParserErrorC
ode.VOID_PARAMETER]); | 7497 ParserTestCase.parse6("parseNormalFormalParameter", "void a)", [ParserErrorC
ode.VOID_PARAMETER]); |
| 7404 } | 7498 } |
| 7405 void test_withBeforeExtends() { | 7499 void test_withBeforeExtends() { |
| 7406 ParserTestCase.parse5("parseCompilationUnit", "class A with B extends C {}",
[ParserErrorCode.WITH_BEFORE_EXTENDS]); | 7500 ParserTestCase.parse6("parseCompilationUnit", "class A with B extends C {}",
[ParserErrorCode.WITH_BEFORE_EXTENDS]); |
| 7407 } | 7501 } |
| 7408 void test_withWithoutExtends() { | 7502 void test_withWithoutExtends() { |
| 7409 ParserTestCase.parse4("parseClassDeclaration", <Object> [emptyCommentAndMeta
data(), null], "class A with B, C {}", [ParserErrorCode.WITH_WITHOUT_EXTENDS]); | 7503 ParserTestCase.parse5("parseClassDeclaration", <Object> [emptyCommentAndMeta
data(), null], "class A with B, C {}", [ParserErrorCode.WITH_WITHOUT_EXTENDS]); |
| 7410 } | 7504 } |
| 7411 void test_wrongSeparatorForNamedParameter() { | 7505 void test_wrongSeparatorForNamedParameter() { |
| 7412 ParserTestCase.parse5("parseFormalParameterList", "(a, {b = 0})", [ParserErr
orCode.WRONG_SEPARATOR_FOR_NAMED_PARAMETER]); | 7506 ParserTestCase.parse6("parseFormalParameterList", "(a, {b = 0})", [ParserErr
orCode.WRONG_SEPARATOR_FOR_NAMED_PARAMETER]); |
| 7413 } | 7507 } |
| 7414 void test_wrongSeparatorForPositionalParameter() { | 7508 void test_wrongSeparatorForPositionalParameter() { |
| 7415 ParserTestCase.parse5("parseFormalParameterList", "(a, [b : 0])", [ParserErr
orCode.WRONG_SEPARATOR_FOR_POSITIONAL_PARAMETER]); | 7509 ParserTestCase.parse6("parseFormalParameterList", "(a, [b : 0])", [ParserErr
orCode.WRONG_SEPARATOR_FOR_POSITIONAL_PARAMETER]); |
| 7510 } |
| 7511 void test_wrongTerminatorForParameterGroup_named() { |
| 7512 ParserTestCase.parse6("parseFormalParameterList", "(a, {b, c])", [ParserErro
rCode.WRONG_TERMINATOR_FOR_PARAMETER_GROUP]); |
| 7513 } |
| 7514 void test_wrongTerminatorForParameterGroup_optional() { |
| 7515 ParserTestCase.parse6("parseFormalParameterList", "(a, [b, c})", [ParserErro
rCode.WRONG_TERMINATOR_FOR_PARAMETER_GROUP]); |
| 7416 } | 7516 } |
| 7417 static dartSuite() { | 7517 static dartSuite() { |
| 7418 _ut.group('ErrorParserTest', () { | 7518 _ut.group('ErrorParserTest', () { |
| 7419 _ut.test('test_abstractClassMember_constructor', () { | 7519 _ut.test('test_abstractClassMember_constructor', () { |
| 7420 final __test = new ErrorParserTest(); | 7520 final __test = new ErrorParserTest(); |
| 7421 runJUnitTest(__test, __test.test_abstractClassMember_constructor); | 7521 runJUnitTest(__test, __test.test_abstractClassMember_constructor); |
| 7422 }); | 7522 }); |
| 7423 _ut.test('test_abstractClassMember_field', () { | 7523 _ut.test('test_abstractClassMember_field', () { |
| 7424 final __test = new ErrorParserTest(); | 7524 final __test = new ErrorParserTest(); |
| 7425 runJUnitTest(__test, __test.test_abstractClassMember_field); | 7525 runJUnitTest(__test, __test.test_abstractClassMember_field); |
| (...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7857 runJUnitTest(__test, __test.test_missingIdentifier_number); | 7957 runJUnitTest(__test, __test.test_missingIdentifier_number); |
| 7858 }); | 7958 }); |
| 7859 _ut.test('test_missingNameInLibraryDirective', () { | 7959 _ut.test('test_missingNameInLibraryDirective', () { |
| 7860 final __test = new ErrorParserTest(); | 7960 final __test = new ErrorParserTest(); |
| 7861 runJUnitTest(__test, __test.test_missingNameInLibraryDirective); | 7961 runJUnitTest(__test, __test.test_missingNameInLibraryDirective); |
| 7862 }); | 7962 }); |
| 7863 _ut.test('test_missingNameInPartOfDirective', () { | 7963 _ut.test('test_missingNameInPartOfDirective', () { |
| 7864 final __test = new ErrorParserTest(); | 7964 final __test = new ErrorParserTest(); |
| 7865 runJUnitTest(__test, __test.test_missingNameInPartOfDirective); | 7965 runJUnitTest(__test, __test.test_missingNameInPartOfDirective); |
| 7866 }); | 7966 }); |
| 7967 _ut.test('test_missingTerminatorForParameterGroup_named', () { |
| 7968 final __test = new ErrorParserTest(); |
| 7969 runJUnitTest(__test, __test.test_missingTerminatorForParameterGroup_name
d); |
| 7970 }); |
| 7971 _ut.test('test_missingTerminatorForParameterGroup_optional', () { |
| 7972 final __test = new ErrorParserTest(); |
| 7973 runJUnitTest(__test, __test.test_missingTerminatorForParameterGroup_opti
onal); |
| 7974 }); |
| 7867 _ut.test('test_missingTypedefParameters_nonVoid', () { | 7975 _ut.test('test_missingTypedefParameters_nonVoid', () { |
| 7868 final __test = new ErrorParserTest(); | 7976 final __test = new ErrorParserTest(); |
| 7869 runJUnitTest(__test, __test.test_missingTypedefParameters_nonVoid); | 7977 runJUnitTest(__test, __test.test_missingTypedefParameters_nonVoid); |
| 7870 }); | 7978 }); |
| 7871 _ut.test('test_missingTypedefParameters_typeParameters', () { | 7979 _ut.test('test_missingTypedefParameters_typeParameters', () { |
| 7872 final __test = new ErrorParserTest(); | 7980 final __test = new ErrorParserTest(); |
| 7873 runJUnitTest(__test, __test.test_missingTypedefParameters_typeParameters
); | 7981 runJUnitTest(__test, __test.test_missingTypedefParameters_typeParameters
); |
| 7874 }); | 7982 }); |
| 7875 _ut.test('test_missingTypedefParameters_void', () { | 7983 _ut.test('test_missingTypedefParameters_void', () { |
| 7876 final __test = new ErrorParserTest(); | 7984 final __test = new ErrorParserTest(); |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7977 runJUnitTest(__test, __test.test_staticTopLevelDeclaration_class); | 8085 runJUnitTest(__test, __test.test_staticTopLevelDeclaration_class); |
| 7978 }); | 8086 }); |
| 7979 _ut.test('test_staticTopLevelDeclaration_typedef', () { | 8087 _ut.test('test_staticTopLevelDeclaration_typedef', () { |
| 7980 final __test = new ErrorParserTest(); | 8088 final __test = new ErrorParserTest(); |
| 7981 runJUnitTest(__test, __test.test_staticTopLevelDeclaration_typedef); | 8089 runJUnitTest(__test, __test.test_staticTopLevelDeclaration_typedef); |
| 7982 }); | 8090 }); |
| 7983 _ut.test('test_staticTopLevelDeclaration_variable', () { | 8091 _ut.test('test_staticTopLevelDeclaration_variable', () { |
| 7984 final __test = new ErrorParserTest(); | 8092 final __test = new ErrorParserTest(); |
| 7985 runJUnitTest(__test, __test.test_staticTopLevelDeclaration_variable); | 8093 runJUnitTest(__test, __test.test_staticTopLevelDeclaration_variable); |
| 7986 }); | 8094 }); |
| 8095 _ut.test('test_unexpectedTerminatorForParameterGroup_named', () { |
| 8096 final __test = new ErrorParserTest(); |
| 8097 runJUnitTest(__test, __test.test_unexpectedTerminatorForParameterGroup_n
amed); |
| 8098 }); |
| 8099 _ut.test('test_unexpectedTerminatorForParameterGroup_optional', () { |
| 8100 final __test = new ErrorParserTest(); |
| 8101 runJUnitTest(__test, __test.test_unexpectedTerminatorForParameterGroup_o
ptional); |
| 8102 }); |
| 7987 _ut.test('test_unexpectedToken_semicolonBetweenClassMembers', () { | 8103 _ut.test('test_unexpectedToken_semicolonBetweenClassMembers', () { |
| 7988 final __test = new ErrorParserTest(); | 8104 final __test = new ErrorParserTest(); |
| 7989 runJUnitTest(__test, __test.test_unexpectedToken_semicolonBetweenClassMe
mbers); | 8105 runJUnitTest(__test, __test.test_unexpectedToken_semicolonBetweenClassMe
mbers); |
| 7990 }); | 8106 }); |
| 7991 _ut.test('test_unexpectedToken_semicolonBetweenCompilationUnitMembers', ()
{ | 8107 _ut.test('test_unexpectedToken_semicolonBetweenCompilationUnitMembers', ()
{ |
| 7992 final __test = new ErrorParserTest(); | 8108 final __test = new ErrorParserTest(); |
| 7993 runJUnitTest(__test, __test.test_unexpectedToken_semicolonBetweenCompila
tionUnitMembers); | 8109 runJUnitTest(__test, __test.test_unexpectedToken_semicolonBetweenCompila
tionUnitMembers); |
| 7994 }); | 8110 }); |
| 7995 _ut.test('test_useOfUnaryPlusOperator', () { | 8111 _ut.test('test_useOfUnaryPlusOperator', () { |
| 7996 final __test = new ErrorParserTest(); | 8112 final __test = new ErrorParserTest(); |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8033 runJUnitTest(__test, __test.test_withWithoutExtends); | 8149 runJUnitTest(__test, __test.test_withWithoutExtends); |
| 8034 }); | 8150 }); |
| 8035 _ut.test('test_wrongSeparatorForNamedParameter', () { | 8151 _ut.test('test_wrongSeparatorForNamedParameter', () { |
| 8036 final __test = new ErrorParserTest(); | 8152 final __test = new ErrorParserTest(); |
| 8037 runJUnitTest(__test, __test.test_wrongSeparatorForNamedParameter); | 8153 runJUnitTest(__test, __test.test_wrongSeparatorForNamedParameter); |
| 8038 }); | 8154 }); |
| 8039 _ut.test('test_wrongSeparatorForPositionalParameter', () { | 8155 _ut.test('test_wrongSeparatorForPositionalParameter', () { |
| 8040 final __test = new ErrorParserTest(); | 8156 final __test = new ErrorParserTest(); |
| 8041 runJUnitTest(__test, __test.test_wrongSeparatorForPositionalParameter); | 8157 runJUnitTest(__test, __test.test_wrongSeparatorForPositionalParameter); |
| 8042 }); | 8158 }); |
| 8159 _ut.test('test_wrongTerminatorForParameterGroup_named', () { |
| 8160 final __test = new ErrorParserTest(); |
| 8161 runJUnitTest(__test, __test.test_wrongTerminatorForParameterGroup_named)
; |
| 8162 }); |
| 8163 _ut.test('test_wrongTerminatorForParameterGroup_optional', () { |
| 8164 final __test = new ErrorParserTest(); |
| 8165 runJUnitTest(__test, __test.test_wrongTerminatorForParameterGroup_option
al); |
| 8166 }); |
| 8043 }); | 8167 }); |
| 8044 } | 8168 } |
| 8045 } | 8169 } |
| 8046 main() { | 8170 main() { |
| 8047 ComplexParserTest.dartSuite(); | 8171 ComplexParserTest.dartSuite(); |
| 8048 ErrorParserTest.dartSuite(); | 8172 ErrorParserTest.dartSuite(); |
| 8049 RecoveryParserTest.dartSuite(); | 8173 RecoveryParserTest.dartSuite(); |
| 8050 SimpleParserTest.dartSuite(); | 8174 SimpleParserTest.dartSuite(); |
| 8051 } | 8175 } |
| 8052 Map<String, MethodTrampoline> _methodTable_Parser = <String, MethodTrampoline> { | 8176 Map<String, MethodTrampoline> _methodTable_Parser = <String, MethodTrampoline> { |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8084 'parseAssignableExpression_1': new MethodTrampoline(1, (Parser target, arg0) =
> target.parseAssignableExpression(arg0)), | 8208 'parseAssignableExpression_1': new MethodTrampoline(1, (Parser target, arg0) =
> target.parseAssignableExpression(arg0)), |
| 8085 'parseAssignableSelector_2': new MethodTrampoline(2, (Parser target, arg0, arg
1) => target.parseAssignableSelector(arg0, arg1)), | 8209 'parseAssignableSelector_2': new MethodTrampoline(2, (Parser target, arg0, arg
1) => target.parseAssignableSelector(arg0, arg1)), |
| 8086 'parseBitwiseAndExpression_0': new MethodTrampoline(0, (Parser target) => targ
et.parseBitwiseAndExpression()), | 8210 'parseBitwiseAndExpression_0': new MethodTrampoline(0, (Parser target) => targ
et.parseBitwiseAndExpression()), |
| 8087 'parseBitwiseOrExpression_0': new MethodTrampoline(0, (Parser target) => targe
t.parseBitwiseOrExpression()), | 8211 'parseBitwiseOrExpression_0': new MethodTrampoline(0, (Parser target) => targe
t.parseBitwiseOrExpression()), |
| 8088 'parseBitwiseXorExpression_0': new MethodTrampoline(0, (Parser target) => targ
et.parseBitwiseXorExpression()), | 8212 'parseBitwiseXorExpression_0': new MethodTrampoline(0, (Parser target) => targ
et.parseBitwiseXorExpression()), |
| 8089 'parseBlock_0': new MethodTrampoline(0, (Parser target) => target.parseBlock()
), | 8213 'parseBlock_0': new MethodTrampoline(0, (Parser target) => target.parseBlock()
), |
| 8090 'parseBreakStatement_0': new MethodTrampoline(0, (Parser target) => target.par
seBreakStatement()), | 8214 'parseBreakStatement_0': new MethodTrampoline(0, (Parser target) => target.par
seBreakStatement()), |
| 8091 'parseCascadeSection_0': new MethodTrampoline(0, (Parser target) => target.par
seCascadeSection()), | 8215 'parseCascadeSection_0': new MethodTrampoline(0, (Parser target) => target.par
seCascadeSection()), |
| 8092 'parseClassDeclaration_2': new MethodTrampoline(2, (Parser target, arg0, arg1)
=> target.parseClassDeclaration(arg0, arg1)), | 8216 'parseClassDeclaration_2': new MethodTrampoline(2, (Parser target, arg0, arg1)
=> target.parseClassDeclaration(arg0, arg1)), |
| 8093 'parseClassMember_1': new MethodTrampoline(1, (Parser target, arg0) => target.
parseClassMember(arg0)), | 8217 'parseClassMember_1': new MethodTrampoline(1, (Parser target, arg0) => target.
parseClassMember(arg0)), |
| 8094 'parseClassMembers_1': new MethodTrampoline(1, (Parser target, arg0) => target
.parseClassMembers(arg0)), | 8218 'parseClassMembers_2': new MethodTrampoline(2, (Parser target, arg0, arg1) =>
target.parseClassMembers(arg0, arg1)), |
| 8095 'parseClassTypeAlias_2': new MethodTrampoline(2, (Parser target, arg0, arg1) =
> target.parseClassTypeAlias(arg0, arg1)), | 8219 'parseClassTypeAlias_2': new MethodTrampoline(2, (Parser target, arg0, arg1) =
> target.parseClassTypeAlias(arg0, arg1)), |
| 8096 'parseCombinators_0': new MethodTrampoline(0, (Parser target) => target.parseC
ombinators()), | 8220 'parseCombinators_0': new MethodTrampoline(0, (Parser target) => target.parseC
ombinators()), |
| 8097 'parseCommentAndMetadata_0': new MethodTrampoline(0, (Parser target) => target
.parseCommentAndMetadata()), | 8221 'parseCommentAndMetadata_0': new MethodTrampoline(0, (Parser target) => target
.parseCommentAndMetadata()), |
| 8098 'parseCommentReference_2': new MethodTrampoline(2, (Parser target, arg0, arg1)
=> target.parseCommentReference(arg0, arg1)), | 8222 'parseCommentReference_2': new MethodTrampoline(2, (Parser target, arg0, arg1)
=> target.parseCommentReference(arg0, arg1)), |
| 8099 'parseCommentReferences_1': new MethodTrampoline(1, (Parser target, arg0) => t
arget.parseCommentReferences(arg0)), | 8223 'parseCommentReferences_1': new MethodTrampoline(1, (Parser target, arg0) => t
arget.parseCommentReferences(arg0)), |
| 8100 'parseCompilationUnit_0': new MethodTrampoline(0, (Parser target) => target.pa
rseCompilationUnit2()), | 8224 'parseCompilationUnit_0': new MethodTrampoline(0, (Parser target) => target.pa
rseCompilationUnit2()), |
| 8101 'parseCompilationUnitMember_1': new MethodTrampoline(1, (Parser target, arg0)
=> target.parseCompilationUnitMember(arg0)), | 8225 'parseCompilationUnitMember_1': new MethodTrampoline(1, (Parser target, arg0)
=> target.parseCompilationUnitMember(arg0)), |
| 8102 'parseConditionalExpression_0': new MethodTrampoline(0, (Parser target) => tar
get.parseConditionalExpression()), | 8226 'parseConditionalExpression_0': new MethodTrampoline(0, (Parser target) => tar
get.parseConditionalExpression()), |
| 8103 'parseConstExpression_0': new MethodTrampoline(0, (Parser target) => target.pa
rseConstExpression()), | 8227 'parseConstExpression_0': new MethodTrampoline(0, (Parser target) => target.pa
rseConstExpression()), |
| 8104 'parseConstructor_8': new MethodTrampoline(8, (Parser target, arg0, arg1, arg2
, arg3, arg4, arg5, arg6, arg7) => target.parseConstructor(arg0, arg1, arg2, arg
3, arg4, arg5, arg6, arg7)), | 8228 'parseConstructor_8': new MethodTrampoline(8, (Parser target, arg0, arg1, arg2
, arg3, arg4, arg5, arg6, arg7) => target.parseConstructor(arg0, arg1, arg2, arg
3, arg4, arg5, arg6, arg7)), |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8179 'parseUnaryExpression_0': new MethodTrampoline(0, (Parser target) => target.pa
rseUnaryExpression()), | 8303 'parseUnaryExpression_0': new MethodTrampoline(0, (Parser target) => target.pa
rseUnaryExpression()), |
| 8180 'parseVariableDeclaration_0': new MethodTrampoline(0, (Parser target) => targe
t.parseVariableDeclaration()), | 8304 'parseVariableDeclaration_0': new MethodTrampoline(0, (Parser target) => targe
t.parseVariableDeclaration()), |
| 8181 'parseVariableDeclarationList_0': new MethodTrampoline(0, (Parser target) => t
arget.parseVariableDeclarationList()), | 8305 'parseVariableDeclarationList_0': new MethodTrampoline(0, (Parser target) => t
arget.parseVariableDeclarationList()), |
| 8182 'parseVariableDeclarationList_2': new MethodTrampoline(2, (Parser target, arg0
, arg1) => target.parseVariableDeclarationList2(arg0, arg1)), | 8306 'parseVariableDeclarationList_2': new MethodTrampoline(2, (Parser target, arg0
, arg1) => target.parseVariableDeclarationList2(arg0, arg1)), |
| 8183 'parseVariableDeclarationStatement_0': new MethodTrampoline(0, (Parser target)
=> target.parseVariableDeclarationStatement()), | 8307 'parseVariableDeclarationStatement_0': new MethodTrampoline(0, (Parser target)
=> target.parseVariableDeclarationStatement()), |
| 8184 'parseWhileStatement_0': new MethodTrampoline(0, (Parser target) => target.par
seWhileStatement()), | 8308 'parseWhileStatement_0': new MethodTrampoline(0, (Parser target) => target.par
seWhileStatement()), |
| 8185 'parseWithClause_0': new MethodTrampoline(0, (Parser target) => target.parseWi
thClause()), | 8309 'parseWithClause_0': new MethodTrampoline(0, (Parser target) => target.parseWi
thClause()), |
| 8186 'peek_0': new MethodTrampoline(0, (Parser target) => target.peek()), | 8310 'peek_0': new MethodTrampoline(0, (Parser target) => target.peek()), |
| 8187 'peek_1': new MethodTrampoline(1, (Parser target, arg0) => target.peek2(arg0))
, | 8311 'peek_1': new MethodTrampoline(1, (Parser target, arg0) => target.peek2(arg0))
, |
| 8188 'reportError_3': new MethodTrampoline(3, (Parser target, arg0, arg1, arg2) =>
target.reportError(arg0, arg1, arg2)), | 8312 'reportError_3': new MethodTrampoline(3, (Parser target, arg0, arg1, arg2) =>
target.reportError(arg0, arg1, arg2)), |
| 8189 'reportError_2': new MethodTrampoline(2, (Parser target, arg0, arg1) => target
.reportError3(arg0, arg1)), | 8313 'reportError_2': new MethodTrampoline(2, (Parser target, arg0, arg1) => target
.reportError4(arg0, arg1)), |
| 8190 'skipFinalConstVarOrType_1': new MethodTrampoline(1, (Parser target, arg0) =>
target.skipFinalConstVarOrType(arg0)), | 8314 'skipFinalConstVarOrType_1': new MethodTrampoline(1, (Parser target, arg0) =>
target.skipFinalConstVarOrType(arg0)), |
| 8191 'skipFormalParameterList_1': new MethodTrampoline(1, (Parser target, arg0) =>
target.skipFormalParameterList(arg0)), | 8315 'skipFormalParameterList_1': new MethodTrampoline(1, (Parser target, arg0) =>
target.skipFormalParameterList(arg0)), |
| 8192 'skipPastMatchingToken_1': new MethodTrampoline(1, (Parser target, arg0) => ta
rget.skipPastMatchingToken(arg0)), | 8316 'skipPastMatchingToken_1': new MethodTrampoline(1, (Parser target, arg0) => ta
rget.skipPastMatchingToken(arg0)), |
| 8193 'skipPrefixedIdentifier_1': new MethodTrampoline(1, (Parser target, arg0) => t
arget.skipPrefixedIdentifier(arg0)), | 8317 'skipPrefixedIdentifier_1': new MethodTrampoline(1, (Parser target, arg0) => t
arget.skipPrefixedIdentifier(arg0)), |
| 8194 'skipReturnType_1': new MethodTrampoline(1, (Parser target, arg0) => target.sk
ipReturnType(arg0)), | 8318 'skipReturnType_1': new MethodTrampoline(1, (Parser target, arg0) => target.sk
ipReturnType(arg0)), |
| 8195 'skipSimpleIdentifier_1': new MethodTrampoline(1, (Parser target, arg0) => tar
get.skipSimpleIdentifier(arg0)), | 8319 'skipSimpleIdentifier_1': new MethodTrampoline(1, (Parser target, arg0) => tar
get.skipSimpleIdentifier(arg0)), |
| 8196 'skipStringInterpolation_1': new MethodTrampoline(1, (Parser target, arg0) =>
target.skipStringInterpolation(arg0)), | 8320 'skipStringInterpolation_1': new MethodTrampoline(1, (Parser target, arg0) =>
target.skipStringInterpolation(arg0)), |
| 8197 'skipStringLiteral_1': new MethodTrampoline(1, (Parser target, arg0) => target
.skipStringLiteral(arg0)), | 8321 'skipStringLiteral_1': new MethodTrampoline(1, (Parser target, arg0) => target
.skipStringLiteral(arg0)), |
| 8198 'skipTypeArgumentList_1': new MethodTrampoline(1, (Parser target, arg0) => tar
get.skipTypeArgumentList(arg0)), | 8322 'skipTypeArgumentList_1': new MethodTrampoline(1, (Parser target, arg0) => tar
get.skipTypeArgumentList(arg0)), |
| 8199 'skipTypeName_1': new MethodTrampoline(1, (Parser target, arg0) => target.skip
TypeName(arg0)), | 8323 'skipTypeName_1': new MethodTrampoline(1, (Parser target, arg0) => target.skip
TypeName(arg0)), |
| 8200 'skipTypeParameterList_1': new MethodTrampoline(1, (Parser target, arg0) => ta
rget.skipTypeParameterList(arg0)), | 8324 'skipTypeParameterList_1': new MethodTrampoline(1, (Parser target, arg0) => ta
rget.skipTypeParameterList(arg0)), |
| 8201 'translateCharacter_3': new MethodTrampoline(3, (Parser target, arg0, arg1, ar
g2) => target.translateCharacter(arg0, arg1, arg2)), | 8325 'translateCharacter_3': new MethodTrampoline(3, (Parser target, arg0, arg1, ar
g2) => target.translateCharacter(arg0, arg1, arg2)), |
| 8202 'validateFormalParameterList_1': new MethodTrampoline(1, (Parser target, arg0)
=> target.validateFormalParameterList(arg0)), | 8326 'validateFormalParameterList_1': new MethodTrampoline(1, (Parser target, arg0)
=> target.validateFormalParameterList(arg0)), |
| 8203 'validateModifiersForClass_1': new MethodTrampoline(1, (Parser target, arg0) =
> target.validateModifiersForClass(arg0)), | 8327 'validateModifiersForClass_1': new MethodTrampoline(1, (Parser target, arg0) =
> target.validateModifiersForClass(arg0)), |
| 8204 'validateModifiersForConstructor_1': new MethodTrampoline(1, (Parser target, a
rg0) => target.validateModifiersForConstructor(arg0)), | 8328 'validateModifiersForConstructor_1': new MethodTrampoline(1, (Parser target, a
rg0) => target.validateModifiersForConstructor(arg0)), |
| 8205 'validateModifiersForField_1': new MethodTrampoline(1, (Parser target, arg0) =
> target.validateModifiersForField(arg0)), | 8329 'validateModifiersForField_1': new MethodTrampoline(1, (Parser target, arg0) =
> target.validateModifiersForField(arg0)), |
| 8206 'validateModifiersForGetterOrSetterOrMethod_1': new MethodTrampoline(1, (Parse
r target, arg0) => target.validateModifiersForGetterOrSetterOrMethod(arg0)), | 8330 'validateModifiersForGetterOrSetterOrMethod_1': new MethodTrampoline(1, (Parse
r target, arg0) => target.validateModifiersForGetterOrSetterOrMethod(arg0)), |
| 8207 'validateModifiersForOperator_1': new MethodTrampoline(1, (Parser target, arg0
) => target.validateModifiersForOperator(arg0)), | 8331 'validateModifiersForOperator_1': new MethodTrampoline(1, (Parser target, arg0
) => target.validateModifiersForOperator(arg0)), |
| 8208 'validateModifiersForTopLevelDeclaration_1': new MethodTrampoline(1, (Parser t
arget, arg0) => target.validateModifiersForTopLevelDeclaration(arg0)), | 8332 'validateModifiersForTopLevelDeclaration_1': new MethodTrampoline(1, (Parser t
arget, arg0) => target.validateModifiersForTopLevelDeclaration(arg0)), |
| 8209 'validateModifiersForTopLevelFunction_1': new MethodTrampoline(1, (Parser targ
et, arg0) => target.validateModifiersForTopLevelFunction(arg0)), | 8333 'validateModifiersForTopLevelFunction_1': new MethodTrampoline(1, (Parser targ
et, arg0) => target.validateModifiersForTopLevelFunction(arg0)), |
| 8210 'validateModifiersForTopLevelVariable_1': new MethodTrampoline(1, (Parser targ
et, arg0) => target.validateModifiersForTopLevelVariable(arg0)), | 8334 'validateModifiersForTopLevelVariable_1': new MethodTrampoline(1, (Parser targ
et, arg0) => target.validateModifiersForTopLevelVariable(arg0)), |
| 8211 'validateModifiersForTypedef_1': new MethodTrampoline(1, (Parser target, arg0)
=> target.validateModifiersForTypedef(arg0)),}; | 8335 'validateModifiersForTypedef_1': new MethodTrampoline(1, (Parser target, arg0)
=> target.validateModifiersForTypedef(arg0)),}; |
| 8212 | 8336 |
| 8213 | 8337 |
| 8214 Object invokeParserMethodImpl(Parser parser, String methodName, List<Object> obj
ects, Token tokenStream) { | 8338 Object invokeParserMethodImpl(Parser parser, String methodName, List<Object> obj
ects, Token tokenStream) { |
| 8215 parser.currentToken = tokenStream; | 8339 parser.currentToken = tokenStream; |
| 8216 MethodTrampoline method = _methodTable_Parser['${methodName}_${objects.length}
']; | 8340 MethodTrampoline method = _methodTable_Parser['${methodName}_${objects.length}
']; |
| 8217 return method.invoke(parser, objects); | 8341 return method.invoke(parser, objects); |
| 8218 } | 8342 } |
| OLD | NEW |