| 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'; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 * <p> | 28 * <p> |
| 29 * The given source is scanned and the parser is initialized to start with the
first token in the | 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. | 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 | 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 | 32 * @param objects the values of the arguments to the method |
| 33 * @param source the source to be parsed by the parse method | 33 * @param source the source to be parsed by the parse method |
| 34 * @return the result of invoking the method | 34 * @return the result of invoking the method |
| 35 * @throws Exception if the method could not be invoked or throws an exception | 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 | 36 * @throws AssertionFailedError if the result is {@code null} or if any errors
are produced |
| 37 */ | 37 */ |
| 38 static Object parse(String methodName, List<Object> objects, String source) =>
parse2(methodName, objects, source, new List<AnalysisError>.fixedLength(0)); | 38 static Object parse(String methodName, List<Object> objects, String source) =>
parse3(methodName, objects, source, new List<AnalysisError>.fixedLength(0)); |
| 39 /** | 39 /** |
| 40 * Invoke a parse method in {@link Parser}. The method is assumed to have the
given number and | 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. | 41 * type of parameters and will be invoked with the given arguments. |
| 42 * <p> | 42 * <p> |
| 43 * The given source is scanned and the parser is initialized to start with the
first token in the | 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. | 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 | 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 | 46 * @param objects the values of the arguments to the method |
| 47 * @param source the source to be parsed by the parse 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 | 48 * @param errorCodes the error codes of the errors that should be generated |
| 49 * @return the result of invoking the method | 49 * @return the result of invoking the method |
| 50 * @throws Exception if the method could not be invoked or throws an exception | 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 | 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 | 52 * scanning and parsing the source do not match the expected errors |
| 53 */ | 53 */ |
| 54 static Object parse2(String methodName, List<Object> objects, String source, L
ist<AnalysisError> errors) { | 54 static Object parse3(String methodName, List<Object> objects, String source, L
ist<AnalysisError> errors) { |
| 55 GatheringErrorListener listener = new GatheringErrorListener(); | 55 GatheringErrorListener listener = new GatheringErrorListener(); |
| 56 Object result = invokeParserMethod(methodName, objects, source, listener); | 56 Object result = invokeParserMethod(methodName, objects, source, listener); |
| 57 listener.assertErrors(errors); | 57 listener.assertErrors(errors); |
| 58 return result; | 58 return result; |
| 59 } | 59 } |
| 60 /** | 60 /** |
| 61 * Invoke a parse method in {@link Parser}. The method is assumed to have the
given number and | 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. | 62 * type of parameters and will be invoked with the given arguments. |
| 63 * <p> | 63 * <p> |
| 64 * The given source is scanned and the parser is initialized to start with the
first token in the | 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. | 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 | 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 | 67 * @param objects the values of the arguments to the method |
| 68 * @param source the source to be parsed by the parse 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 | 69 * @param errorCodes the error codes of the errors that should be generated |
| 70 * @return the result of invoking the method | 70 * @return the result of invoking the method |
| 71 * @throws Exception if the method could not be invoked or throws an exception | 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 | 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 | 73 * scanning and parsing the source do not match the expected errors |
| 74 */ | 74 */ |
| 75 static Object parse3(String methodName, List<Object> objects, String source, L
ist<ErrorCode> errorCodes) { | 75 static Object parse4(String methodName, List<Object> objects, String source, L
ist<ErrorCode> errorCodes) { |
| 76 GatheringErrorListener listener = new GatheringErrorListener(); | 76 GatheringErrorListener listener = new GatheringErrorListener(); |
| 77 Object result = invokeParserMethod(methodName, objects, source, listener); | 77 Object result = invokeParserMethod(methodName, objects, source, listener); |
| 78 listener.assertErrors2(errorCodes); | 78 listener.assertErrors2(errorCodes); |
| 79 return result; | 79 return result; |
| 80 } | 80 } |
| 81 /** | 81 /** |
| 82 * Invoke a parse method in {@link Parser}. The method is assumed to have no a
rguments. | 82 * Invoke a parse method in {@link Parser}. The method is assumed to have no a
rguments. |
| 83 * <p> | 83 * <p> |
| 84 * The given source is scanned and the parser is initialized to start with the
first token in the | 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. | 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 | 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 | 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 | 88 * @param errorCodes the error codes of the errors that should be generated |
| 89 * @return the result of invoking the method | 89 * @return the result of invoking the method |
| 90 * @throws Exception if the method could not be invoked or throws an exception | 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 | 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 | 92 * scanning and parsing the source do not match the expected errors |
| 93 */ | 93 */ |
| 94 static Object parse4(String methodName, String source, List<ErrorCode> errorCo
des) => parse3(methodName, ParserTestCase._EMPTY_ARGUMENTS, source, errorCodes); | 94 static Object parse5(String methodName, String source, List<ErrorCode> errorCo
des) => parse4(methodName, _EMPTY_ARGUMENTS, source, errorCodes); |
| 95 /** | 95 /** |
| 96 * Parse the given source as a compilation unit. | 96 * Parse the given source as a compilation unit. |
| 97 * @param source the source to be parsed | 97 * @param source the source to be parsed |
| 98 * @param errorCodes the error codes of the errors that are expected to be fou
nd | 98 * @param errorCodes the error codes of the errors that are expected to be fou
nd |
| 99 * @return the compilation unit that was parsed | 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 | 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} | 101 * not match those that are expected, or if the result would have been {@code
null} |
| 102 */ | 102 */ |
| 103 static CompilationUnit parseCompilationUnit(String source, List<ErrorCode> err
orCodes) { | 103 static CompilationUnit parseCompilationUnit(String source, List<ErrorCode> err
orCodes) { |
| 104 GatheringErrorListener listener = new GatheringErrorListener(); | 104 GatheringErrorListener listener = new GatheringErrorListener(); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 121 */ | 121 */ |
| 122 static Expression parseExpression(String source, List<ErrorCode> errorCodes) { | 122 static Expression parseExpression(String source, List<ErrorCode> errorCodes) { |
| 123 GatheringErrorListener listener = new GatheringErrorListener(); | 123 GatheringErrorListener listener = new GatheringErrorListener(); |
| 124 StringScanner scanner = new StringScanner(null, source, listener); | 124 StringScanner scanner = new StringScanner(null, source, listener); |
| 125 listener.setLineInfo(new TestSource(), scanner.lineStarts); | 125 listener.setLineInfo(new TestSource(), scanner.lineStarts); |
| 126 Token token = scanner.tokenize(); | 126 Token token = scanner.tokenize(); |
| 127 Parser parser = new Parser(null, listener); | 127 Parser parser = new Parser(null, listener); |
| 128 Expression expression = parser.parseExpression(token); | 128 Expression expression = parser.parseExpression(token); |
| 129 JUnitTestCase.assertNotNull(expression); | 129 JUnitTestCase.assertNotNull(expression); |
| 130 listener.assertErrors2(errorCodes); | 130 listener.assertErrors2(errorCodes); |
| 131 return expression as Expression; | 131 return (expression as Expression); |
| 132 } | 132 } |
| 133 /** | 133 /** |
| 134 * Parse the given source as a statement. | 134 * Parse the given source as a statement. |
| 135 * @param source the source to be parsed | 135 * @param source the source to be parsed |
| 136 * @param errorCodes the error codes of the errors that are expected to be fou
nd | 136 * @param errorCodes the error codes of the errors that are expected to be fou
nd |
| 137 * @return the statement that was parsed | 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 | 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} | 139 * not match those that are expected, or if the result would have been {@code
null} |
| 140 */ | 140 */ |
| 141 static Statement parseStatement(String source, List<ErrorCode> errorCodes) { | 141 static Statement parseStatement(String source, List<ErrorCode> errorCodes) { |
| 142 GatheringErrorListener listener = new GatheringErrorListener(); | 142 GatheringErrorListener listener = new GatheringErrorListener(); |
| 143 StringScanner scanner = new StringScanner(null, source, listener); | 143 StringScanner scanner = new StringScanner(null, source, listener); |
| 144 listener.setLineInfo(new TestSource(), scanner.lineStarts); | 144 listener.setLineInfo(new TestSource(), scanner.lineStarts); |
| 145 Token token = scanner.tokenize(); | 145 Token token = scanner.tokenize(); |
| 146 Parser parser = new Parser(null, listener); | 146 Parser parser = new Parser(null, listener); |
| 147 Statement statement = parser.parseStatement(token); | 147 Statement statement = parser.parseStatement(token); |
| 148 JUnitTestCase.assertNotNull(statement); | 148 JUnitTestCase.assertNotNull(statement); |
| 149 listener.assertErrors2(errorCodes); | 149 listener.assertErrors2(errorCodes); |
| 150 return statement as Statement; | 150 return (statement as Statement); |
| 151 } | 151 } |
| 152 /** | 152 /** |
| 153 * Parse the given source as a sequence of statements. | 153 * Parse the given source as a sequence of statements. |
| 154 * @param source the source to be parsed | 154 * @param source the source to be parsed |
| 155 * @param expectedCount the number of statements that are expected | 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 | 156 * @param errorCodes the error codes of the errors that are expected to be fou
nd |
| 157 * @return the statements that were parsed | 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 | 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 | 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} | 160 * are expected, or if the result would have been {@code null} |
| (...skipping 24 matching lines...) Expand all Loading... |
| 185 * @throws AssertionFailedError if the result is {@code null} or the errors pr
oduced while | 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 | 186 * scanning and parsing the source do not match the expected errors |
| 187 */ | 187 */ |
| 188 static Object invokeParserMethod(String methodName, List<Object> objects, Stri
ng source, GatheringErrorListener listener) { | 188 static Object invokeParserMethod(String methodName, List<Object> objects, Stri
ng source, GatheringErrorListener listener) { |
| 189 StringScanner scanner = new StringScanner(null, source, listener); | 189 StringScanner scanner = new StringScanner(null, source, listener); |
| 190 Token tokenStream = scanner.tokenize(); | 190 Token tokenStream = scanner.tokenize(); |
| 191 listener.setLineInfo(new TestSource(), scanner.lineStarts); | 191 listener.setLineInfo(new TestSource(), scanner.lineStarts); |
| 192 Parser parser = new Parser(null, listener); | 192 Parser parser = new Parser(null, listener); |
| 193 Object result = invokeParserMethodImpl(parser, methodName, objects, tokenStr
eam); | 193 Object result = invokeParserMethodImpl(parser, methodName, objects, tokenStr
eam); |
| 194 JUnitTestCase.assertNotNull(result); | 194 JUnitTestCase.assertNotNull(result); |
| 195 return result as Object; | 195 return (result as Object); |
| 196 } | 196 } |
| 197 /** | 197 /** |
| 198 * Invoke a method in {@link Parser}. The method is assumed to have no argumen
ts. | 198 * Invoke a method in {@link Parser}. The method is assumed to have no argumen
ts. |
| 199 * <p> | 199 * <p> |
| 200 * The given source is scanned and the parser is initialized to start with the
first token in the | 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. | 201 * source before the method is invoked. |
| 202 * @param methodName the name of the method that should be 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 | 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 | 204 * @param listener the error listener that will be used for both scanning and
parsing |
| 205 * @return the result of invoking the method | 205 * @return the result of invoking the method |
| 206 * @throws Exception if the method could not be invoked or throws an exception | 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 | 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 | 208 * scanning and parsing the source do not match the expected errors |
| 209 */ | 209 */ |
| 210 static Object invokeParserMethod2(String methodName, String source, GatheringE
rrorListener listener) => invokeParserMethod(methodName, ParserTestCase._EMPTY_A
RGUMENTS, source, listener); | 210 static Object invokeParserMethod2(String methodName, String source, GatheringE
rrorListener listener) => invokeParserMethod(methodName, _EMPTY_ARGUMENTS, sourc
e, listener); |
| 211 /** | 211 /** |
| 212 * Return a CommentAndMetadata object with the given values that can be used f
or testing. | 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 | 213 * @param comment the comment to be wrapped in the object |
| 214 * @param annotations the annotations 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 | 215 * @return a CommentAndMetadata object that can be used for testing |
| 216 */ | 216 */ |
| 217 CommentAndMetadata commentAndMetadata(Comment comment, List<Annotation> annota
tions) { | 217 CommentAndMetadata commentAndMetadata(Comment comment, List<Annotation> annota
tions) { |
| 218 List<Annotation> metadata = new List<Annotation>(); | 218 List<Annotation> metadata = new List<Annotation>(); |
| 219 for (Annotation annotation in annotations) { | 219 for (Annotation annotation in annotations) { |
| 220 metadata.add(annotation); | 220 metadata.add(annotation); |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 } | 257 } |
| 258 Object visitNode(ASTNode node) { | 258 Object visitNode(ASTNode node) { |
| 259 validate(node); | 259 validate(node); |
| 260 return super.visitNode(node); | 260 return super.visitNode(node); |
| 261 } | 261 } |
| 262 /** | 262 /** |
| 263 * Validate that the given AST node is correctly constructed. | 263 * Validate that the given AST node is correctly constructed. |
| 264 * @param node the AST node being validated | 264 * @param node the AST node being validated |
| 265 */ | 265 */ |
| 266 void validate(ASTNode node) { | 266 void validate(ASTNode node) { |
| 267 ASTNode parent12 = node.parent; | 267 ASTNode parent11 = node.parent; |
| 268 if (node is CompilationUnit) { | 268 if (node is CompilationUnit) { |
| 269 if (parent12 != null) { | 269 if (parent11 != null) { |
| 270 _errors.add("Compilation units should not have a parent"); | 270 _errors.add("Compilation units should not have a parent"); |
| 271 } | 271 } |
| 272 } else { | 272 } else { |
| 273 if (parent12 == null) { | 273 if (parent11 == null) { |
| 274 _errors.add("No parent for ${node.runtimeType.toString()}"); | 274 _errors.add("No parent for ${node.runtimeType.toString()}"); |
| 275 } | 275 } |
| 276 } | 276 } |
| 277 if (node.beginToken == null) { | 277 if (node.beginToken == null) { |
| 278 _errors.add("No begin token for ${node.runtimeType.toString()}"); | 278 _errors.add("No begin token for ${node.runtimeType.toString()}"); |
| 279 } | 279 } |
| 280 if (node.endToken == null) { | 280 if (node.endToken == null) { |
| 281 _errors.add("No end token for ${node.runtimeType.toString()}"); | 281 _errors.add("No end token for ${node.runtimeType.toString()}"); |
| 282 } | 282 } |
| 283 int nodeStart = node.offset; | 283 int nodeStart = node.offset; |
| 284 int nodeLength = node.length; | 284 int nodeLength = node.length; |
| 285 if (nodeStart < 0 || nodeLength < 0) { | 285 if (nodeStart < 0 || nodeLength < 0) { |
| 286 _errors.add("No source info for ${node.runtimeType.toString()}"); | 286 _errors.add("No source info for ${node.runtimeType.toString()}"); |
| 287 } | 287 } |
| 288 if (parent12 != null) { | 288 if (parent11 != null) { |
| 289 int nodeEnd = nodeStart + nodeLength; | 289 int nodeEnd = nodeStart + nodeLength; |
| 290 int parentStart = parent12.offset; | 290 int parentStart = parent11.offset; |
| 291 int parentEnd = parentStart + parent12.length; | 291 int parentEnd = parentStart + parent11.length; |
| 292 if (nodeStart < parentStart) { | 292 if (nodeStart < parentStart) { |
| 293 _errors.add("Invalid source start (${nodeStart}) for ${node.runtimeType.
toString()} inside ${parent12.runtimeType.toString()} (${parentStart})"); | 293 _errors.add("Invalid source start (${nodeStart}) for ${node.runtimeType.
toString()} inside ${parent11.runtimeType.toString()} (${parentStart})"); |
| 294 } | 294 } |
| 295 if (nodeEnd > parentEnd) { | 295 if (nodeEnd > parentEnd) { |
| 296 _errors.add("Invalid source end (${nodeEnd}) for ${node.runtimeType.toSt
ring()} inside ${parent12.runtimeType.toString()} (${parentStart})"); | 296 _errors.add("Invalid source end (${nodeEnd}) for ${node.runtimeType.toSt
ring()} inside ${parent11.runtimeType.toString()} (${parentStart})"); |
| 297 } | 297 } |
| 298 } | 298 } |
| 299 } | 299 } |
| 300 } | 300 } |
| 301 /** | 301 /** |
| 302 * The class {@code RecoveryParserTest} defines parser tests that test the parsi
ng of invalid code | 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. | 303 * sequences to ensure that the correct recovery steps are taken in the parser. |
| 304 */ | 304 */ |
| 305 class RecoveryParserTest extends ParserTestCase { | 305 class RecoveryParserTest extends ParserTestCase { |
| 306 void test_additiveExpression_missing_LHS() { | 306 void test_additiveExpression_missing_LHS() { |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 JUnitTestCase.assertTrue(expression.identifier.isSynthetic()); | 342 JUnitTestCase.assertTrue(expression.identifier.isSynthetic()); |
| 343 } | 343 } |
| 344 void test_assignmentExpression_missing_compound1() { | 344 void test_assignmentExpression_missing_compound1() { |
| 345 AssignmentExpression expression = ParserTestCase.parseExpression("= y = 0",
[]); | 345 AssignmentExpression expression = ParserTestCase.parseExpression("= y = 0",
[]); |
| 346 Expression syntheticExpression = expression.leftHandSide; | 346 Expression syntheticExpression = expression.leftHandSide; |
| 347 EngineTestCase.assertInstanceOf(SimpleIdentifier, syntheticExpression); | 347 EngineTestCase.assertInstanceOf(SimpleIdentifier, syntheticExpression); |
| 348 JUnitTestCase.assertTrue(syntheticExpression.isSynthetic()); | 348 JUnitTestCase.assertTrue(syntheticExpression.isSynthetic()); |
| 349 } | 349 } |
| 350 void test_assignmentExpression_missing_compound2() { | 350 void test_assignmentExpression_missing_compound2() { |
| 351 AssignmentExpression expression = ParserTestCase.parseExpression("x = = 0",
[]); | 351 AssignmentExpression expression = ParserTestCase.parseExpression("x = = 0",
[]); |
| 352 Expression syntheticExpression = (expression.rightHandSide as AssignmentExpr
ession).leftHandSide; | 352 Expression syntheticExpression = ((expression.rightHandSide as AssignmentExp
ression)).leftHandSide; |
| 353 EngineTestCase.assertInstanceOf(SimpleIdentifier, syntheticExpression); | 353 EngineTestCase.assertInstanceOf(SimpleIdentifier, syntheticExpression); |
| 354 JUnitTestCase.assertTrue(syntheticExpression.isSynthetic()); | 354 JUnitTestCase.assertTrue(syntheticExpression.isSynthetic()); |
| 355 } | 355 } |
| 356 void test_assignmentExpression_missing_compound3() { | 356 void test_assignmentExpression_missing_compound3() { |
| 357 AssignmentExpression expression = ParserTestCase.parseExpression("x = y =",
[]); | 357 AssignmentExpression expression = ParserTestCase.parseExpression("x = y =",
[]); |
| 358 Expression syntheticExpression = (expression.rightHandSide as AssignmentExpr
ession).rightHandSide; | 358 Expression syntheticExpression = ((expression.rightHandSide as AssignmentExp
ression)).rightHandSide; |
| 359 EngineTestCase.assertInstanceOf(SimpleIdentifier, syntheticExpression); | 359 EngineTestCase.assertInstanceOf(SimpleIdentifier, syntheticExpression); |
| 360 JUnitTestCase.assertTrue(syntheticExpression.isSynthetic()); | 360 JUnitTestCase.assertTrue(syntheticExpression.isSynthetic()); |
| 361 } | 361 } |
| 362 void test_assignmentExpression_missing_LHS() { | 362 void test_assignmentExpression_missing_LHS() { |
| 363 AssignmentExpression expression = ParserTestCase.parseExpression("= 0", []); | 363 AssignmentExpression expression = ParserTestCase.parseExpression("= 0", []); |
| 364 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftHandSide); | 364 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftHandSide); |
| 365 JUnitTestCase.assertTrue(expression.leftHandSide.isSynthetic()); | 365 JUnitTestCase.assertTrue(expression.leftHandSide.isSynthetic()); |
| 366 } | 366 } |
| 367 void test_assignmentExpression_missing_RHS() { | 367 void test_assignmentExpression_missing_RHS() { |
| 368 AssignmentExpression expression = ParserTestCase.parseExpression("x =", []); | 368 AssignmentExpression expression = ParserTestCase.parseExpression("x =", []); |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 465 } | 465 } |
| 466 void test_bitwiseXorExpression_precedence_and_right() { | 466 void test_bitwiseXorExpression_precedence_and_right() { |
| 467 BinaryExpression expression = ParserTestCase.parseExpression("^ &", []); | 467 BinaryExpression expression = ParserTestCase.parseExpression("^ &", []); |
| 468 EngineTestCase.assertInstanceOf(BinaryExpression, expression.rightOperand); | 468 EngineTestCase.assertInstanceOf(BinaryExpression, expression.rightOperand); |
| 469 } | 469 } |
| 470 void test_bitwiseXorExpression_super() { | 470 void test_bitwiseXorExpression_super() { |
| 471 BinaryExpression expression = ParserTestCase.parseExpression("super ^ ^", [
]); | 471 BinaryExpression expression = ParserTestCase.parseExpression("super ^ ^", [
]); |
| 472 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); | 472 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); |
| 473 } | 473 } |
| 474 void test_conditionalExpression_missingElse() { | 474 void test_conditionalExpression_missingElse() { |
| 475 ConditionalExpression expression = ParserTestCase.parse4("parseConditionalEx
pression", "x ? y :", []); | 475 ConditionalExpression expression = ParserTestCase.parse5("parseConditionalEx
pression", "x ? y :", []); |
| 476 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.elseExpression)
; | 476 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.elseExpression)
; |
| 477 JUnitTestCase.assertTrue(expression.elseExpression.isSynthetic()); | 477 JUnitTestCase.assertTrue(expression.elseExpression.isSynthetic()); |
| 478 } | 478 } |
| 479 void test_conditionalExpression_missingThen() { | 479 void test_conditionalExpression_missingThen() { |
| 480 ConditionalExpression expression = ParserTestCase.parse4("parseConditionalEx
pression", "x ? : z", []); | 480 ConditionalExpression expression = ParserTestCase.parse5("parseConditionalEx
pression", "x ? : z", []); |
| 481 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.thenExpression)
; | 481 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.thenExpression)
; |
| 482 JUnitTestCase.assertTrue(expression.thenExpression.isSynthetic()); | 482 JUnitTestCase.assertTrue(expression.thenExpression.isSynthetic()); |
| 483 } | 483 } |
| 484 void test_equalityExpression_missing_LHS() { | 484 void test_equalityExpression_missing_LHS() { |
| 485 BinaryExpression expression = ParserTestCase.parseExpression("== y", []); | 485 BinaryExpression expression = ParserTestCase.parseExpression("== y", []); |
| 486 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand); | 486 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand); |
| 487 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic()); | 487 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic()); |
| 488 } | 488 } |
| 489 void test_equalityExpression_missing_LHS_RHS() { | 489 void test_equalityExpression_missing_LHS_RHS() { |
| 490 BinaryExpression expression = ParserTestCase.parseExpression("==", []); | 490 BinaryExpression expression = ParserTestCase.parseExpression("==", []); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 509 } | 509 } |
| 510 void test_equalityExpression_precedence_relational_right() { | 510 void test_equalityExpression_precedence_relational_right() { |
| 511 BinaryExpression expression = ParserTestCase.parseExpression("== is", [Parse
rErrorCode.MISSING_IDENTIFIER]); | 511 BinaryExpression expression = ParserTestCase.parseExpression("== is", [Parse
rErrorCode.MISSING_IDENTIFIER]); |
| 512 EngineTestCase.assertInstanceOf(IsExpression, expression.rightOperand); | 512 EngineTestCase.assertInstanceOf(IsExpression, expression.rightOperand); |
| 513 } | 513 } |
| 514 void test_equalityExpression_super() { | 514 void test_equalityExpression_super() { |
| 515 BinaryExpression expression = ParserTestCase.parseExpression("super == ==",
[]); | 515 BinaryExpression expression = ParserTestCase.parseExpression("super == ==",
[]); |
| 516 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); | 516 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); |
| 517 } | 517 } |
| 518 void test_expressionList_multiple_end() { | 518 void test_expressionList_multiple_end() { |
| 519 List<Expression> result = ParserTestCase.parse4("parseExpressionList", ", 2,
3, 4", []); | 519 List<Expression> result = ParserTestCase.parse5("parseExpressionList", ", 2,
3, 4", []); |
| 520 EngineTestCase.assertSize(4, result); | 520 EngineTestCase.assertSize(4, result); |
| 521 Expression syntheticExpression = result[0]; | 521 Expression syntheticExpression = result[0]; |
| 522 EngineTestCase.assertInstanceOf(SimpleIdentifier, syntheticExpression); | 522 EngineTestCase.assertInstanceOf(SimpleIdentifier, syntheticExpression); |
| 523 JUnitTestCase.assertTrue(syntheticExpression.isSynthetic()); | 523 JUnitTestCase.assertTrue(syntheticExpression.isSynthetic()); |
| 524 } | 524 } |
| 525 void test_expressionList_multiple_middle() { | 525 void test_expressionList_multiple_middle() { |
| 526 List<Expression> result = ParserTestCase.parse4("parseExpressionList", "1, 2
, , 4", []); | 526 List<Expression> result = ParserTestCase.parse5("parseExpressionList", "1, 2
, , 4", []); |
| 527 EngineTestCase.assertSize(4, result); | 527 EngineTestCase.assertSize(4, result); |
| 528 Expression syntheticExpression = result[2]; | 528 Expression syntheticExpression = result[2]; |
| 529 EngineTestCase.assertInstanceOf(SimpleIdentifier, syntheticExpression); | 529 EngineTestCase.assertInstanceOf(SimpleIdentifier, syntheticExpression); |
| 530 JUnitTestCase.assertTrue(syntheticExpression.isSynthetic()); | 530 JUnitTestCase.assertTrue(syntheticExpression.isSynthetic()); |
| 531 } | 531 } |
| 532 void test_expressionList_multiple_start() { | 532 void test_expressionList_multiple_start() { |
| 533 List<Expression> result = ParserTestCase.parse4("parseExpressionList", "1, 2
, 3,", []); | 533 List<Expression> result = ParserTestCase.parse5("parseExpressionList", "1, 2
, 3,", []); |
| 534 EngineTestCase.assertSize(4, result); | 534 EngineTestCase.assertSize(4, result); |
| 535 Expression syntheticExpression = result[3]; | 535 Expression syntheticExpression = result[3]; |
| 536 EngineTestCase.assertInstanceOf(SimpleIdentifier, syntheticExpression); | 536 EngineTestCase.assertInstanceOf(SimpleIdentifier, syntheticExpression); |
| 537 JUnitTestCase.assertTrue(syntheticExpression.isSynthetic()); | 537 JUnitTestCase.assertTrue(syntheticExpression.isSynthetic()); |
| 538 } | 538 } |
| 539 void test_logicalAndExpression_missing_LHS() { | 539 void test_logicalAndExpression_missing_LHS() { |
| 540 BinaryExpression expression = ParserTestCase.parseExpression("&& y", []); | 540 BinaryExpression expression = ParserTestCase.parseExpression("&& y", []); |
| 541 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand); | 541 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand); |
| 542 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic()); | 542 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic()); |
| 543 } | 543 } |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 678 EngineTestCase.assertInstanceOf(BinaryExpression, expression.rightOperand); | 678 EngineTestCase.assertInstanceOf(BinaryExpression, expression.rightOperand); |
| 679 } | 679 } |
| 680 void test_shiftExpression_super() { | 680 void test_shiftExpression_super() { |
| 681 BinaryExpression expression = ParserTestCase.parseExpression("super << <<",
[]); | 681 BinaryExpression expression = ParserTestCase.parseExpression("super << <<",
[]); |
| 682 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); | 682 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); |
| 683 } | 683 } |
| 684 void test_topLevelExternalFunction_extraSemicolon() { | 684 void test_topLevelExternalFunction_extraSemicolon() { |
| 685 CompilationUnit unit = ParserTestCase.parseCompilationUnit("external void f(
A a);", [ParserErrorCode.UNEXPECTED_TOKEN]); | 685 CompilationUnit unit = ParserTestCase.parseCompilationUnit("external void f(
A a);", [ParserErrorCode.UNEXPECTED_TOKEN]); |
| 686 NodeList<CompilationUnitMember> declarations3 = unit.declarations; | 686 NodeList<CompilationUnitMember> declarations3 = unit.declarations; |
| 687 EngineTestCase.assertSize(1, declarations3); | 687 EngineTestCase.assertSize(1, declarations3); |
| 688 FunctionDeclaration declaration = declarations3[0] as FunctionDeclaration; | 688 FunctionDeclaration declaration = (declarations3[0] as FunctionDeclaration); |
| 689 JUnitTestCase.assertNotNull(declaration); | 689 JUnitTestCase.assertNotNull(declaration); |
| 690 } | 690 } |
| 691 static dartSuite() { | 691 static dartSuite() { |
| 692 _ut.group('RecoveryParserTest', () { | 692 _ut.group('RecoveryParserTest', () { |
| 693 _ut.test('test_additiveExpression_missing_LHS', () { | 693 _ut.test('test_additiveExpression_missing_LHS', () { |
| 694 final __test = new RecoveryParserTest(); | 694 final __test = new RecoveryParserTest(); |
| 695 runJUnitTest(__test, __test.test_additiveExpression_missing_LHS); | 695 runJUnitTest(__test, __test.test_additiveExpression_missing_LHS); |
| 696 }); | 696 }); |
| 697 _ut.test('test_additiveExpression_missing_LHS_RHS', () { | 697 _ut.test('test_additiveExpression_missing_LHS_RHS', () { |
| 698 final __test = new RecoveryParserTest(); | 698 final __test = new RecoveryParserTest(); |
| (...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1000 /** | 1000 /** |
| 1001 * The class {@code SimpleParserTest} defines parser tests that test individual
parsing method. The | 1001 * 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 | 1002 * 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. | 1003 * the interactions between the method under test and other methods. |
| 1004 * <p> | 1004 * <p> |
| 1005 * More complex tests should be defined in the class {@link ComplexParserTest}. | 1005 * More complex tests should be defined in the class {@link ComplexParserTest}. |
| 1006 */ | 1006 */ |
| 1007 class SimpleParserTest extends ParserTestCase { | 1007 class SimpleParserTest extends ParserTestCase { |
| 1008 void fail_parseCommentReference_this() { | 1008 void fail_parseCommentReference_this() { |
| 1009 CommentReference reference = ParserTestCase.parse("parseCommentReference", <
Object> ["this", 5], ""); | 1009 CommentReference reference = ParserTestCase.parse("parseCommentReference", <
Object> ["this", 5], ""); |
| 1010 SimpleIdentifier identifier8 = EngineTestCase.assertInstanceOf(SimpleIdentif
ier, reference.identifier); | 1010 SimpleIdentifier identifier13 = EngineTestCase.assertInstanceOf(SimpleIdenti
fier, reference.identifier); |
| 1011 JUnitTestCase.assertNotNull(identifier8.token); | 1011 JUnitTestCase.assertNotNull(identifier13.token); |
| 1012 JUnitTestCase.assertEquals("a", identifier8.name); | 1012 JUnitTestCase.assertEquals("a", identifier13.name); |
| 1013 JUnitTestCase.assertEquals(5, identifier8.offset); | 1013 JUnitTestCase.assertEquals(5, identifier13.offset); |
| 1014 } | 1014 } |
| 1015 void test_computeStringValue_emptyInterpolationPrefix() { | 1015 void test_computeStringValue_emptyInterpolationPrefix() { |
| 1016 JUnitTestCase.assertEquals("", computeStringValue("'''")); | 1016 JUnitTestCase.assertEquals("", computeStringValue("'''")); |
| 1017 } | 1017 } |
| 1018 void test_computeStringValue_escape_b() { | 1018 void test_computeStringValue_escape_b() { |
| 1019 JUnitTestCase.assertEquals("\b", computeStringValue("'\\b'")); | 1019 JUnitTestCase.assertEquals("\b", computeStringValue("'\\b'")); |
| 1020 } | 1020 } |
| 1021 void test_computeStringValue_escape_f() { | 1021 void test_computeStringValue_escape_f() { |
| 1022 JUnitTestCase.assertEquals("\f", computeStringValue("'\\f'")); | 1022 JUnitTestCase.assertEquals("\f", computeStringValue("'\\f'")); |
| 1023 } | 1023 } |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1173 void test_isSwitchMember_default_labeled() { | 1173 void test_isSwitchMember_default_labeled() { |
| 1174 JUnitTestCase.assertTrue(isSwitchMember("l1: l2: default")); | 1174 JUnitTestCase.assertTrue(isSwitchMember("l1: l2: default")); |
| 1175 } | 1175 } |
| 1176 void test_isSwitchMember_default_unlabeled() { | 1176 void test_isSwitchMember_default_unlabeled() { |
| 1177 JUnitTestCase.assertTrue(isSwitchMember("default")); | 1177 JUnitTestCase.assertTrue(isSwitchMember("default")); |
| 1178 } | 1178 } |
| 1179 void test_isSwitchMember_false() { | 1179 void test_isSwitchMember_false() { |
| 1180 JUnitTestCase.assertFalse(isSwitchMember("break;")); | 1180 JUnitTestCase.assertFalse(isSwitchMember("break;")); |
| 1181 } | 1181 } |
| 1182 void test_parseAdditiveExpression_normal() { | 1182 void test_parseAdditiveExpression_normal() { |
| 1183 BinaryExpression expression = ParserTestCase.parse4("parseAdditiveExpression
", "x + y", []); | 1183 BinaryExpression expression = ParserTestCase.parse5("parseAdditiveExpression
", "x + y", []); |
| 1184 JUnitTestCase.assertNotNull(expression.leftOperand); | 1184 JUnitTestCase.assertNotNull(expression.leftOperand); |
| 1185 JUnitTestCase.assertNotNull(expression.operator); | 1185 JUnitTestCase.assertNotNull(expression.operator); |
| 1186 JUnitTestCase.assertEquals(TokenType.PLUS, expression.operator.type); | 1186 JUnitTestCase.assertEquals(TokenType.PLUS, expression.operator.type); |
| 1187 JUnitTestCase.assertNotNull(expression.rightOperand); | 1187 JUnitTestCase.assertNotNull(expression.rightOperand); |
| 1188 } | 1188 } |
| 1189 void test_parseAdditiveExpression_super() { | 1189 void test_parseAdditiveExpression_super() { |
| 1190 BinaryExpression expression = ParserTestCase.parse4("parseAdditiveExpression
", "super + y", []); | 1190 BinaryExpression expression = ParserTestCase.parse5("parseAdditiveExpression
", "super + y", []); |
| 1191 EngineTestCase.assertInstanceOf(SuperExpression, expression.leftOperand); | 1191 EngineTestCase.assertInstanceOf(SuperExpression, expression.leftOperand); |
| 1192 JUnitTestCase.assertNotNull(expression.operator); | 1192 JUnitTestCase.assertNotNull(expression.operator); |
| 1193 JUnitTestCase.assertEquals(TokenType.PLUS, expression.operator.type); | 1193 JUnitTestCase.assertEquals(TokenType.PLUS, expression.operator.type); |
| 1194 JUnitTestCase.assertNotNull(expression.rightOperand); | 1194 JUnitTestCase.assertNotNull(expression.rightOperand); |
| 1195 } | 1195 } |
| 1196 void test_parseAnnotation_n1() { | 1196 void test_parseAnnotation_n1() { |
| 1197 Annotation annotation = ParserTestCase.parse4("parseAnnotation", "@A", []); | 1197 Annotation annotation = ParserTestCase.parse5("parseAnnotation", "@A", []); |
| 1198 JUnitTestCase.assertNotNull(annotation.atSign); | 1198 JUnitTestCase.assertNotNull(annotation.atSign); |
| 1199 JUnitTestCase.assertNotNull(annotation.name); | 1199 JUnitTestCase.assertNotNull(annotation.name); |
| 1200 JUnitTestCase.assertNull(annotation.period); | 1200 JUnitTestCase.assertNull(annotation.period); |
| 1201 JUnitTestCase.assertNull(annotation.constructorName); | 1201 JUnitTestCase.assertNull(annotation.constructorName); |
| 1202 JUnitTestCase.assertNull(annotation.arguments); | 1202 JUnitTestCase.assertNull(annotation.arguments); |
| 1203 } | 1203 } |
| 1204 void test_parseAnnotation_n1_a() { | 1204 void test_parseAnnotation_n1_a() { |
| 1205 Annotation annotation = ParserTestCase.parse4("parseAnnotation", "@A(x,y)",
[]); | 1205 Annotation annotation = ParserTestCase.parse5("parseAnnotation", "@A(x,y)",
[]); |
| 1206 JUnitTestCase.assertNotNull(annotation.atSign); | 1206 JUnitTestCase.assertNotNull(annotation.atSign); |
| 1207 JUnitTestCase.assertNotNull(annotation.name); | 1207 JUnitTestCase.assertNotNull(annotation.name); |
| 1208 JUnitTestCase.assertNull(annotation.period); | 1208 JUnitTestCase.assertNull(annotation.period); |
| 1209 JUnitTestCase.assertNull(annotation.constructorName); | 1209 JUnitTestCase.assertNull(annotation.constructorName); |
| 1210 JUnitTestCase.assertNotNull(annotation.arguments); | 1210 JUnitTestCase.assertNotNull(annotation.arguments); |
| 1211 } | 1211 } |
| 1212 void test_parseAnnotation_n2() { | 1212 void test_parseAnnotation_n2() { |
| 1213 Annotation annotation = ParserTestCase.parse4("parseAnnotation", "@A.B", [])
; | 1213 Annotation annotation = ParserTestCase.parse5("parseAnnotation", "@A.B", [])
; |
| 1214 JUnitTestCase.assertNotNull(annotation.atSign); | 1214 JUnitTestCase.assertNotNull(annotation.atSign); |
| 1215 JUnitTestCase.assertNotNull(annotation.name); | 1215 JUnitTestCase.assertNotNull(annotation.name); |
| 1216 JUnitTestCase.assertNull(annotation.period); | 1216 JUnitTestCase.assertNull(annotation.period); |
| 1217 JUnitTestCase.assertNull(annotation.constructorName); | 1217 JUnitTestCase.assertNull(annotation.constructorName); |
| 1218 JUnitTestCase.assertNull(annotation.arguments); | 1218 JUnitTestCase.assertNull(annotation.arguments); |
| 1219 } | 1219 } |
| 1220 void test_parseAnnotation_n2_a() { | 1220 void test_parseAnnotation_n2_a() { |
| 1221 Annotation annotation = ParserTestCase.parse4("parseAnnotation", "@A.B(x,y)"
, []); | 1221 Annotation annotation = ParserTestCase.parse5("parseAnnotation", "@A.B(x,y)"
, []); |
| 1222 JUnitTestCase.assertNotNull(annotation.atSign); | 1222 JUnitTestCase.assertNotNull(annotation.atSign); |
| 1223 JUnitTestCase.assertNotNull(annotation.name); | 1223 JUnitTestCase.assertNotNull(annotation.name); |
| 1224 JUnitTestCase.assertNull(annotation.period); | 1224 JUnitTestCase.assertNull(annotation.period); |
| 1225 JUnitTestCase.assertNull(annotation.constructorName); | 1225 JUnitTestCase.assertNull(annotation.constructorName); |
| 1226 JUnitTestCase.assertNotNull(annotation.arguments); | 1226 JUnitTestCase.assertNotNull(annotation.arguments); |
| 1227 } | 1227 } |
| 1228 void test_parseAnnotation_n3() { | 1228 void test_parseAnnotation_n3() { |
| 1229 Annotation annotation = ParserTestCase.parse4("parseAnnotation", "@A.B.C", [
]); | 1229 Annotation annotation = ParserTestCase.parse5("parseAnnotation", "@A.B.C", [
]); |
| 1230 JUnitTestCase.assertNotNull(annotation.atSign); | 1230 JUnitTestCase.assertNotNull(annotation.atSign); |
| 1231 JUnitTestCase.assertNotNull(annotation.name); | 1231 JUnitTestCase.assertNotNull(annotation.name); |
| 1232 JUnitTestCase.assertNotNull(annotation.period); | 1232 JUnitTestCase.assertNotNull(annotation.period); |
| 1233 JUnitTestCase.assertNotNull(annotation.constructorName); | 1233 JUnitTestCase.assertNotNull(annotation.constructorName); |
| 1234 JUnitTestCase.assertNull(annotation.arguments); | 1234 JUnitTestCase.assertNull(annotation.arguments); |
| 1235 } | 1235 } |
| 1236 void test_parseAnnotation_n3_a() { | 1236 void test_parseAnnotation_n3_a() { |
| 1237 Annotation annotation = ParserTestCase.parse4("parseAnnotation", "@A.B.C(x,y
)", []); | 1237 Annotation annotation = ParserTestCase.parse5("parseAnnotation", "@A.B.C(x,y
)", []); |
| 1238 JUnitTestCase.assertNotNull(annotation.atSign); | 1238 JUnitTestCase.assertNotNull(annotation.atSign); |
| 1239 JUnitTestCase.assertNotNull(annotation.name); | 1239 JUnitTestCase.assertNotNull(annotation.name); |
| 1240 JUnitTestCase.assertNotNull(annotation.period); | 1240 JUnitTestCase.assertNotNull(annotation.period); |
| 1241 JUnitTestCase.assertNotNull(annotation.constructorName); | 1241 JUnitTestCase.assertNotNull(annotation.constructorName); |
| 1242 JUnitTestCase.assertNotNull(annotation.arguments); | 1242 JUnitTestCase.assertNotNull(annotation.arguments); |
| 1243 } | 1243 } |
| 1244 void test_parseArgument_named() { | 1244 void test_parseArgument_named() { |
| 1245 NamedExpression expression = ParserTestCase.parse4("parseArgument", "n: x",
[]); | 1245 NamedExpression expression = ParserTestCase.parse5("parseArgument", "n: x",
[]); |
| 1246 Label name18 = expression.name; | 1246 Label name20 = expression.name; |
| 1247 JUnitTestCase.assertNotNull(name18); | 1247 JUnitTestCase.assertNotNull(name20); |
| 1248 JUnitTestCase.assertNotNull(name18.label); | 1248 JUnitTestCase.assertNotNull(name20.label); |
| 1249 JUnitTestCase.assertNotNull(name18.colon); | 1249 JUnitTestCase.assertNotNull(name20.colon); |
| 1250 JUnitTestCase.assertNotNull(expression.expression); | 1250 JUnitTestCase.assertNotNull(expression.expression); |
| 1251 } | 1251 } |
| 1252 void test_parseArgument_unnamed() { | 1252 void test_parseArgument_unnamed() { |
| 1253 String lexeme = "x"; | 1253 String lexeme = "x"; |
| 1254 SimpleIdentifier identifier = ParserTestCase.parse4("parseArgument", lexeme,
[]); | 1254 SimpleIdentifier identifier = ParserTestCase.parse5("parseArgument", lexeme,
[]); |
| 1255 JUnitTestCase.assertEquals(lexeme, identifier.name); | 1255 JUnitTestCase.assertEquals(lexeme, identifier.name); |
| 1256 } | 1256 } |
| 1257 void test_parseArgumentDefinitionTest() { | 1257 void test_parseArgumentDefinitionTest() { |
| 1258 ArgumentDefinitionTest test = ParserTestCase.parse4("parseArgumentDefinition
Test", "?x", []); | 1258 ArgumentDefinitionTest test = ParserTestCase.parse5("parseArgumentDefinition
Test", "?x", []); |
| 1259 JUnitTestCase.assertNotNull(test.question); | 1259 JUnitTestCase.assertNotNull(test.question); |
| 1260 JUnitTestCase.assertNotNull(test.identifier); | 1260 JUnitTestCase.assertNotNull(test.identifier); |
| 1261 } | 1261 } |
| 1262 void test_parseArgumentList_empty() { | 1262 void test_parseArgumentList_empty() { |
| 1263 ArgumentList argumentList = ParserTestCase.parse4("parseArgumentList", "()",
[]); | 1263 ArgumentList argumentList = ParserTestCase.parse5("parseArgumentList", "()",
[]); |
| 1264 NodeList<Expression> arguments6 = argumentList.arguments; | 1264 NodeList<Expression> arguments7 = argumentList.arguments; |
| 1265 EngineTestCase.assertSize(0, arguments6); | 1265 EngineTestCase.assertSize(0, arguments7); |
| 1266 } | 1266 } |
| 1267 void test_parseArgumentList_mixed() { | 1267 void test_parseArgumentList_mixed() { |
| 1268 ArgumentList argumentList = ParserTestCase.parse4("parseArgumentList", "(w,
x, y: y, z: z)", []); | 1268 ArgumentList argumentList = ParserTestCase.parse5("parseArgumentList", "(w,
x, y: y, z: z)", []); |
| 1269 NodeList<Expression> arguments7 = argumentList.arguments; | 1269 NodeList<Expression> arguments8 = argumentList.arguments; |
| 1270 EngineTestCase.assertSize(4, arguments7); | 1270 EngineTestCase.assertSize(4, arguments8); |
| 1271 } | 1271 } |
| 1272 void test_parseArgumentList_noNamed() { | 1272 void test_parseArgumentList_noNamed() { |
| 1273 ArgumentList argumentList = ParserTestCase.parse4("parseArgumentList", "(x,
y, z)", []); | 1273 ArgumentList argumentList = ParserTestCase.parse5("parseArgumentList", "(x,
y, z)", []); |
| 1274 NodeList<Expression> arguments8 = argumentList.arguments; | 1274 NodeList<Expression> arguments9 = argumentList.arguments; |
| 1275 EngineTestCase.assertSize(3, arguments8); | 1275 EngineTestCase.assertSize(3, arguments9); |
| 1276 } | 1276 } |
| 1277 void test_parseArgumentList_onlyNamed() { | 1277 void test_parseArgumentList_onlyNamed() { |
| 1278 ArgumentList argumentList = ParserTestCase.parse4("parseArgumentList", "(x:
x, y: y)", []); | 1278 ArgumentList argumentList = ParserTestCase.parse5("parseArgumentList", "(x:
x, y: y)", []); |
| 1279 NodeList<Expression> arguments9 = argumentList.arguments; | 1279 NodeList<Expression> arguments10 = argumentList.arguments; |
| 1280 EngineTestCase.assertSize(2, arguments9); | 1280 EngineTestCase.assertSize(2, arguments10); |
| 1281 } | 1281 } |
| 1282 void test_parseAssertStatement() { | 1282 void test_parseAssertStatement() { |
| 1283 AssertStatement statement = ParserTestCase.parse4("parseAssertStatement", "a
ssert (x);", []); | 1283 AssertStatement statement = ParserTestCase.parse5("parseAssertStatement", "a
ssert (x);", []); |
| 1284 JUnitTestCase.assertNotNull(statement.keyword); | 1284 JUnitTestCase.assertNotNull(statement.keyword); |
| 1285 JUnitTestCase.assertNotNull(statement.leftParenthesis); | 1285 JUnitTestCase.assertNotNull(statement.leftParenthesis); |
| 1286 JUnitTestCase.assertNotNull(statement.condition); | 1286 JUnitTestCase.assertNotNull(statement.condition); |
| 1287 JUnitTestCase.assertNotNull(statement.rightParenthesis); | 1287 JUnitTestCase.assertNotNull(statement.rightParenthesis); |
| 1288 JUnitTestCase.assertNotNull(statement.semicolon); | 1288 JUnitTestCase.assertNotNull(statement.semicolon); |
| 1289 } | 1289 } |
| 1290 void test_parseAssignableExpression_expression_args_dot() { | 1290 void test_parseAssignableExpression_expression_args_dot() { |
| 1291 PropertyAccess propertyAccess = ParserTestCase.parse("parseAssignableExpress
ion", <Object> [false], "(x)(y).z"); | 1291 PropertyAccess propertyAccess = ParserTestCase.parse("parseAssignableExpress
ion", <Object> [false], "(x)(y).z"); |
| 1292 FunctionExpressionInvocation invocation = propertyAccess.target as FunctionE
xpressionInvocation; | 1292 FunctionExpressionInvocation invocation = (propertyAccess.target as Function
ExpressionInvocation); |
| 1293 JUnitTestCase.assertNotNull(invocation.function); | 1293 JUnitTestCase.assertNotNull(invocation.function); |
| 1294 ArgumentList argumentList10 = invocation.argumentList; | 1294 ArgumentList argumentList13 = invocation.argumentList; |
| 1295 JUnitTestCase.assertNotNull(argumentList10); | 1295 JUnitTestCase.assertNotNull(argumentList13); |
| 1296 EngineTestCase.assertSize(1, argumentList10.arguments); | 1296 EngineTestCase.assertSize(1, argumentList13.arguments); |
| 1297 JUnitTestCase.assertNotNull(propertyAccess.operator); | 1297 JUnitTestCase.assertNotNull(propertyAccess.operator); |
| 1298 JUnitTestCase.assertNotNull(propertyAccess.propertyName); | 1298 JUnitTestCase.assertNotNull(propertyAccess.propertyName); |
| 1299 } | 1299 } |
| 1300 void test_parseAssignableExpression_expression_dot() { | 1300 void test_parseAssignableExpression_expression_dot() { |
| 1301 PropertyAccess propertyAccess = ParserTestCase.parse("parseAssignableExpress
ion", <Object> [false], "(x).y"); | 1301 PropertyAccess propertyAccess = ParserTestCase.parse("parseAssignableExpress
ion", <Object> [false], "(x).y"); |
| 1302 JUnitTestCase.assertNotNull(propertyAccess.target); | 1302 JUnitTestCase.assertNotNull(propertyAccess.target); |
| 1303 JUnitTestCase.assertNotNull(propertyAccess.operator); | 1303 JUnitTestCase.assertNotNull(propertyAccess.operator); |
| 1304 JUnitTestCase.assertNotNull(propertyAccess.propertyName); | 1304 JUnitTestCase.assertNotNull(propertyAccess.propertyName); |
| 1305 } | 1305 } |
| 1306 void test_parseAssignableExpression_expression_index() { | 1306 void test_parseAssignableExpression_expression_index() { |
| 1307 IndexExpression expression = ParserTestCase.parse("parseAssignableExpression
", <Object> [false], "(x)[y]"); | 1307 IndexExpression expression = ParserTestCase.parse("parseAssignableExpression
", <Object> [false], "(x)[y]"); |
| 1308 JUnitTestCase.assertNotNull(expression.array); | 1308 JUnitTestCase.assertNotNull(expression.array); |
| 1309 JUnitTestCase.assertNotNull(expression.leftBracket); | 1309 JUnitTestCase.assertNotNull(expression.leftBracket); |
| 1310 JUnitTestCase.assertNotNull(expression.index); | 1310 JUnitTestCase.assertNotNull(expression.index); |
| 1311 JUnitTestCase.assertNotNull(expression.rightBracket); | 1311 JUnitTestCase.assertNotNull(expression.rightBracket); |
| 1312 } | 1312 } |
| 1313 void test_parseAssignableExpression_identifier() { | 1313 void test_parseAssignableExpression_identifier() { |
| 1314 SimpleIdentifier identifier = ParserTestCase.parse("parseAssignableExpressio
n", <Object> [false], "x"); | 1314 SimpleIdentifier identifier = ParserTestCase.parse("parseAssignableExpressio
n", <Object> [false], "x"); |
| 1315 JUnitTestCase.assertNotNull(identifier); | 1315 JUnitTestCase.assertNotNull(identifier); |
| 1316 } | 1316 } |
| 1317 void test_parseAssignableExpression_identifier_args_dot() { | 1317 void test_parseAssignableExpression_identifier_args_dot() { |
| 1318 PropertyAccess propertyAccess = ParserTestCase.parse("parseAssignableExpress
ion", <Object> [false], "x(y).z"); | 1318 PropertyAccess propertyAccess = ParserTestCase.parse("parseAssignableExpress
ion", <Object> [false], "x(y).z"); |
| 1319 MethodInvocation invocation = propertyAccess.target as MethodInvocation; | 1319 MethodInvocation invocation = (propertyAccess.target as MethodInvocation); |
| 1320 JUnitTestCase.assertEquals("x", invocation.methodName.name); | 1320 JUnitTestCase.assertEquals("x", invocation.methodName.name); |
| 1321 ArgumentList argumentList11 = invocation.argumentList; | 1321 ArgumentList argumentList14 = invocation.argumentList; |
| 1322 JUnitTestCase.assertNotNull(argumentList11); | 1322 JUnitTestCase.assertNotNull(argumentList14); |
| 1323 EngineTestCase.assertSize(1, argumentList11.arguments); | 1323 EngineTestCase.assertSize(1, argumentList14.arguments); |
| 1324 JUnitTestCase.assertNotNull(propertyAccess.operator); | 1324 JUnitTestCase.assertNotNull(propertyAccess.operator); |
| 1325 JUnitTestCase.assertNotNull(propertyAccess.propertyName); | 1325 JUnitTestCase.assertNotNull(propertyAccess.propertyName); |
| 1326 } | 1326 } |
| 1327 void test_parseAssignableExpression_identifier_dot() { | 1327 void test_parseAssignableExpression_identifier_dot() { |
| 1328 PropertyAccess propertyAccess = ParserTestCase.parse("parseAssignableExpress
ion", <Object> [false], "x.y"); | 1328 PropertyAccess propertyAccess = ParserTestCase.parse("parseAssignableExpress
ion", <Object> [false], "x.y"); |
| 1329 JUnitTestCase.assertNotNull(propertyAccess.target); | 1329 JUnitTestCase.assertNotNull(propertyAccess.target); |
| 1330 JUnitTestCase.assertNotNull(propertyAccess.operator); | 1330 JUnitTestCase.assertNotNull(propertyAccess.operator); |
| 1331 JUnitTestCase.assertNotNull(propertyAccess.propertyName); | 1331 JUnitTestCase.assertNotNull(propertyAccess.propertyName); |
| 1332 } | 1332 } |
| 1333 void test_parseAssignableExpression_identifier_index() { | 1333 void test_parseAssignableExpression_identifier_index() { |
| (...skipping 21 matching lines...) Expand all Loading... |
| 1355 JUnitTestCase.assertNotNull(selector.operator); | 1355 JUnitTestCase.assertNotNull(selector.operator); |
| 1356 JUnitTestCase.assertNotNull(selector.propertyName); | 1356 JUnitTestCase.assertNotNull(selector.propertyName); |
| 1357 } | 1357 } |
| 1358 void test_parseAssignableSelector_index() { | 1358 void test_parseAssignableSelector_index() { |
| 1359 IndexExpression selector = ParserTestCase.parse("parseAssignableSelector", <
Object> [null, true], "[x]"); | 1359 IndexExpression selector = ParserTestCase.parse("parseAssignableSelector", <
Object> [null, true], "[x]"); |
| 1360 JUnitTestCase.assertNotNull(selector.leftBracket); | 1360 JUnitTestCase.assertNotNull(selector.leftBracket); |
| 1361 JUnitTestCase.assertNotNull(selector.index); | 1361 JUnitTestCase.assertNotNull(selector.index); |
| 1362 JUnitTestCase.assertNotNull(selector.rightBracket); | 1362 JUnitTestCase.assertNotNull(selector.rightBracket); |
| 1363 } | 1363 } |
| 1364 void test_parseAssignableSelector_none() { | 1364 void test_parseAssignableSelector_none() { |
| 1365 SimpleIdentifier selector = ParserTestCase.parse("parseAssignableSelector",
<Object> [new SimpleIdentifier(null), true], ";"); | 1365 SimpleIdentifier selector = ParserTestCase.parse("parseAssignableSelector",
<Object> [new SimpleIdentifier.full(null), true], ";"); |
| 1366 JUnitTestCase.assertNotNull(selector); | 1366 JUnitTestCase.assertNotNull(selector); |
| 1367 } | 1367 } |
| 1368 void test_parseBitwiseAndExpression_normal() { | 1368 void test_parseBitwiseAndExpression_normal() { |
| 1369 BinaryExpression expression = ParserTestCase.parse4("parseBitwiseAndExpressi
on", "x & y", []); | 1369 BinaryExpression expression = ParserTestCase.parse5("parseBitwiseAndExpressi
on", "x & y", []); |
| 1370 JUnitTestCase.assertNotNull(expression.leftOperand); | 1370 JUnitTestCase.assertNotNull(expression.leftOperand); |
| 1371 JUnitTestCase.assertNotNull(expression.operator); | 1371 JUnitTestCase.assertNotNull(expression.operator); |
| 1372 JUnitTestCase.assertEquals(TokenType.AMPERSAND, expression.operator.type); | 1372 JUnitTestCase.assertEquals(TokenType.AMPERSAND, expression.operator.type); |
| 1373 JUnitTestCase.assertNotNull(expression.rightOperand); | 1373 JUnitTestCase.assertNotNull(expression.rightOperand); |
| 1374 } | 1374 } |
| 1375 void test_parseBitwiseAndExpression_super() { | 1375 void test_parseBitwiseAndExpression_super() { |
| 1376 BinaryExpression expression = ParserTestCase.parse4("parseBitwiseAndExpressi
on", "super & y", []); | 1376 BinaryExpression expression = ParserTestCase.parse5("parseBitwiseAndExpressi
on", "super & y", []); |
| 1377 EngineTestCase.assertInstanceOf(SuperExpression, expression.leftOperand); | 1377 EngineTestCase.assertInstanceOf(SuperExpression, expression.leftOperand); |
| 1378 JUnitTestCase.assertNotNull(expression.operator); | 1378 JUnitTestCase.assertNotNull(expression.operator); |
| 1379 JUnitTestCase.assertEquals(TokenType.AMPERSAND, expression.operator.type); | 1379 JUnitTestCase.assertEquals(TokenType.AMPERSAND, expression.operator.type); |
| 1380 JUnitTestCase.assertNotNull(expression.rightOperand); | 1380 JUnitTestCase.assertNotNull(expression.rightOperand); |
| 1381 } | 1381 } |
| 1382 void test_parseBitwiseOrExpression_normal() { | 1382 void test_parseBitwiseOrExpression_normal() { |
| 1383 BinaryExpression expression = ParserTestCase.parse4("parseBitwiseOrExpressio
n", "x | y", []); | 1383 BinaryExpression expression = ParserTestCase.parse5("parseBitwiseOrExpressio
n", "x | y", []); |
| 1384 JUnitTestCase.assertNotNull(expression.leftOperand); | 1384 JUnitTestCase.assertNotNull(expression.leftOperand); |
| 1385 JUnitTestCase.assertNotNull(expression.operator); | 1385 JUnitTestCase.assertNotNull(expression.operator); |
| 1386 JUnitTestCase.assertEquals(TokenType.BAR, expression.operator.type); | 1386 JUnitTestCase.assertEquals(TokenType.BAR, expression.operator.type); |
| 1387 JUnitTestCase.assertNotNull(expression.rightOperand); | 1387 JUnitTestCase.assertNotNull(expression.rightOperand); |
| 1388 } | 1388 } |
| 1389 void test_parseBitwiseOrExpression_super() { | 1389 void test_parseBitwiseOrExpression_super() { |
| 1390 BinaryExpression expression = ParserTestCase.parse4("parseBitwiseOrExpressio
n", "super | y", []); | 1390 BinaryExpression expression = ParserTestCase.parse5("parseBitwiseOrExpressio
n", "super | y", []); |
| 1391 EngineTestCase.assertInstanceOf(SuperExpression, expression.leftOperand); | 1391 EngineTestCase.assertInstanceOf(SuperExpression, expression.leftOperand); |
| 1392 JUnitTestCase.assertNotNull(expression.operator); | 1392 JUnitTestCase.assertNotNull(expression.operator); |
| 1393 JUnitTestCase.assertEquals(TokenType.BAR, expression.operator.type); | 1393 JUnitTestCase.assertEquals(TokenType.BAR, expression.operator.type); |
| 1394 JUnitTestCase.assertNotNull(expression.rightOperand); | 1394 JUnitTestCase.assertNotNull(expression.rightOperand); |
| 1395 } | 1395 } |
| 1396 void test_parseBitwiseXorExpression_normal() { | 1396 void test_parseBitwiseXorExpression_normal() { |
| 1397 BinaryExpression expression = ParserTestCase.parse4("parseBitwiseXorExpressi
on", "x ^ y", []); | 1397 BinaryExpression expression = ParserTestCase.parse5("parseBitwiseXorExpressi
on", "x ^ y", []); |
| 1398 JUnitTestCase.assertNotNull(expression.leftOperand); | 1398 JUnitTestCase.assertNotNull(expression.leftOperand); |
| 1399 JUnitTestCase.assertNotNull(expression.operator); | 1399 JUnitTestCase.assertNotNull(expression.operator); |
| 1400 JUnitTestCase.assertEquals(TokenType.CARET, expression.operator.type); | 1400 JUnitTestCase.assertEquals(TokenType.CARET, expression.operator.type); |
| 1401 JUnitTestCase.assertNotNull(expression.rightOperand); | 1401 JUnitTestCase.assertNotNull(expression.rightOperand); |
| 1402 } | 1402 } |
| 1403 void test_parseBitwiseXorExpression_super() { | 1403 void test_parseBitwiseXorExpression_super() { |
| 1404 BinaryExpression expression = ParserTestCase.parse4("parseBitwiseXorExpressi
on", "super ^ y", []); | 1404 BinaryExpression expression = ParserTestCase.parse5("parseBitwiseXorExpressi
on", "super ^ y", []); |
| 1405 EngineTestCase.assertInstanceOf(SuperExpression, expression.leftOperand); | 1405 EngineTestCase.assertInstanceOf(SuperExpression, expression.leftOperand); |
| 1406 JUnitTestCase.assertNotNull(expression.operator); | 1406 JUnitTestCase.assertNotNull(expression.operator); |
| 1407 JUnitTestCase.assertEquals(TokenType.CARET, expression.operator.type); | 1407 JUnitTestCase.assertEquals(TokenType.CARET, expression.operator.type); |
| 1408 JUnitTestCase.assertNotNull(expression.rightOperand); | 1408 JUnitTestCase.assertNotNull(expression.rightOperand); |
| 1409 } | 1409 } |
| 1410 void test_parseBlock_empty() { | 1410 void test_parseBlock_empty() { |
| 1411 Block block = ParserTestCase.parse4("parseBlock", "{}", []); | 1411 Block block = ParserTestCase.parse5("parseBlock", "{}", []); |
| 1412 JUnitTestCase.assertNotNull(block.leftBracket); | 1412 JUnitTestCase.assertNotNull(block.leftBracket); |
| 1413 EngineTestCase.assertSize(0, block.statements); | 1413 EngineTestCase.assertSize(0, block.statements); |
| 1414 JUnitTestCase.assertNotNull(block.rightBracket); | 1414 JUnitTestCase.assertNotNull(block.rightBracket); |
| 1415 } | 1415 } |
| 1416 void test_parseBlock_nonEmpty() { | 1416 void test_parseBlock_nonEmpty() { |
| 1417 Block block = ParserTestCase.parse4("parseBlock", "{;}", []); | 1417 Block block = ParserTestCase.parse5("parseBlock", "{;}", []); |
| 1418 JUnitTestCase.assertNotNull(block.leftBracket); | 1418 JUnitTestCase.assertNotNull(block.leftBracket); |
| 1419 EngineTestCase.assertSize(1, block.statements); | 1419 EngineTestCase.assertSize(1, block.statements); |
| 1420 JUnitTestCase.assertNotNull(block.rightBracket); | 1420 JUnitTestCase.assertNotNull(block.rightBracket); |
| 1421 } | 1421 } |
| 1422 void test_parseBreakStatement_label() { | 1422 void test_parseBreakStatement_label() { |
| 1423 BreakStatement statement = ParserTestCase.parse4("parseBreakStatement", "bre
ak foo;", []); | 1423 BreakStatement statement = ParserTestCase.parse5("parseBreakStatement", "bre
ak foo;", []); |
| 1424 JUnitTestCase.assertNotNull(statement.keyword); | 1424 JUnitTestCase.assertNotNull(statement.keyword); |
| 1425 JUnitTestCase.assertNotNull(statement.label); | 1425 JUnitTestCase.assertNotNull(statement.label); |
| 1426 JUnitTestCase.assertNotNull(statement.semicolon); | 1426 JUnitTestCase.assertNotNull(statement.semicolon); |
| 1427 } | 1427 } |
| 1428 void test_parseBreakStatement_noLabel() { | 1428 void test_parseBreakStatement_noLabel() { |
| 1429 BreakStatement statement = ParserTestCase.parse4("parseBreakStatement", "bre
ak;", [ParserErrorCode.BREAK_OUTSIDE_OF_LOOP]); | 1429 BreakStatement statement = ParserTestCase.parse5("parseBreakStatement", "bre
ak;", [ParserErrorCode.BREAK_OUTSIDE_OF_LOOP]); |
| 1430 JUnitTestCase.assertNotNull(statement.keyword); | 1430 JUnitTestCase.assertNotNull(statement.keyword); |
| 1431 JUnitTestCase.assertNull(statement.label); | 1431 JUnitTestCase.assertNull(statement.label); |
| 1432 JUnitTestCase.assertNotNull(statement.semicolon); | 1432 JUnitTestCase.assertNotNull(statement.semicolon); |
| 1433 } | 1433 } |
| 1434 void test_parseCascadeSection_i() { | 1434 void test_parseCascadeSection_i() { |
| 1435 IndexExpression section = ParserTestCase.parse4("parseCascadeSection", "..[i
]", []); | 1435 IndexExpression section = ParserTestCase.parse5("parseCascadeSection", "..[i
]", []); |
| 1436 JUnitTestCase.assertNull(section.array); | 1436 JUnitTestCase.assertNull(section.array); |
| 1437 JUnitTestCase.assertNotNull(section.leftBracket); | 1437 JUnitTestCase.assertNotNull(section.leftBracket); |
| 1438 JUnitTestCase.assertNotNull(section.index); | 1438 JUnitTestCase.assertNotNull(section.index); |
| 1439 JUnitTestCase.assertNotNull(section.rightBracket); | 1439 JUnitTestCase.assertNotNull(section.rightBracket); |
| 1440 } | 1440 } |
| 1441 void test_parseCascadeSection_ia() { | 1441 void test_parseCascadeSection_ia() { |
| 1442 FunctionExpressionInvocation section = ParserTestCase.parse4("parseCascadeSe
ction", "..[i](b)", []); | 1442 FunctionExpressionInvocation section = ParserTestCase.parse5("parseCascadeSe
ction", "..[i](b)", []); |
| 1443 EngineTestCase.assertInstanceOf(IndexExpression, section.function); | 1443 EngineTestCase.assertInstanceOf(IndexExpression, section.function); |
| 1444 JUnitTestCase.assertNotNull(section.argumentList); | 1444 JUnitTestCase.assertNotNull(section.argumentList); |
| 1445 } | 1445 } |
| 1446 void test_parseCascadeSection_p() { | 1446 void test_parseCascadeSection_p() { |
| 1447 PropertyAccess section = ParserTestCase.parse4("parseCascadeSection", "..a",
[]); | 1447 PropertyAccess section = ParserTestCase.parse5("parseCascadeSection", "..a",
[]); |
| 1448 JUnitTestCase.assertNull(section.target); | 1448 JUnitTestCase.assertNull(section.target); |
| 1449 JUnitTestCase.assertNotNull(section.operator); | 1449 JUnitTestCase.assertNotNull(section.operator); |
| 1450 JUnitTestCase.assertNotNull(section.propertyName); | 1450 JUnitTestCase.assertNotNull(section.propertyName); |
| 1451 } | 1451 } |
| 1452 void test_parseCascadeSection_p_assign() { | 1452 void test_parseCascadeSection_p_assign() { |
| 1453 AssignmentExpression section = ParserTestCase.parse4("parseCascadeSection",
"..a = 3", []); | 1453 AssignmentExpression section = ParserTestCase.parse5("parseCascadeSection",
"..a = 3", []); |
| 1454 JUnitTestCase.assertNotNull(section.leftHandSide); | 1454 JUnitTestCase.assertNotNull(section.leftHandSide); |
| 1455 JUnitTestCase.assertNotNull(section.operator); | 1455 JUnitTestCase.assertNotNull(section.operator); |
| 1456 JUnitTestCase.assertNotNull(section.rightHandSide); | 1456 JUnitTestCase.assertNotNull(section.rightHandSide); |
| 1457 } | 1457 } |
| 1458 void test_parseCascadeSection_p_builtIn() { | 1458 void test_parseCascadeSection_p_builtIn() { |
| 1459 PropertyAccess section = ParserTestCase.parse4("parseCascadeSection", "..as"
, []); | 1459 PropertyAccess section = ParserTestCase.parse5("parseCascadeSection", "..as"
, []); |
| 1460 JUnitTestCase.assertNull(section.target); | 1460 JUnitTestCase.assertNull(section.target); |
| 1461 JUnitTestCase.assertNotNull(section.operator); | 1461 JUnitTestCase.assertNotNull(section.operator); |
| 1462 JUnitTestCase.assertNotNull(section.propertyName); | 1462 JUnitTestCase.assertNotNull(section.propertyName); |
| 1463 } | 1463 } |
| 1464 void test_parseCascadeSection_pa() { | 1464 void test_parseCascadeSection_pa() { |
| 1465 MethodInvocation section = ParserTestCase.parse4("parseCascadeSection", "..a
(b)", []); | 1465 MethodInvocation section = ParserTestCase.parse5("parseCascadeSection", "..a
(b)", []); |
| 1466 JUnitTestCase.assertNull(section.target); | 1466 JUnitTestCase.assertNull(section.target); |
| 1467 JUnitTestCase.assertNotNull(section.period); | 1467 JUnitTestCase.assertNotNull(section.period); |
| 1468 JUnitTestCase.assertNotNull(section.methodName); | 1468 JUnitTestCase.assertNotNull(section.methodName); |
| 1469 JUnitTestCase.assertNotNull(section.argumentList); | 1469 JUnitTestCase.assertNotNull(section.argumentList); |
| 1470 EngineTestCase.assertSize(1, section.argumentList.arguments); | 1470 EngineTestCase.assertSize(1, section.argumentList.arguments); |
| 1471 } | 1471 } |
| 1472 void test_parseCascadeSection_paa() { | 1472 void test_parseCascadeSection_paa() { |
| 1473 FunctionExpressionInvocation section = ParserTestCase.parse4("parseCascadeSe
ction", "..a(b)(c)", []); | 1473 FunctionExpressionInvocation section = ParserTestCase.parse5("parseCascadeSe
ction", "..a(b)(c)", []); |
| 1474 EngineTestCase.assertInstanceOf(MethodInvocation, section.function); | 1474 EngineTestCase.assertInstanceOf(MethodInvocation, section.function); |
| 1475 JUnitTestCase.assertNotNull(section.argumentList); | 1475 JUnitTestCase.assertNotNull(section.argumentList); |
| 1476 EngineTestCase.assertSize(1, section.argumentList.arguments); | 1476 EngineTestCase.assertSize(1, section.argumentList.arguments); |
| 1477 } | 1477 } |
| 1478 void test_parseCascadeSection_paapaa() { | 1478 void test_parseCascadeSection_paapaa() { |
| 1479 FunctionExpressionInvocation section = ParserTestCase.parse4("parseCascadeSe
ction", "..a(b)(c).d(e)(f)", []); | 1479 FunctionExpressionInvocation section = ParserTestCase.parse5("parseCascadeSe
ction", "..a(b)(c).d(e)(f)", []); |
| 1480 EngineTestCase.assertInstanceOf(FunctionExpressionInvocation, section.functi
on); | 1480 EngineTestCase.assertInstanceOf(FunctionExpressionInvocation, section.functi
on); |
| 1481 JUnitTestCase.assertNotNull(section.argumentList); | 1481 JUnitTestCase.assertNotNull(section.argumentList); |
| 1482 EngineTestCase.assertSize(1, section.argumentList.arguments); | 1482 EngineTestCase.assertSize(1, section.argumentList.arguments); |
| 1483 } | 1483 } |
| 1484 void test_parseCascadeSection_pap() { | 1484 void test_parseCascadeSection_pap() { |
| 1485 PropertyAccess section = ParserTestCase.parse4("parseCascadeSection", "..a(b
).c", []); | 1485 PropertyAccess section = ParserTestCase.parse5("parseCascadeSection", "..a(b
).c", []); |
| 1486 JUnitTestCase.assertNotNull(section.target); | 1486 JUnitTestCase.assertNotNull(section.target); |
| 1487 JUnitTestCase.assertNotNull(section.operator); | 1487 JUnitTestCase.assertNotNull(section.operator); |
| 1488 JUnitTestCase.assertNotNull(section.propertyName); | 1488 JUnitTestCase.assertNotNull(section.propertyName); |
| 1489 } | 1489 } |
| 1490 void test_parseClassDeclaration_abstract() { | 1490 void test_parseClassDeclaration_abstract() { |
| 1491 ClassDeclaration declaration = ParserTestCase.parse("parseClassDeclaration",
<Object> [emptyCommentAndMetadata(), TokenFactory.token(Keyword.ABSTRACT)], "cl
ass A {}"); | 1491 ClassDeclaration declaration = ParserTestCase.parse("parseClassDeclaration",
<Object> [emptyCommentAndMetadata(), TokenFactory.token(Keyword.ABSTRACT)], "cl
ass A {}"); |
| 1492 JUnitTestCase.assertNull(declaration.documentationComment); | 1492 JUnitTestCase.assertNull(declaration.documentationComment); |
| 1493 JUnitTestCase.assertNotNull(declaration.abstractKeyword); | 1493 JUnitTestCase.assertNotNull(declaration.abstractKeyword); |
| 1494 JUnitTestCase.assertNull(declaration.extendsClause); | 1494 JUnitTestCase.assertNull(declaration.extendsClause); |
| 1495 JUnitTestCase.assertNull(declaration.implementsClause); | 1495 JUnitTestCase.assertNull(declaration.implementsClause); |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1620 JUnitTestCase.assertNotNull(constructor.returnType); | 1620 JUnitTestCase.assertNotNull(constructor.returnType); |
| 1621 EngineTestCase.assertSize(1, constructor.initializers); | 1621 EngineTestCase.assertSize(1, constructor.initializers); |
| 1622 } | 1622 } |
| 1623 void test_parseClassMember_field_instance_prefixedType() { | 1623 void test_parseClassMember_field_instance_prefixedType() { |
| 1624 FieldDeclaration field = ParserTestCase.parse("parseClassMember", <Object> [
"C"], "p.A f;"); | 1624 FieldDeclaration field = ParserTestCase.parse("parseClassMember", <Object> [
"C"], "p.A f;"); |
| 1625 JUnitTestCase.assertNull(field.documentationComment); | 1625 JUnitTestCase.assertNull(field.documentationComment); |
| 1626 EngineTestCase.assertSize(0, field.metadata); | 1626 EngineTestCase.assertSize(0, field.metadata); |
| 1627 JUnitTestCase.assertNull(field.keyword); | 1627 JUnitTestCase.assertNull(field.keyword); |
| 1628 VariableDeclarationList list = field.fields; | 1628 VariableDeclarationList list = field.fields; |
| 1629 JUnitTestCase.assertNotNull(list); | 1629 JUnitTestCase.assertNotNull(list); |
| 1630 NodeList<VariableDeclaration> variables6 = list.variables; | 1630 NodeList<VariableDeclaration> variables4 = list.variables; |
| 1631 EngineTestCase.assertSize(1, variables6); | 1631 EngineTestCase.assertSize(1, variables4); |
| 1632 VariableDeclaration variable = variables6[0]; | 1632 VariableDeclaration variable = variables4[0]; |
| 1633 JUnitTestCase.assertNotNull(variable.name); | 1633 JUnitTestCase.assertNotNull(variable.name); |
| 1634 } | 1634 } |
| 1635 void test_parseClassMember_field_namedGet() { | 1635 void test_parseClassMember_field_namedGet() { |
| 1636 FieldDeclaration field = ParserTestCase.parse("parseClassMember", <Object> [
"C"], "var get;"); | 1636 FieldDeclaration field = ParserTestCase.parse("parseClassMember", <Object> [
"C"], "var get;"); |
| 1637 JUnitTestCase.assertNull(field.documentationComment); | 1637 JUnitTestCase.assertNull(field.documentationComment); |
| 1638 EngineTestCase.assertSize(0, field.metadata); | 1638 EngineTestCase.assertSize(0, field.metadata); |
| 1639 JUnitTestCase.assertNull(field.keyword); | 1639 JUnitTestCase.assertNull(field.keyword); |
| 1640 VariableDeclarationList list = field.fields; | 1640 VariableDeclarationList list = field.fields; |
| 1641 JUnitTestCase.assertNotNull(list); | 1641 JUnitTestCase.assertNotNull(list); |
| 1642 NodeList<VariableDeclaration> variables7 = list.variables; | 1642 NodeList<VariableDeclaration> variables5 = list.variables; |
| 1643 EngineTestCase.assertSize(1, variables7); | 1643 EngineTestCase.assertSize(1, variables5); |
| 1644 VariableDeclaration variable = variables7[0]; | 1644 VariableDeclaration variable = variables5[0]; |
| 1645 JUnitTestCase.assertNotNull(variable.name); | 1645 JUnitTestCase.assertNotNull(variable.name); |
| 1646 } | 1646 } |
| 1647 void test_parseClassMember_field_namedOperator() { | 1647 void test_parseClassMember_field_namedOperator() { |
| 1648 FieldDeclaration field = ParserTestCase.parse("parseClassMember", <Object> [
"C"], "var operator;"); | 1648 FieldDeclaration field = ParserTestCase.parse("parseClassMember", <Object> [
"C"], "var operator;"); |
| 1649 JUnitTestCase.assertNull(field.documentationComment); | 1649 JUnitTestCase.assertNull(field.documentationComment); |
| 1650 EngineTestCase.assertSize(0, field.metadata); | 1650 EngineTestCase.assertSize(0, field.metadata); |
| 1651 JUnitTestCase.assertNull(field.keyword); | 1651 JUnitTestCase.assertNull(field.keyword); |
| 1652 VariableDeclarationList list = field.fields; | 1652 VariableDeclarationList list = field.fields; |
| 1653 JUnitTestCase.assertNotNull(list); | 1653 JUnitTestCase.assertNotNull(list); |
| 1654 NodeList<VariableDeclaration> variables8 = list.variables; | 1654 NodeList<VariableDeclaration> variables6 = list.variables; |
| 1655 EngineTestCase.assertSize(1, variables8); | 1655 EngineTestCase.assertSize(1, variables6); |
| 1656 VariableDeclaration variable = variables8[0]; | 1656 VariableDeclaration variable = variables6[0]; |
| 1657 JUnitTestCase.assertNotNull(variable.name); | 1657 JUnitTestCase.assertNotNull(variable.name); |
| 1658 } | 1658 } |
| 1659 void test_parseClassMember_field_namedSet() { | 1659 void test_parseClassMember_field_namedSet() { |
| 1660 FieldDeclaration field = ParserTestCase.parse("parseClassMember", <Object> [
"C"], "var set;"); | 1660 FieldDeclaration field = ParserTestCase.parse("parseClassMember", <Object> [
"C"], "var set;"); |
| 1661 JUnitTestCase.assertNull(field.documentationComment); | 1661 JUnitTestCase.assertNull(field.documentationComment); |
| 1662 EngineTestCase.assertSize(0, field.metadata); | 1662 EngineTestCase.assertSize(0, field.metadata); |
| 1663 JUnitTestCase.assertNull(field.keyword); | 1663 JUnitTestCase.assertNull(field.keyword); |
| 1664 VariableDeclarationList list = field.fields; | 1664 VariableDeclarationList list = field.fields; |
| 1665 JUnitTestCase.assertNotNull(list); | 1665 JUnitTestCase.assertNotNull(list); |
| 1666 NodeList<VariableDeclaration> variables9 = list.variables; | 1666 NodeList<VariableDeclaration> variables7 = list.variables; |
| 1667 EngineTestCase.assertSize(1, variables9); | 1667 EngineTestCase.assertSize(1, variables7); |
| 1668 VariableDeclaration variable = variables9[0]; | 1668 VariableDeclaration variable = variables7[0]; |
| 1669 JUnitTestCase.assertNotNull(variable.name); | 1669 JUnitTestCase.assertNotNull(variable.name); |
| 1670 } | 1670 } |
| 1671 void test_parseClassMember_getter_void() { | 1671 void test_parseClassMember_getter_void() { |
| 1672 MethodDeclaration method = ParserTestCase.parse("parseClassMember", <Object>
["C"], "void get g {}"); | 1672 MethodDeclaration method = ParserTestCase.parse("parseClassMember", <Object>
["C"], "void get g {}"); |
| 1673 JUnitTestCase.assertNull(method.documentationComment); | 1673 JUnitTestCase.assertNull(method.documentationComment); |
| 1674 JUnitTestCase.assertNull(method.externalKeyword); | 1674 JUnitTestCase.assertNull(method.externalKeyword); |
| 1675 JUnitTestCase.assertNull(method.modifierKeyword); | 1675 JUnitTestCase.assertNull(method.modifierKeyword); |
| 1676 JUnitTestCase.assertNotNull(method.propertyKeyword); | 1676 JUnitTestCase.assertNotNull(method.propertyKeyword); |
| 1677 JUnitTestCase.assertNotNull(method.returnType); | 1677 JUnitTestCase.assertNotNull(method.returnType); |
| 1678 JUnitTestCase.assertNotNull(method.name); | 1678 JUnitTestCase.assertNotNull(method.name); |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1869 JUnitTestCase.assertNotNull(constructor.returnType); | 1869 JUnitTestCase.assertNotNull(constructor.returnType); |
| 1870 JUnitTestCase.assertNull(constructor.period); | 1870 JUnitTestCase.assertNull(constructor.period); |
| 1871 JUnitTestCase.assertNull(constructor.name); | 1871 JUnitTestCase.assertNull(constructor.name); |
| 1872 JUnitTestCase.assertNotNull(constructor.parameters); | 1872 JUnitTestCase.assertNotNull(constructor.parameters); |
| 1873 JUnitTestCase.assertNotNull(constructor.separator); | 1873 JUnitTestCase.assertNotNull(constructor.separator); |
| 1874 EngineTestCase.assertSize(0, constructor.initializers); | 1874 EngineTestCase.assertSize(0, constructor.initializers); |
| 1875 JUnitTestCase.assertNotNull(constructor.redirectedConstructor); | 1875 JUnitTestCase.assertNotNull(constructor.redirectedConstructor); |
| 1876 JUnitTestCase.assertNotNull(constructor.body); | 1876 JUnitTestCase.assertNotNull(constructor.body); |
| 1877 } | 1877 } |
| 1878 void test_parseCombinators_h() { | 1878 void test_parseCombinators_h() { |
| 1879 List<Combinator> combinators = ParserTestCase.parse4("parseCombinators", "hi
de a;", []); | 1879 List<Combinator> combinators = ParserTestCase.parse5("parseCombinators", "hi
de a;", []); |
| 1880 EngineTestCase.assertSize(1, combinators); | 1880 EngineTestCase.assertSize(1, combinators); |
| 1881 HideCombinator combinator = combinators[0] as HideCombinator; | 1881 HideCombinator combinator = (combinators[0] as HideCombinator); |
| 1882 JUnitTestCase.assertNotNull(combinator); | 1882 JUnitTestCase.assertNotNull(combinator); |
| 1883 JUnitTestCase.assertNotNull(combinator.keyword); | 1883 JUnitTestCase.assertNotNull(combinator.keyword); |
| 1884 EngineTestCase.assertSize(1, combinator.hiddenNames); | 1884 EngineTestCase.assertSize(1, combinator.hiddenNames); |
| 1885 } | 1885 } |
| 1886 void test_parseCombinators_hs() { | 1886 void test_parseCombinators_hs() { |
| 1887 List<Combinator> combinators = ParserTestCase.parse4("parseCombinators", "hi
de a show b;", []); | 1887 List<Combinator> combinators = ParserTestCase.parse5("parseCombinators", "hi
de a show b;", []); |
| 1888 EngineTestCase.assertSize(2, combinators); | 1888 EngineTestCase.assertSize(2, combinators); |
| 1889 HideCombinator hideCombinator = combinators[0] as HideCombinator; | 1889 HideCombinator hideCombinator = (combinators[0] as HideCombinator); |
| 1890 JUnitTestCase.assertNotNull(hideCombinator); | 1890 JUnitTestCase.assertNotNull(hideCombinator); |
| 1891 JUnitTestCase.assertNotNull(hideCombinator.keyword); | 1891 JUnitTestCase.assertNotNull(hideCombinator.keyword); |
| 1892 EngineTestCase.assertSize(1, hideCombinator.hiddenNames); | 1892 EngineTestCase.assertSize(1, hideCombinator.hiddenNames); |
| 1893 ShowCombinator showCombinator = combinators[1] as ShowCombinator; | 1893 ShowCombinator showCombinator = (combinators[1] as ShowCombinator); |
| 1894 JUnitTestCase.assertNotNull(showCombinator); | 1894 JUnitTestCase.assertNotNull(showCombinator); |
| 1895 JUnitTestCase.assertNotNull(showCombinator.keyword); | 1895 JUnitTestCase.assertNotNull(showCombinator.keyword); |
| 1896 EngineTestCase.assertSize(1, showCombinator.shownNames); | 1896 EngineTestCase.assertSize(1, showCombinator.shownNames); |
| 1897 } | 1897 } |
| 1898 void test_parseCombinators_hshs() { | 1898 void test_parseCombinators_hshs() { |
| 1899 List<Combinator> combinators = ParserTestCase.parse4("parseCombinators", "hi
de a show b hide c show d;", []); | 1899 List<Combinator> combinators = ParserTestCase.parse5("parseCombinators", "hi
de a show b hide c show d;", []); |
| 1900 EngineTestCase.assertSize(4, combinators); | 1900 EngineTestCase.assertSize(4, combinators); |
| 1901 } | 1901 } |
| 1902 void test_parseCombinators_s() { | 1902 void test_parseCombinators_s() { |
| 1903 List<Combinator> combinators = ParserTestCase.parse4("parseCombinators", "sh
ow a;", []); | 1903 List<Combinator> combinators = ParserTestCase.parse5("parseCombinators", "sh
ow a;", []); |
| 1904 EngineTestCase.assertSize(1, combinators); | 1904 EngineTestCase.assertSize(1, combinators); |
| 1905 ShowCombinator combinator = combinators[0] as ShowCombinator; | 1905 ShowCombinator combinator = (combinators[0] as ShowCombinator); |
| 1906 JUnitTestCase.assertNotNull(combinator); | 1906 JUnitTestCase.assertNotNull(combinator); |
| 1907 JUnitTestCase.assertNotNull(combinator.keyword); | 1907 JUnitTestCase.assertNotNull(combinator.keyword); |
| 1908 EngineTestCase.assertSize(1, combinator.shownNames); | 1908 EngineTestCase.assertSize(1, combinator.shownNames); |
| 1909 } | 1909 } |
| 1910 void test_parseCommentAndMetadata_c() { | 1910 void test_parseCommentAndMetadata_c() { |
| 1911 CommentAndMetadata commentAndMetadata = ParserTestCase.parse4("parseCommentA
ndMetadata", "/** 1 */ void", []); | 1911 CommentAndMetadata commentAndMetadata = ParserTestCase.parse5("parseCommentA
ndMetadata", "/** 1 */ void", []); |
| 1912 JUnitTestCase.assertNotNull(commentAndMetadata.comment); | 1912 JUnitTestCase.assertNotNull(commentAndMetadata.comment); |
| 1913 EngineTestCase.assertSize(0, commentAndMetadata.metadata); | 1913 EngineTestCase.assertSize(0, commentAndMetadata.metadata); |
| 1914 } | 1914 } |
| 1915 void test_parseCommentAndMetadata_cmc() { | 1915 void test_parseCommentAndMetadata_cmc() { |
| 1916 CommentAndMetadata commentAndMetadata = ParserTestCase.parse4("parseCommentA
ndMetadata", "/** 1 */ @A /** 2 */ void", []); | 1916 CommentAndMetadata commentAndMetadata = ParserTestCase.parse5("parseCommentA
ndMetadata", "/** 1 */ @A /** 2 */ void", []); |
| 1917 JUnitTestCase.assertNotNull(commentAndMetadata.comment); | 1917 JUnitTestCase.assertNotNull(commentAndMetadata.comment); |
| 1918 EngineTestCase.assertSize(1, commentAndMetadata.metadata); | 1918 EngineTestCase.assertSize(1, commentAndMetadata.metadata); |
| 1919 } | 1919 } |
| 1920 void test_parseCommentAndMetadata_cmcm() { | 1920 void test_parseCommentAndMetadata_cmcm() { |
| 1921 CommentAndMetadata commentAndMetadata = ParserTestCase.parse4("parseCommentA
ndMetadata", "/** 1 */ @A /** 2 */ @B void", []); | 1921 CommentAndMetadata commentAndMetadata = ParserTestCase.parse5("parseCommentA
ndMetadata", "/** 1 */ @A /** 2 */ @B void", []); |
| 1922 JUnitTestCase.assertNotNull(commentAndMetadata.comment); | 1922 JUnitTestCase.assertNotNull(commentAndMetadata.comment); |
| 1923 EngineTestCase.assertSize(2, commentAndMetadata.metadata); | 1923 EngineTestCase.assertSize(2, commentAndMetadata.metadata); |
| 1924 } | 1924 } |
| 1925 void test_parseCommentAndMetadata_cmm() { | 1925 void test_parseCommentAndMetadata_cmm() { |
| 1926 CommentAndMetadata commentAndMetadata = ParserTestCase.parse4("parseCommentA
ndMetadata", "/** 1 */ @A @B void", []); | 1926 CommentAndMetadata commentAndMetadata = ParserTestCase.parse5("parseCommentA
ndMetadata", "/** 1 */ @A @B void", []); |
| 1927 JUnitTestCase.assertNotNull(commentAndMetadata.comment); | 1927 JUnitTestCase.assertNotNull(commentAndMetadata.comment); |
| 1928 EngineTestCase.assertSize(2, commentAndMetadata.metadata); | 1928 EngineTestCase.assertSize(2, commentAndMetadata.metadata); |
| 1929 } | 1929 } |
| 1930 void test_parseCommentAndMetadata_m() { | 1930 void test_parseCommentAndMetadata_m() { |
| 1931 CommentAndMetadata commentAndMetadata = ParserTestCase.parse4("parseCommentA
ndMetadata", "@A void", []); | 1931 CommentAndMetadata commentAndMetadata = ParserTestCase.parse5("parseCommentA
ndMetadata", "@A void", []); |
| 1932 JUnitTestCase.assertNull(commentAndMetadata.comment); | 1932 JUnitTestCase.assertNull(commentAndMetadata.comment); |
| 1933 EngineTestCase.assertSize(1, commentAndMetadata.metadata); | 1933 EngineTestCase.assertSize(1, commentAndMetadata.metadata); |
| 1934 } | 1934 } |
| 1935 void test_parseCommentAndMetadata_mcm() { | 1935 void test_parseCommentAndMetadata_mcm() { |
| 1936 CommentAndMetadata commentAndMetadata = ParserTestCase.parse4("parseCommentA
ndMetadata", "@A /** 1 */ @B void", []); | 1936 CommentAndMetadata commentAndMetadata = ParserTestCase.parse5("parseCommentA
ndMetadata", "@A /** 1 */ @B void", []); |
| 1937 JUnitTestCase.assertNotNull(commentAndMetadata.comment); | 1937 JUnitTestCase.assertNotNull(commentAndMetadata.comment); |
| 1938 EngineTestCase.assertSize(2, commentAndMetadata.metadata); | 1938 EngineTestCase.assertSize(2, commentAndMetadata.metadata); |
| 1939 } | 1939 } |
| 1940 void test_parseCommentAndMetadata_mcmc() { | 1940 void test_parseCommentAndMetadata_mcmc() { |
| 1941 CommentAndMetadata commentAndMetadata = ParserTestCase.parse4("parseCommentA
ndMetadata", "@A /** 1 */ @B /** 2 */ void", []); | 1941 CommentAndMetadata commentAndMetadata = ParserTestCase.parse5("parseCommentA
ndMetadata", "@A /** 1 */ @B /** 2 */ void", []); |
| 1942 JUnitTestCase.assertNotNull(commentAndMetadata.comment); | 1942 JUnitTestCase.assertNotNull(commentAndMetadata.comment); |
| 1943 EngineTestCase.assertSize(2, commentAndMetadata.metadata); | 1943 EngineTestCase.assertSize(2, commentAndMetadata.metadata); |
| 1944 } | 1944 } |
| 1945 void test_parseCommentAndMetadata_mm() { | 1945 void test_parseCommentAndMetadata_mm() { |
| 1946 CommentAndMetadata commentAndMetadata = ParserTestCase.parse4("parseCommentA
ndMetadata", "@A @B(x) void", []); | 1946 CommentAndMetadata commentAndMetadata = ParserTestCase.parse5("parseCommentA
ndMetadata", "@A @B(x) void", []); |
| 1947 JUnitTestCase.assertNull(commentAndMetadata.comment); | 1947 JUnitTestCase.assertNull(commentAndMetadata.comment); |
| 1948 EngineTestCase.assertSize(2, commentAndMetadata.metadata); | 1948 EngineTestCase.assertSize(2, commentAndMetadata.metadata); |
| 1949 } | 1949 } |
| 1950 void test_parseCommentAndMetadata_none() { | 1950 void test_parseCommentAndMetadata_none() { |
| 1951 CommentAndMetadata commentAndMetadata = ParserTestCase.parse4("parseCommentA
ndMetadata", "void", []); | 1951 CommentAndMetadata commentAndMetadata = ParserTestCase.parse5("parseCommentA
ndMetadata", "void", []); |
| 1952 JUnitTestCase.assertNull(commentAndMetadata.comment); | 1952 JUnitTestCase.assertNull(commentAndMetadata.comment); |
| 1953 EngineTestCase.assertSize(0, commentAndMetadata.metadata); | 1953 EngineTestCase.assertSize(0, commentAndMetadata.metadata); |
| 1954 } | 1954 } |
| 1955 void test_parseCommentReference_new_prefixed() { | 1955 void test_parseCommentReference_new_prefixed() { |
| 1956 CommentReference reference = ParserTestCase.parse("parseCommentReference", <
Object> ["new a.b", 7], ""); | 1956 CommentReference reference = ParserTestCase.parse("parseCommentReference", <
Object> ["new a.b", 7], ""); |
| 1957 PrefixedIdentifier prefixedIdentifier = EngineTestCase.assertInstanceOf(Pref
ixedIdentifier, reference.identifier); | 1957 PrefixedIdentifier prefixedIdentifier = EngineTestCase.assertInstanceOf(Pref
ixedIdentifier, reference.identifier); |
| 1958 SimpleIdentifier prefix9 = prefixedIdentifier.prefix; | 1958 SimpleIdentifier prefix10 = prefixedIdentifier.prefix; |
| 1959 JUnitTestCase.assertNotNull(prefix9.token); | 1959 JUnitTestCase.assertNotNull(prefix10.token); |
| 1960 JUnitTestCase.assertEquals("a", prefix9.name); | 1960 JUnitTestCase.assertEquals("a", prefix10.name); |
| 1961 JUnitTestCase.assertEquals(11, prefix9.offset); | 1961 JUnitTestCase.assertEquals(11, prefix10.offset); |
| 1962 JUnitTestCase.assertNotNull(prefixedIdentifier.period); | 1962 JUnitTestCase.assertNotNull(prefixedIdentifier.period); |
| 1963 SimpleIdentifier identifier9 = prefixedIdentifier.identifier; | 1963 SimpleIdentifier identifier14 = prefixedIdentifier.identifier; |
| 1964 JUnitTestCase.assertNotNull(identifier9.token); | 1964 JUnitTestCase.assertNotNull(identifier14.token); |
| 1965 JUnitTestCase.assertEquals("b", identifier9.name); | 1965 JUnitTestCase.assertEquals("b", identifier14.name); |
| 1966 JUnitTestCase.assertEquals(13, identifier9.offset); | 1966 JUnitTestCase.assertEquals(13, identifier14.offset); |
| 1967 } | 1967 } |
| 1968 void test_parseCommentReference_new_simple() { | 1968 void test_parseCommentReference_new_simple() { |
| 1969 CommentReference reference = ParserTestCase.parse("parseCommentReference", <
Object> ["new a", 5], ""); | 1969 CommentReference reference = ParserTestCase.parse("parseCommentReference", <
Object> ["new a", 5], ""); |
| 1970 SimpleIdentifier identifier10 = EngineTestCase.assertInstanceOf(SimpleIdenti
fier, reference.identifier); | 1970 SimpleIdentifier identifier15 = EngineTestCase.assertInstanceOf(SimpleIdenti
fier, reference.identifier); |
| 1971 JUnitTestCase.assertNotNull(identifier10.token); | 1971 JUnitTestCase.assertNotNull(identifier15.token); |
| 1972 JUnitTestCase.assertEquals("a", identifier10.name); | 1972 JUnitTestCase.assertEquals("a", identifier15.name); |
| 1973 JUnitTestCase.assertEquals(9, identifier10.offset); | 1973 JUnitTestCase.assertEquals(9, identifier15.offset); |
| 1974 } | 1974 } |
| 1975 void test_parseCommentReference_prefixed() { | 1975 void test_parseCommentReference_prefixed() { |
| 1976 CommentReference reference = ParserTestCase.parse("parseCommentReference", <
Object> ["a.b", 7], ""); | 1976 CommentReference reference = ParserTestCase.parse("parseCommentReference", <
Object> ["a.b", 7], ""); |
| 1977 PrefixedIdentifier prefixedIdentifier = EngineTestCase.assertInstanceOf(Pref
ixedIdentifier, reference.identifier); | 1977 PrefixedIdentifier prefixedIdentifier = EngineTestCase.assertInstanceOf(Pref
ixedIdentifier, reference.identifier); |
| 1978 SimpleIdentifier prefix10 = prefixedIdentifier.prefix; | 1978 SimpleIdentifier prefix11 = prefixedIdentifier.prefix; |
| 1979 JUnitTestCase.assertNotNull(prefix10.token); | 1979 JUnitTestCase.assertNotNull(prefix11.token); |
| 1980 JUnitTestCase.assertEquals("a", prefix10.name); | 1980 JUnitTestCase.assertEquals("a", prefix11.name); |
| 1981 JUnitTestCase.assertEquals(7, prefix10.offset); | 1981 JUnitTestCase.assertEquals(7, prefix11.offset); |
| 1982 JUnitTestCase.assertNotNull(prefixedIdentifier.period); | 1982 JUnitTestCase.assertNotNull(prefixedIdentifier.period); |
| 1983 SimpleIdentifier identifier11 = prefixedIdentifier.identifier; | 1983 SimpleIdentifier identifier16 = prefixedIdentifier.identifier; |
| 1984 JUnitTestCase.assertNotNull(identifier11.token); | 1984 JUnitTestCase.assertNotNull(identifier16.token); |
| 1985 JUnitTestCase.assertEquals("b", identifier11.name); | 1985 JUnitTestCase.assertEquals("b", identifier16.name); |
| 1986 JUnitTestCase.assertEquals(9, identifier11.offset); | 1986 JUnitTestCase.assertEquals(9, identifier16.offset); |
| 1987 } | 1987 } |
| 1988 void test_parseCommentReference_simple() { | 1988 void test_parseCommentReference_simple() { |
| 1989 CommentReference reference = ParserTestCase.parse("parseCommentReference", <
Object> ["a", 5], ""); | 1989 CommentReference reference = ParserTestCase.parse("parseCommentReference", <
Object> ["a", 5], ""); |
| 1990 SimpleIdentifier identifier12 = EngineTestCase.assertInstanceOf(SimpleIdenti
fier, reference.identifier); | 1990 SimpleIdentifier identifier17 = EngineTestCase.assertInstanceOf(SimpleIdenti
fier, reference.identifier); |
| 1991 JUnitTestCase.assertNotNull(identifier12.token); | 1991 JUnitTestCase.assertNotNull(identifier17.token); |
| 1992 JUnitTestCase.assertEquals("a", identifier12.name); | 1992 JUnitTestCase.assertEquals("a", identifier17.name); |
| 1993 JUnitTestCase.assertEquals(5, identifier12.offset); | 1993 JUnitTestCase.assertEquals(5, identifier17.offset); |
| 1994 } | 1994 } |
| 1995 void test_parseCommentReferences_multiLine() { | 1995 void test_parseCommentReferences_multiLine() { |
| 1996 List<Token> tokens = <Token> [new StringToken(TokenType.MULTI_LINE_COMMENT,
"/** xxx [a] yyy [b] zzz */", 3)]; | 1996 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], ""); | 1997 List<CommentReference> references = ParserTestCase.parse("parseCommentRefere
nces", <Object> [tokens], ""); |
| 1998 EngineTestCase.assertSize(2, references); | 1998 EngineTestCase.assertSize(2, references); |
| 1999 CommentReference reference = references[0]; | 1999 CommentReference reference = references[0]; |
| 2000 JUnitTestCase.assertNotNull(reference); | 2000 JUnitTestCase.assertNotNull(reference); |
| 2001 JUnitTestCase.assertNotNull(reference.identifier); | 2001 JUnitTestCase.assertNotNull(reference.identifier); |
| 2002 JUnitTestCase.assertEquals(12, reference.offset); | 2002 JUnitTestCase.assertEquals(12, reference.offset); |
| 2003 reference = references[1]; | 2003 reference = references[1]; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 2016 reference = references[1]; | 2016 reference = references[1]; |
| 2017 JUnitTestCase.assertNotNull(reference); | 2017 JUnitTestCase.assertNotNull(reference); |
| 2018 JUnitTestCase.assertNotNull(reference.identifier); | 2018 JUnitTestCase.assertNotNull(reference.identifier); |
| 2019 JUnitTestCase.assertEquals(20, reference.offset); | 2019 JUnitTestCase.assertEquals(20, reference.offset); |
| 2020 reference = references[2]; | 2020 reference = references[2]; |
| 2021 JUnitTestCase.assertNotNull(reference); | 2021 JUnitTestCase.assertNotNull(reference); |
| 2022 JUnitTestCase.assertNotNull(reference.identifier); | 2022 JUnitTestCase.assertNotNull(reference.identifier); |
| 2023 JUnitTestCase.assertEquals(35, reference.offset); | 2023 JUnitTestCase.assertEquals(35, reference.offset); |
| 2024 } | 2024 } |
| 2025 void test_parseCompilationUnit_directives_multiple() { | 2025 void test_parseCompilationUnit_directives_multiple() { |
| 2026 CompilationUnit unit = ParserTestCase.parse4("parseCompilationUnit", "librar
y l;\npart 'a.dart';", []); | 2026 CompilationUnit unit = ParserTestCase.parse5("parseCompilationUnit", "librar
y l;\npart 'a.dart';", []); |
| 2027 JUnitTestCase.assertNull(unit.scriptTag); | 2027 JUnitTestCase.assertNull(unit.scriptTag); |
| 2028 EngineTestCase.assertSize(2, unit.directives); | 2028 EngineTestCase.assertSize(2, unit.directives); |
| 2029 EngineTestCase.assertSize(0, unit.declarations); | 2029 EngineTestCase.assertSize(0, unit.declarations); |
| 2030 } | 2030 } |
| 2031 void test_parseCompilationUnit_directives_single() { | 2031 void test_parseCompilationUnit_directives_single() { |
| 2032 CompilationUnit unit = ParserTestCase.parse4("parseCompilationUnit", "librar
y l;", []); | 2032 CompilationUnit unit = ParserTestCase.parse5("parseCompilationUnit", "librar
y l;", []); |
| 2033 JUnitTestCase.assertNull(unit.scriptTag); | 2033 JUnitTestCase.assertNull(unit.scriptTag); |
| 2034 EngineTestCase.assertSize(1, unit.directives); | 2034 EngineTestCase.assertSize(1, unit.directives); |
| 2035 EngineTestCase.assertSize(0, unit.declarations); | 2035 EngineTestCase.assertSize(0, unit.declarations); |
| 2036 } | 2036 } |
| 2037 void test_parseCompilationUnit_empty() { | 2037 void test_parseCompilationUnit_empty() { |
| 2038 CompilationUnit unit = ParserTestCase.parse4("parseCompilationUnit", "", [])
; | 2038 CompilationUnit unit = ParserTestCase.parse5("parseCompilationUnit", "", [])
; |
| 2039 JUnitTestCase.assertNull(unit.scriptTag); | 2039 JUnitTestCase.assertNull(unit.scriptTag); |
| 2040 EngineTestCase.assertSize(0, unit.directives); | 2040 EngineTestCase.assertSize(0, unit.directives); |
| 2041 EngineTestCase.assertSize(0, unit.declarations); | 2041 EngineTestCase.assertSize(0, unit.declarations); |
| 2042 } | 2042 } |
| 2043 void test_parseCompilationUnit_script() { | 2043 void test_parseCompilationUnit_script() { |
| 2044 CompilationUnit unit = ParserTestCase.parse4("parseCompilationUnit", "#! /bi
n/dart", []); | 2044 CompilationUnit unit = ParserTestCase.parse5("parseCompilationUnit", "#! /bi
n/dart", []); |
| 2045 JUnitTestCase.assertNotNull(unit.scriptTag); | 2045 JUnitTestCase.assertNotNull(unit.scriptTag); |
| 2046 EngineTestCase.assertSize(0, unit.directives); | 2046 EngineTestCase.assertSize(0, unit.directives); |
| 2047 EngineTestCase.assertSize(0, unit.declarations); | 2047 EngineTestCase.assertSize(0, unit.declarations); |
| 2048 } | 2048 } |
| 2049 void test_parseCompilationUnit_topLevelDeclaration() { | 2049 void test_parseCompilationUnit_topLevelDeclaration() { |
| 2050 CompilationUnit unit = ParserTestCase.parse4("parseCompilationUnit", "class
A {}", []); | 2050 CompilationUnit unit = ParserTestCase.parse5("parseCompilationUnit", "class
A {}", []); |
| 2051 JUnitTestCase.assertNull(unit.scriptTag); | 2051 JUnitTestCase.assertNull(unit.scriptTag); |
| 2052 EngineTestCase.assertSize(0, unit.directives); | 2052 EngineTestCase.assertSize(0, unit.directives); |
| 2053 EngineTestCase.assertSize(1, unit.declarations); | 2053 EngineTestCase.assertSize(1, unit.declarations); |
| 2054 } | 2054 } |
| 2055 void test_parseCompilationUnitMember_class() { | 2055 void test_parseCompilationUnitMember_class() { |
| 2056 ClassDeclaration declaration = ParserTestCase.parse("parseCompilationUnitMem
ber", <Object> [emptyCommentAndMetadata()], "class A {}"); | 2056 ClassDeclaration declaration = ParserTestCase.parse("parseCompilationUnitMem
ber", <Object> [emptyCommentAndMetadata()], "class A {}"); |
| 2057 JUnitTestCase.assertEquals("A", declaration.name.name); | 2057 JUnitTestCase.assertEquals("A", declaration.name.name); |
| 2058 EngineTestCase.assertSize(0, declaration.members); | 2058 EngineTestCase.assertSize(0, declaration.members); |
| 2059 } | 2059 } |
| 2060 void test_parseCompilationUnitMember_constVariable() { | 2060 void test_parseCompilationUnitMember_constVariable() { |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2185 FunctionTypeAlias typeAlias = ParserTestCase.parse("parseCompilationUnitMemb
er", <Object> [emptyCommentAndMetadata()], "typedef F();"); | 2185 FunctionTypeAlias typeAlias = ParserTestCase.parse("parseCompilationUnitMemb
er", <Object> [emptyCommentAndMetadata()], "typedef F();"); |
| 2186 JUnitTestCase.assertEquals("F", typeAlias.name.name); | 2186 JUnitTestCase.assertEquals("F", typeAlias.name.name); |
| 2187 EngineTestCase.assertSize(0, typeAlias.parameters.parameters); | 2187 EngineTestCase.assertSize(0, typeAlias.parameters.parameters); |
| 2188 } | 2188 } |
| 2189 void test_parseCompilationUnitMember_variable() { | 2189 void test_parseCompilationUnitMember_variable() { |
| 2190 TopLevelVariableDeclaration declaration = ParserTestCase.parse("parseCompila
tionUnitMember", <Object> [emptyCommentAndMetadata()], "var x = 0;"); | 2190 TopLevelVariableDeclaration declaration = ParserTestCase.parse("parseCompila
tionUnitMember", <Object> [emptyCommentAndMetadata()], "var x = 0;"); |
| 2191 JUnitTestCase.assertNotNull(declaration.semicolon); | 2191 JUnitTestCase.assertNotNull(declaration.semicolon); |
| 2192 JUnitTestCase.assertNotNull(declaration.variables); | 2192 JUnitTestCase.assertNotNull(declaration.variables); |
| 2193 } | 2193 } |
| 2194 void test_parseConditionalExpression() { | 2194 void test_parseConditionalExpression() { |
| 2195 ConditionalExpression expression = ParserTestCase.parse4("parseConditionalEx
pression", "x ? y : z", []); | 2195 ConditionalExpression expression = ParserTestCase.parse5("parseConditionalEx
pression", "x ? y : z", []); |
| 2196 JUnitTestCase.assertNotNull(expression.condition); | 2196 JUnitTestCase.assertNotNull(expression.condition); |
| 2197 JUnitTestCase.assertNotNull(expression.question); | 2197 JUnitTestCase.assertNotNull(expression.question); |
| 2198 JUnitTestCase.assertNotNull(expression.thenExpression); | 2198 JUnitTestCase.assertNotNull(expression.thenExpression); |
| 2199 JUnitTestCase.assertNotNull(expression.colon); | 2199 JUnitTestCase.assertNotNull(expression.colon); |
| 2200 JUnitTestCase.assertNotNull(expression.elseExpression); | 2200 JUnitTestCase.assertNotNull(expression.elseExpression); |
| 2201 } | 2201 } |
| 2202 void test_parseConstExpression_instanceCreation() { | 2202 void test_parseConstExpression_instanceCreation() { |
| 2203 InstanceCreationExpression expression = ParserTestCase.parse4("parseConstExp
ression", "const A()", []); | 2203 InstanceCreationExpression expression = ParserTestCase.parse5("parseConstExp
ression", "const A()", []); |
| 2204 JUnitTestCase.assertNotNull(expression.keyword); | 2204 JUnitTestCase.assertNotNull(expression.keyword); |
| 2205 ConstructorName name = expression.constructorName; | 2205 ConstructorName name = expression.constructorName; |
| 2206 JUnitTestCase.assertNotNull(name); | 2206 JUnitTestCase.assertNotNull(name); |
| 2207 JUnitTestCase.assertNotNull(name.type); | 2207 JUnitTestCase.assertNotNull(name.type); |
| 2208 JUnitTestCase.assertNull(name.period); | 2208 JUnitTestCase.assertNull(name.period); |
| 2209 JUnitTestCase.assertNull(name.name); | 2209 JUnitTestCase.assertNull(name.name); |
| 2210 JUnitTestCase.assertNotNull(expression.argumentList); | 2210 JUnitTestCase.assertNotNull(expression.argumentList); |
| 2211 } | 2211 } |
| 2212 void test_parseConstExpression_listLiteral_typed() { | 2212 void test_parseConstExpression_listLiteral_typed() { |
| 2213 ListLiteral literal = ParserTestCase.parse4("parseConstExpression", "const <
A> []", []); | 2213 ListLiteral literal = ParserTestCase.parse5("parseConstExpression", "const <
A> []", []); |
| 2214 JUnitTestCase.assertNotNull(literal.modifier); | 2214 JUnitTestCase.assertNotNull(literal.modifier); |
| 2215 JUnitTestCase.assertNotNull(literal.typeArguments); | 2215 JUnitTestCase.assertNotNull(literal.typeArguments); |
| 2216 JUnitTestCase.assertNotNull(literal.leftBracket); | 2216 JUnitTestCase.assertNotNull(literal.leftBracket); |
| 2217 EngineTestCase.assertSize(0, literal.elements); | 2217 EngineTestCase.assertSize(0, literal.elements); |
| 2218 JUnitTestCase.assertNotNull(literal.rightBracket); | 2218 JUnitTestCase.assertNotNull(literal.rightBracket); |
| 2219 } | 2219 } |
| 2220 void test_parseConstExpression_listLiteral_untyped() { | 2220 void test_parseConstExpression_listLiteral_untyped() { |
| 2221 ListLiteral literal = ParserTestCase.parse4("parseConstExpression", "const [
]", []); | 2221 ListLiteral literal = ParserTestCase.parse5("parseConstExpression", "const [
]", []); |
| 2222 JUnitTestCase.assertNotNull(literal.modifier); | 2222 JUnitTestCase.assertNotNull(literal.modifier); |
| 2223 JUnitTestCase.assertNull(literal.typeArguments); | 2223 JUnitTestCase.assertNull(literal.typeArguments); |
| 2224 JUnitTestCase.assertNotNull(literal.leftBracket); | 2224 JUnitTestCase.assertNotNull(literal.leftBracket); |
| 2225 EngineTestCase.assertSize(0, literal.elements); | 2225 EngineTestCase.assertSize(0, literal.elements); |
| 2226 JUnitTestCase.assertNotNull(literal.rightBracket); | 2226 JUnitTestCase.assertNotNull(literal.rightBracket); |
| 2227 } | 2227 } |
| 2228 void test_parseConstExpression_mapLiteral_typed() { | 2228 void test_parseConstExpression_mapLiteral_typed() { |
| 2229 MapLiteral literal = ParserTestCase.parse4("parseConstExpression", "const <A
> {}", []); | 2229 MapLiteral literal = ParserTestCase.parse5("parseConstExpression", "const <A
> {}", []); |
| 2230 JUnitTestCase.assertNotNull(literal.leftBracket); | 2230 JUnitTestCase.assertNotNull(literal.leftBracket); |
| 2231 EngineTestCase.assertSize(0, literal.entries); | 2231 EngineTestCase.assertSize(0, literal.entries); |
| 2232 JUnitTestCase.assertNotNull(literal.rightBracket); | 2232 JUnitTestCase.assertNotNull(literal.rightBracket); |
| 2233 JUnitTestCase.assertNotNull(literal.typeArguments); | 2233 JUnitTestCase.assertNotNull(literal.typeArguments); |
| 2234 } | 2234 } |
| 2235 void test_parseConstExpression_mapLiteral_untyped() { | 2235 void test_parseConstExpression_mapLiteral_untyped() { |
| 2236 MapLiteral literal = ParserTestCase.parse4("parseConstExpression", "const {}
", []); | 2236 MapLiteral literal = ParserTestCase.parse5("parseConstExpression", "const {}
", []); |
| 2237 JUnitTestCase.assertNotNull(literal.leftBracket); | 2237 JUnitTestCase.assertNotNull(literal.leftBracket); |
| 2238 EngineTestCase.assertSize(0, literal.entries); | 2238 EngineTestCase.assertSize(0, literal.entries); |
| 2239 JUnitTestCase.assertNotNull(literal.rightBracket); | 2239 JUnitTestCase.assertNotNull(literal.rightBracket); |
| 2240 JUnitTestCase.assertNull(literal.typeArguments); | 2240 JUnitTestCase.assertNull(literal.typeArguments); |
| 2241 } | 2241 } |
| 2242 void test_parseConstructor() { | 2242 void test_parseConstructor() { |
| 2243 } | 2243 } |
| 2244 void test_parseConstructorFieldInitializer_qualified() { | 2244 void test_parseConstructorFieldInitializer_qualified() { |
| 2245 ConstructorFieldInitializer invocation = ParserTestCase.parse4("parseConstru
ctorFieldInitializer", "this.a = b", []); | 2245 ConstructorFieldInitializer invocation = ParserTestCase.parse5("parseConstru
ctorFieldInitializer", "this.a = b", []); |
| 2246 JUnitTestCase.assertNotNull(invocation.equals); | 2246 JUnitTestCase.assertNotNull(invocation.equals); |
| 2247 JUnitTestCase.assertNotNull(invocation.expression); | 2247 JUnitTestCase.assertNotNull(invocation.expression); |
| 2248 JUnitTestCase.assertNotNull(invocation.fieldName); | 2248 JUnitTestCase.assertNotNull(invocation.fieldName); |
| 2249 JUnitTestCase.assertNotNull(invocation.keyword); | 2249 JUnitTestCase.assertNotNull(invocation.keyword); |
| 2250 JUnitTestCase.assertNotNull(invocation.period); | 2250 JUnitTestCase.assertNotNull(invocation.period); |
| 2251 } | 2251 } |
| 2252 void test_parseConstructorFieldInitializer_unqualified() { | 2252 void test_parseConstructorFieldInitializer_unqualified() { |
| 2253 ConstructorFieldInitializer invocation = ParserTestCase.parse4("parseConstru
ctorFieldInitializer", "a = b", []); | 2253 ConstructorFieldInitializer invocation = ParserTestCase.parse5("parseConstru
ctorFieldInitializer", "a = b", []); |
| 2254 JUnitTestCase.assertNotNull(invocation.equals); | 2254 JUnitTestCase.assertNotNull(invocation.equals); |
| 2255 JUnitTestCase.assertNotNull(invocation.expression); | 2255 JUnitTestCase.assertNotNull(invocation.expression); |
| 2256 JUnitTestCase.assertNotNull(invocation.fieldName); | 2256 JUnitTestCase.assertNotNull(invocation.fieldName); |
| 2257 JUnitTestCase.assertNull(invocation.keyword); | 2257 JUnitTestCase.assertNull(invocation.keyword); |
| 2258 JUnitTestCase.assertNull(invocation.period); | 2258 JUnitTestCase.assertNull(invocation.period); |
| 2259 } | 2259 } |
| 2260 void test_parseConstructorName_named_noPrefix() { | 2260 void test_parseConstructorName_named_noPrefix() { |
| 2261 ConstructorName name = ParserTestCase.parse4("parseConstructorName", "A.n;",
[]); | 2261 ConstructorName name = ParserTestCase.parse5("parseConstructorName", "A.n;",
[]); |
| 2262 JUnitTestCase.assertNotNull(name.type); | 2262 JUnitTestCase.assertNotNull(name.type); |
| 2263 JUnitTestCase.assertNull(name.period); | 2263 JUnitTestCase.assertNull(name.period); |
| 2264 JUnitTestCase.assertNull(name.name); | 2264 JUnitTestCase.assertNull(name.name); |
| 2265 } | 2265 } |
| 2266 void test_parseConstructorName_named_prefixed() { | 2266 void test_parseConstructorName_named_prefixed() { |
| 2267 ConstructorName name = ParserTestCase.parse4("parseConstructorName", "p.A.n;
", []); | 2267 ConstructorName name = ParserTestCase.parse5("parseConstructorName", "p.A.n;
", []); |
| 2268 JUnitTestCase.assertNotNull(name.type); | 2268 JUnitTestCase.assertNotNull(name.type); |
| 2269 JUnitTestCase.assertNotNull(name.period); | 2269 JUnitTestCase.assertNotNull(name.period); |
| 2270 JUnitTestCase.assertNotNull(name.name); | 2270 JUnitTestCase.assertNotNull(name.name); |
| 2271 } | 2271 } |
| 2272 void test_parseConstructorName_unnamed_noPrefix() { | 2272 void test_parseConstructorName_unnamed_noPrefix() { |
| 2273 ConstructorName name = ParserTestCase.parse4("parseConstructorName", "A;", [
]); | 2273 ConstructorName name = ParserTestCase.parse5("parseConstructorName", "A;", [
]); |
| 2274 JUnitTestCase.assertNotNull(name.type); | 2274 JUnitTestCase.assertNotNull(name.type); |
| 2275 JUnitTestCase.assertNull(name.period); | 2275 JUnitTestCase.assertNull(name.period); |
| 2276 JUnitTestCase.assertNull(name.name); | 2276 JUnitTestCase.assertNull(name.name); |
| 2277 } | 2277 } |
| 2278 void test_parseConstructorName_unnamed_prefixed() { | 2278 void test_parseConstructorName_unnamed_prefixed() { |
| 2279 ConstructorName name = ParserTestCase.parse4("parseConstructorName", "p.A;",
[]); | 2279 ConstructorName name = ParserTestCase.parse5("parseConstructorName", "p.A;",
[]); |
| 2280 JUnitTestCase.assertNotNull(name.type); | 2280 JUnitTestCase.assertNotNull(name.type); |
| 2281 JUnitTestCase.assertNull(name.period); | 2281 JUnitTestCase.assertNull(name.period); |
| 2282 JUnitTestCase.assertNull(name.name); | 2282 JUnitTestCase.assertNull(name.name); |
| 2283 } | 2283 } |
| 2284 void test_parseContinueStatement_label() { | 2284 void test_parseContinueStatement_label() { |
| 2285 ContinueStatement statement = ParserTestCase.parse4("parseContinueStatement"
, "continue foo;", [ParserErrorCode.CONTINUE_OUTSIDE_OF_LOOP]); | 2285 ContinueStatement statement = ParserTestCase.parse5("parseContinueStatement"
, "continue foo;", [ParserErrorCode.CONTINUE_OUTSIDE_OF_LOOP]); |
| 2286 JUnitTestCase.assertNotNull(statement.keyword); | 2286 JUnitTestCase.assertNotNull(statement.keyword); |
| 2287 JUnitTestCase.assertNotNull(statement.label); | 2287 JUnitTestCase.assertNotNull(statement.label); |
| 2288 JUnitTestCase.assertNotNull(statement.semicolon); | 2288 JUnitTestCase.assertNotNull(statement.semicolon); |
| 2289 } | 2289 } |
| 2290 void test_parseContinueStatement_noLabel() { | 2290 void test_parseContinueStatement_noLabel() { |
| 2291 ContinueStatement statement = ParserTestCase.parse4("parseContinueStatement"
, "continue;", [ParserErrorCode.CONTINUE_OUTSIDE_OF_LOOP]); | 2291 ContinueStatement statement = ParserTestCase.parse5("parseContinueStatement"
, "continue;", [ParserErrorCode.CONTINUE_OUTSIDE_OF_LOOP]); |
| 2292 JUnitTestCase.assertNotNull(statement.keyword); | 2292 JUnitTestCase.assertNotNull(statement.keyword); |
| 2293 JUnitTestCase.assertNull(statement.label); | 2293 JUnitTestCase.assertNull(statement.label); |
| 2294 JUnitTestCase.assertNotNull(statement.semicolon); | 2294 JUnitTestCase.assertNotNull(statement.semicolon); |
| 2295 } | 2295 } |
| 2296 void test_parseDirective_export() { | 2296 void test_parseDirective_export() { |
| 2297 ExportDirective directive = ParserTestCase.parse("parseDirective", <Object>
[emptyCommentAndMetadata()], "export 'lib/lib.dart';"); | 2297 ExportDirective directive = ParserTestCase.parse("parseDirective", <Object>
[emptyCommentAndMetadata()], "export 'lib/lib.dart';"); |
| 2298 JUnitTestCase.assertNotNull(directive.keyword); | 2298 JUnitTestCase.assertNotNull(directive.keyword); |
| 2299 JUnitTestCase.assertNotNull(directive.libraryUri); | 2299 JUnitTestCase.assertNotNull(directive.uri); |
| 2300 EngineTestCase.assertSize(0, directive.combinators); | 2300 EngineTestCase.assertSize(0, directive.combinators); |
| 2301 JUnitTestCase.assertNotNull(directive.semicolon); | 2301 JUnitTestCase.assertNotNull(directive.semicolon); |
| 2302 } | 2302 } |
| 2303 void test_parseDirective_import() { | 2303 void test_parseDirective_import() { |
| 2304 ImportDirective directive = ParserTestCase.parse("parseDirective", <Object>
[emptyCommentAndMetadata()], "import 'lib/lib.dart';"); | 2304 ImportDirective directive = ParserTestCase.parse("parseDirective", <Object>
[emptyCommentAndMetadata()], "import 'lib/lib.dart';"); |
| 2305 JUnitTestCase.assertNotNull(directive.keyword); | 2305 JUnitTestCase.assertNotNull(directive.keyword); |
| 2306 JUnitTestCase.assertNotNull(directive.libraryUri); | 2306 JUnitTestCase.assertNotNull(directive.uri); |
| 2307 JUnitTestCase.assertNull(directive.asToken); | 2307 JUnitTestCase.assertNull(directive.asToken); |
| 2308 JUnitTestCase.assertNull(directive.prefix); | 2308 JUnitTestCase.assertNull(directive.prefix); |
| 2309 EngineTestCase.assertSize(0, directive.combinators); | 2309 EngineTestCase.assertSize(0, directive.combinators); |
| 2310 JUnitTestCase.assertNotNull(directive.semicolon); | 2310 JUnitTestCase.assertNotNull(directive.semicolon); |
| 2311 } | 2311 } |
| 2312 void test_parseDirective_library() { | 2312 void test_parseDirective_library() { |
| 2313 LibraryDirective directive = ParserTestCase.parse("parseDirective", <Object>
[emptyCommentAndMetadata()], "library l;"); | 2313 LibraryDirective directive = ParserTestCase.parse("parseDirective", <Object>
[emptyCommentAndMetadata()], "library l;"); |
| 2314 JUnitTestCase.assertNotNull(directive.libraryToken); | 2314 JUnitTestCase.assertNotNull(directive.libraryToken); |
| 2315 JUnitTestCase.assertNotNull(directive.name); | 2315 JUnitTestCase.assertNotNull(directive.name); |
| 2316 JUnitTestCase.assertNotNull(directive.semicolon); | 2316 JUnitTestCase.assertNotNull(directive.semicolon); |
| 2317 } | 2317 } |
| 2318 void test_parseDirective_part() { | 2318 void test_parseDirective_part() { |
| 2319 PartDirective directive = ParserTestCase.parse("parseDirective", <Object> [e
mptyCommentAndMetadata()], "part 'lib/lib.dart';"); | 2319 PartDirective directive = ParserTestCase.parse("parseDirective", <Object> [e
mptyCommentAndMetadata()], "part 'lib/lib.dart';"); |
| 2320 JUnitTestCase.assertNotNull(directive.partToken); | 2320 JUnitTestCase.assertNotNull(directive.partToken); |
| 2321 JUnitTestCase.assertNotNull(directive.partUri); | 2321 JUnitTestCase.assertNotNull(directive.uri); |
| 2322 JUnitTestCase.assertNotNull(directive.semicolon); | 2322 JUnitTestCase.assertNotNull(directive.semicolon); |
| 2323 } | 2323 } |
| 2324 void test_parseDirective_partOf() { | 2324 void test_parseDirective_partOf() { |
| 2325 PartOfDirective directive = ParserTestCase.parse("parseDirective", <Object>
[emptyCommentAndMetadata()], "part of l;"); | 2325 PartOfDirective directive = ParserTestCase.parse("parseDirective", <Object>
[emptyCommentAndMetadata()], "part of l;"); |
| 2326 JUnitTestCase.assertNotNull(directive.partToken); | 2326 JUnitTestCase.assertNotNull(directive.partToken); |
| 2327 JUnitTestCase.assertNotNull(directive.ofToken); | 2327 JUnitTestCase.assertNotNull(directive.ofToken); |
| 2328 JUnitTestCase.assertNotNull(directive.libraryName); | 2328 JUnitTestCase.assertNotNull(directive.libraryName); |
| 2329 JUnitTestCase.assertNotNull(directive.semicolon); | 2329 JUnitTestCase.assertNotNull(directive.semicolon); |
| 2330 } | 2330 } |
| 2331 void test_parseDocumentationComment_block() { | 2331 void test_parseDocumentationComment_block() { |
| 2332 Comment comment = ParserTestCase.parse4("parseDocumentationComment", "/** */
class", []); | 2332 Comment comment = ParserTestCase.parse5("parseDocumentationComment", "/** */
class", []); |
| 2333 JUnitTestCase.assertFalse(comment.isBlock()); | 2333 JUnitTestCase.assertFalse(comment.isBlock()); |
| 2334 JUnitTestCase.assertTrue(comment.isDocumentation()); | 2334 JUnitTestCase.assertTrue(comment.isDocumentation()); |
| 2335 JUnitTestCase.assertFalse(comment.isEndOfLine()); | 2335 JUnitTestCase.assertFalse(comment.isEndOfLine()); |
| 2336 } | 2336 } |
| 2337 void test_parseDocumentationComment_block_withReference() { | 2337 void test_parseDocumentationComment_block_withReference() { |
| 2338 Comment comment = ParserTestCase.parse4("parseDocumentationComment", "/** [a
] */ class", []); | 2338 Comment comment = ParserTestCase.parse5("parseDocumentationComment", "/** [a
] */ class", []); |
| 2339 JUnitTestCase.assertFalse(comment.isBlock()); | 2339 JUnitTestCase.assertFalse(comment.isBlock()); |
| 2340 JUnitTestCase.assertTrue(comment.isDocumentation()); | 2340 JUnitTestCase.assertTrue(comment.isDocumentation()); |
| 2341 JUnitTestCase.assertFalse(comment.isEndOfLine()); | 2341 JUnitTestCase.assertFalse(comment.isEndOfLine()); |
| 2342 NodeList<CommentReference> references2 = comment.references; | 2342 NodeList<CommentReference> references2 = comment.references; |
| 2343 EngineTestCase.assertSize(1, references2); | 2343 EngineTestCase.assertSize(1, references2); |
| 2344 CommentReference reference = references2[0]; | 2344 CommentReference reference = references2[0]; |
| 2345 JUnitTestCase.assertNotNull(reference); | 2345 JUnitTestCase.assertNotNull(reference); |
| 2346 JUnitTestCase.assertEquals(5, reference.offset); | 2346 JUnitTestCase.assertEquals(5, reference.offset); |
| 2347 } | 2347 } |
| 2348 void test_parseDocumentationComment_endOfLine() { | 2348 void test_parseDocumentationComment_endOfLine() { |
| 2349 Comment comment = ParserTestCase.parse4("parseDocumentationComment", "/// \n
/// \n class", []); | 2349 Comment comment = ParserTestCase.parse5("parseDocumentationComment", "/// \n
/// \n class", []); |
| 2350 JUnitTestCase.assertFalse(comment.isBlock()); | 2350 JUnitTestCase.assertFalse(comment.isBlock()); |
| 2351 JUnitTestCase.assertTrue(comment.isDocumentation()); | 2351 JUnitTestCase.assertTrue(comment.isDocumentation()); |
| 2352 JUnitTestCase.assertFalse(comment.isEndOfLine()); | 2352 JUnitTestCase.assertFalse(comment.isEndOfLine()); |
| 2353 } | 2353 } |
| 2354 void test_parseDoStatement() { | 2354 void test_parseDoStatement() { |
| 2355 DoStatement statement = ParserTestCase.parse4("parseDoStatement", "do {} whi
le (x);", []); | 2355 DoStatement statement = ParserTestCase.parse5("parseDoStatement", "do {} whi
le (x);", []); |
| 2356 JUnitTestCase.assertNotNull(statement.doKeyword); | 2356 JUnitTestCase.assertNotNull(statement.doKeyword); |
| 2357 JUnitTestCase.assertNotNull(statement.body); | 2357 JUnitTestCase.assertNotNull(statement.body); |
| 2358 JUnitTestCase.assertNotNull(statement.whileKeyword); | 2358 JUnitTestCase.assertNotNull(statement.whileKeyword); |
| 2359 JUnitTestCase.assertNotNull(statement.leftParenthesis); | 2359 JUnitTestCase.assertNotNull(statement.leftParenthesis); |
| 2360 JUnitTestCase.assertNotNull(statement.condition); | 2360 JUnitTestCase.assertNotNull(statement.condition); |
| 2361 JUnitTestCase.assertNotNull(statement.rightParenthesis); | 2361 JUnitTestCase.assertNotNull(statement.rightParenthesis); |
| 2362 JUnitTestCase.assertNotNull(statement.semicolon); | 2362 JUnitTestCase.assertNotNull(statement.semicolon); |
| 2363 } | 2363 } |
| 2364 void test_parseEmptyStatement() { | 2364 void test_parseEmptyStatement() { |
| 2365 EmptyStatement statement = ParserTestCase.parse4("parseEmptyStatement", ";",
[]); | 2365 EmptyStatement statement = ParserTestCase.parse5("parseEmptyStatement", ";",
[]); |
| 2366 JUnitTestCase.assertNotNull(statement.semicolon); | 2366 JUnitTestCase.assertNotNull(statement.semicolon); |
| 2367 } | 2367 } |
| 2368 void test_parseEqualityExpression_normal() { | 2368 void test_parseEqualityExpression_normal() { |
| 2369 BinaryExpression expression = ParserTestCase.parse4("parseEqualityExpression
", "x == y", []); | 2369 BinaryExpression expression = ParserTestCase.parse5("parseEqualityExpression
", "x == y", []); |
| 2370 JUnitTestCase.assertNotNull(expression.leftOperand); | 2370 JUnitTestCase.assertNotNull(expression.leftOperand); |
| 2371 JUnitTestCase.assertNotNull(expression.operator); | 2371 JUnitTestCase.assertNotNull(expression.operator); |
| 2372 JUnitTestCase.assertEquals(TokenType.EQ_EQ, expression.operator.type); | 2372 JUnitTestCase.assertEquals(TokenType.EQ_EQ, expression.operator.type); |
| 2373 JUnitTestCase.assertNotNull(expression.rightOperand); | 2373 JUnitTestCase.assertNotNull(expression.rightOperand); |
| 2374 } | 2374 } |
| 2375 void test_parseEqualityExpression_super() { | 2375 void test_parseEqualityExpression_super() { |
| 2376 BinaryExpression expression = ParserTestCase.parse4("parseEqualityExpression
", "super == y", []); | 2376 BinaryExpression expression = ParserTestCase.parse5("parseEqualityExpression
", "super == y", []); |
| 2377 EngineTestCase.assertInstanceOf(SuperExpression, expression.leftOperand); | 2377 EngineTestCase.assertInstanceOf(SuperExpression, expression.leftOperand); |
| 2378 JUnitTestCase.assertNotNull(expression.operator); | 2378 JUnitTestCase.assertNotNull(expression.operator); |
| 2379 JUnitTestCase.assertEquals(TokenType.EQ_EQ, expression.operator.type); | 2379 JUnitTestCase.assertEquals(TokenType.EQ_EQ, expression.operator.type); |
| 2380 JUnitTestCase.assertNotNull(expression.rightOperand); | 2380 JUnitTestCase.assertNotNull(expression.rightOperand); |
| 2381 } | 2381 } |
| 2382 void test_parseExportDirective_hide() { | 2382 void test_parseExportDirective_hide() { |
| 2383 ExportDirective directive = ParserTestCase.parse("parseExportDirective", <Ob
ject> [emptyCommentAndMetadata()], "export 'lib/lib.dart' hide A, B;"); | 2383 ExportDirective directive = ParserTestCase.parse("parseExportDirective", <Ob
ject> [emptyCommentAndMetadata()], "export 'lib/lib.dart' hide A, B;"); |
| 2384 JUnitTestCase.assertNotNull(directive.keyword); | 2384 JUnitTestCase.assertNotNull(directive.keyword); |
| 2385 JUnitTestCase.assertNotNull(directive.libraryUri); | 2385 JUnitTestCase.assertNotNull(directive.uri); |
| 2386 EngineTestCase.assertSize(1, directive.combinators); | 2386 EngineTestCase.assertSize(1, directive.combinators); |
| 2387 JUnitTestCase.assertNotNull(directive.semicolon); | 2387 JUnitTestCase.assertNotNull(directive.semicolon); |
| 2388 } | 2388 } |
| 2389 void test_parseExportDirective_hide_show() { | 2389 void test_parseExportDirective_hide_show() { |
| 2390 ExportDirective directive = ParserTestCase.parse("parseExportDirective", <Ob
ject> [emptyCommentAndMetadata()], "export 'lib/lib.dart' hide A show B;"); | 2390 ExportDirective directive = ParserTestCase.parse("parseExportDirective", <Ob
ject> [emptyCommentAndMetadata()], "export 'lib/lib.dart' hide A show B;"); |
| 2391 JUnitTestCase.assertNotNull(directive.keyword); | 2391 JUnitTestCase.assertNotNull(directive.keyword); |
| 2392 JUnitTestCase.assertNotNull(directive.libraryUri); | 2392 JUnitTestCase.assertNotNull(directive.uri); |
| 2393 EngineTestCase.assertSize(2, directive.combinators); | 2393 EngineTestCase.assertSize(2, directive.combinators); |
| 2394 JUnitTestCase.assertNotNull(directive.semicolon); | 2394 JUnitTestCase.assertNotNull(directive.semicolon); |
| 2395 } | 2395 } |
| 2396 void test_parseExportDirective_noCombinator() { | 2396 void test_parseExportDirective_noCombinator() { |
| 2397 ExportDirective directive = ParserTestCase.parse("parseExportDirective", <Ob
ject> [emptyCommentAndMetadata()], "export 'lib/lib.dart';"); | 2397 ExportDirective directive = ParserTestCase.parse("parseExportDirective", <Ob
ject> [emptyCommentAndMetadata()], "export 'lib/lib.dart';"); |
| 2398 JUnitTestCase.assertNotNull(directive.keyword); | 2398 JUnitTestCase.assertNotNull(directive.keyword); |
| 2399 JUnitTestCase.assertNotNull(directive.libraryUri); | 2399 JUnitTestCase.assertNotNull(directive.uri); |
| 2400 EngineTestCase.assertSize(0, directive.combinators); | 2400 EngineTestCase.assertSize(0, directive.combinators); |
| 2401 JUnitTestCase.assertNotNull(directive.semicolon); | 2401 JUnitTestCase.assertNotNull(directive.semicolon); |
| 2402 } | 2402 } |
| 2403 void test_parseExportDirective_show() { | 2403 void test_parseExportDirective_show() { |
| 2404 ExportDirective directive = ParserTestCase.parse("parseExportDirective", <Ob
ject> [emptyCommentAndMetadata()], "export 'lib/lib.dart' show A, B;"); | 2404 ExportDirective directive = ParserTestCase.parse("parseExportDirective", <Ob
ject> [emptyCommentAndMetadata()], "export 'lib/lib.dart' show A, B;"); |
| 2405 JUnitTestCase.assertNotNull(directive.keyword); | 2405 JUnitTestCase.assertNotNull(directive.keyword); |
| 2406 JUnitTestCase.assertNotNull(directive.libraryUri); | 2406 JUnitTestCase.assertNotNull(directive.uri); |
| 2407 EngineTestCase.assertSize(1, directive.combinators); | 2407 EngineTestCase.assertSize(1, directive.combinators); |
| 2408 JUnitTestCase.assertNotNull(directive.semicolon); | 2408 JUnitTestCase.assertNotNull(directive.semicolon); |
| 2409 } | 2409 } |
| 2410 void test_parseExportDirective_show_hide() { | 2410 void test_parseExportDirective_show_hide() { |
| 2411 ExportDirective directive = ParserTestCase.parse("parseExportDirective", <Ob
ject> [emptyCommentAndMetadata()], "export 'lib/lib.dart' show B hide A;"); | 2411 ExportDirective directive = ParserTestCase.parse("parseExportDirective", <Ob
ject> [emptyCommentAndMetadata()], "export 'lib/lib.dart' show B hide A;"); |
| 2412 JUnitTestCase.assertNotNull(directive.keyword); | 2412 JUnitTestCase.assertNotNull(directive.keyword); |
| 2413 JUnitTestCase.assertNotNull(directive.libraryUri); | 2413 JUnitTestCase.assertNotNull(directive.uri); |
| 2414 EngineTestCase.assertSize(2, directive.combinators); | 2414 EngineTestCase.assertSize(2, directive.combinators); |
| 2415 JUnitTestCase.assertNotNull(directive.semicolon); | 2415 JUnitTestCase.assertNotNull(directive.semicolon); |
| 2416 } | 2416 } |
| 2417 void test_parseExpression_assign() { | 2417 void test_parseExpression_assign() { |
| 2418 AssignmentExpression expression = ParserTestCase.parse4("parseExpression", "
x = y", []); | 2418 AssignmentExpression expression = ParserTestCase.parse5("parseExpression", "
x = y", []); |
| 2419 JUnitTestCase.assertNotNull(expression.leftHandSide); | 2419 JUnitTestCase.assertNotNull(expression.leftHandSide); |
| 2420 JUnitTestCase.assertNotNull(expression.operator); | 2420 JUnitTestCase.assertNotNull(expression.operator); |
| 2421 JUnitTestCase.assertEquals(TokenType.EQ, expression.operator.type); | 2421 JUnitTestCase.assertEquals(TokenType.EQ, expression.operator.type); |
| 2422 JUnitTestCase.assertNotNull(expression.rightHandSide); | 2422 JUnitTestCase.assertNotNull(expression.rightHandSide); |
| 2423 } | 2423 } |
| 2424 void test_parseExpression_comparison() { | 2424 void test_parseExpression_comparison() { |
| 2425 BinaryExpression expression = ParserTestCase.parse4("parseExpression", "--a.
b == c", []); | 2425 BinaryExpression expression = ParserTestCase.parse5("parseExpression", "--a.
b == c", []); |
| 2426 JUnitTestCase.assertNotNull(expression.leftOperand); | 2426 JUnitTestCase.assertNotNull(expression.leftOperand); |
| 2427 JUnitTestCase.assertNotNull(expression.operator); | 2427 JUnitTestCase.assertNotNull(expression.operator); |
| 2428 JUnitTestCase.assertEquals(TokenType.EQ_EQ, expression.operator.type); | 2428 JUnitTestCase.assertEquals(TokenType.EQ_EQ, expression.operator.type); |
| 2429 JUnitTestCase.assertNotNull(expression.rightOperand); | 2429 JUnitTestCase.assertNotNull(expression.rightOperand); |
| 2430 } | 2430 } |
| 2431 void test_parseExpression_invokeFunctionExpression() { | 2431 void test_parseExpression_invokeFunctionExpression() { |
| 2432 FunctionExpressionInvocation invocation = ParserTestCase.parse4("parseExpres
sion", "(a) {return a + a;} (3)", []); | 2432 FunctionExpressionInvocation invocation = ParserTestCase.parse5("parseExpres
sion", "(a) {return a + a;} (3)", []); |
| 2433 EngineTestCase.assertInstanceOf(FunctionExpression, invocation.function); | 2433 EngineTestCase.assertInstanceOf(FunctionExpression, invocation.function); |
| 2434 FunctionExpression expression = invocation.function as FunctionExpression; | 2434 FunctionExpression expression = (invocation.function as FunctionExpression); |
| 2435 JUnitTestCase.assertNotNull(expression.parameters); | 2435 JUnitTestCase.assertNotNull(expression.parameters); |
| 2436 JUnitTestCase.assertNotNull(expression.body); | 2436 JUnitTestCase.assertNotNull(expression.body); |
| 2437 ArgumentList list = invocation.argumentList; | 2437 ArgumentList list = invocation.argumentList; |
| 2438 JUnitTestCase.assertNotNull(list); | 2438 JUnitTestCase.assertNotNull(list); |
| 2439 EngineTestCase.assertSize(1, list.arguments); | 2439 EngineTestCase.assertSize(1, list.arguments); |
| 2440 } | 2440 } |
| 2441 void test_parseExpression_superMethodInvocation() { | 2441 void test_parseExpression_superMethodInvocation() { |
| 2442 MethodInvocation invocation = ParserTestCase.parse4("parseExpression", "supe
r.m()", []); | 2442 MethodInvocation invocation = ParserTestCase.parse5("parseExpression", "supe
r.m()", []); |
| 2443 JUnitTestCase.assertNotNull(invocation.target); | 2443 JUnitTestCase.assertNotNull(invocation.target); |
| 2444 JUnitTestCase.assertNotNull(invocation.methodName); | 2444 JUnitTestCase.assertNotNull(invocation.methodName); |
| 2445 JUnitTestCase.assertNotNull(invocation.argumentList); | 2445 JUnitTestCase.assertNotNull(invocation.argumentList); |
| 2446 } | 2446 } |
| 2447 void test_parseExpressionList_multiple() { | 2447 void test_parseExpressionList_multiple() { |
| 2448 List<Expression> result = ParserTestCase.parse4("parseExpressionList", "1, 2
, 3", []); | 2448 List<Expression> result = ParserTestCase.parse5("parseExpressionList", "1, 2
, 3", []); |
| 2449 EngineTestCase.assertSize(3, result); | 2449 EngineTestCase.assertSize(3, result); |
| 2450 } | 2450 } |
| 2451 void test_parseExpressionList_single() { | 2451 void test_parseExpressionList_single() { |
| 2452 List<Expression> result = ParserTestCase.parse4("parseExpressionList", "1",
[]); | 2452 List<Expression> result = ParserTestCase.parse5("parseExpressionList", "1",
[]); |
| 2453 EngineTestCase.assertSize(1, result); | 2453 EngineTestCase.assertSize(1, result); |
| 2454 } | 2454 } |
| 2455 void test_parseExpressionWithoutCascade_assign() { | 2455 void test_parseExpressionWithoutCascade_assign() { |
| 2456 AssignmentExpression expression = ParserTestCase.parse4("parseExpressionWith
outCascade", "x = y", []); | 2456 AssignmentExpression expression = ParserTestCase.parse5("parseExpressionWith
outCascade", "x = y", []); |
| 2457 JUnitTestCase.assertNotNull(expression.leftHandSide); | 2457 JUnitTestCase.assertNotNull(expression.leftHandSide); |
| 2458 JUnitTestCase.assertNotNull(expression.operator); | 2458 JUnitTestCase.assertNotNull(expression.operator); |
| 2459 JUnitTestCase.assertEquals(TokenType.EQ, expression.operator.type); | 2459 JUnitTestCase.assertEquals(TokenType.EQ, expression.operator.type); |
| 2460 JUnitTestCase.assertNotNull(expression.rightHandSide); | 2460 JUnitTestCase.assertNotNull(expression.rightHandSide); |
| 2461 } | 2461 } |
| 2462 void test_parseExpressionWithoutCascade_comparison() { | 2462 void test_parseExpressionWithoutCascade_comparison() { |
| 2463 BinaryExpression expression = ParserTestCase.parse4("parseExpressionWithoutC
ascade", "--a.b == c", []); | 2463 BinaryExpression expression = ParserTestCase.parse5("parseExpressionWithoutC
ascade", "--a.b == c", []); |
| 2464 JUnitTestCase.assertNotNull(expression.leftOperand); | 2464 JUnitTestCase.assertNotNull(expression.leftOperand); |
| 2465 JUnitTestCase.assertNotNull(expression.operator); | 2465 JUnitTestCase.assertNotNull(expression.operator); |
| 2466 JUnitTestCase.assertEquals(TokenType.EQ_EQ, expression.operator.type); | 2466 JUnitTestCase.assertEquals(TokenType.EQ_EQ, expression.operator.type); |
| 2467 JUnitTestCase.assertNotNull(expression.rightOperand); | 2467 JUnitTestCase.assertNotNull(expression.rightOperand); |
| 2468 } | 2468 } |
| 2469 void test_parseExpressionWithoutCascade_superMethodInvocation() { | 2469 void test_parseExpressionWithoutCascade_superMethodInvocation() { |
| 2470 MethodInvocation invocation = ParserTestCase.parse4("parseExpressionWithoutC
ascade", "super.m()", []); | 2470 MethodInvocation invocation = ParserTestCase.parse5("parseExpressionWithoutC
ascade", "super.m()", []); |
| 2471 JUnitTestCase.assertNotNull(invocation.target); | 2471 JUnitTestCase.assertNotNull(invocation.target); |
| 2472 JUnitTestCase.assertNotNull(invocation.methodName); | 2472 JUnitTestCase.assertNotNull(invocation.methodName); |
| 2473 JUnitTestCase.assertNotNull(invocation.argumentList); | 2473 JUnitTestCase.assertNotNull(invocation.argumentList); |
| 2474 } | 2474 } |
| 2475 void test_parseExtendsClause() { | 2475 void test_parseExtendsClause() { |
| 2476 ExtendsClause clause = ParserTestCase.parse4("parseExtendsClause", "extends
B", []); | 2476 ExtendsClause clause = ParserTestCase.parse5("parseExtendsClause", "extends
B", []); |
| 2477 JUnitTestCase.assertNotNull(clause.keyword); | 2477 JUnitTestCase.assertNotNull(clause.keyword); |
| 2478 JUnitTestCase.assertNotNull(clause.superclass); | 2478 JUnitTestCase.assertNotNull(clause.superclass); |
| 2479 EngineTestCase.assertInstanceOf(TypeName, clause.superclass); | 2479 EngineTestCase.assertInstanceOf(TypeName, clause.superclass); |
| 2480 } | 2480 } |
| 2481 void test_parseFinalConstVarOrType_const_noType() { | 2481 void test_parseFinalConstVarOrType_const_noType() { |
| 2482 FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType"
, <Object> [false], "const"); | 2482 FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType"
, <Object> [false], "const"); |
| 2483 Token keyword30 = result.keyword; | 2483 Token keyword29 = result.keyword; |
| 2484 JUnitTestCase.assertNotNull(keyword30); | 2484 JUnitTestCase.assertNotNull(keyword29); |
| 2485 JUnitTestCase.assertEquals(TokenType.KEYWORD, keyword30.type); | 2485 JUnitTestCase.assertEquals(TokenType.KEYWORD, keyword29.type); |
| 2486 JUnitTestCase.assertEquals(Keyword.CONST, (keyword30 as KeywordToken).keywor
d); | 2486 JUnitTestCase.assertEquals(Keyword.CONST, ((keyword29 as KeywordToken)).keyw
ord); |
| 2487 JUnitTestCase.assertNull(result.type); | 2487 JUnitTestCase.assertNull(result.type); |
| 2488 } | 2488 } |
| 2489 void test_parseFinalConstVarOrType_const_type() { | 2489 void test_parseFinalConstVarOrType_const_type() { |
| 2490 FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType"
, <Object> [false], "const A a"); | 2490 FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType"
, <Object> [false], "const A a"); |
| 2491 Token keyword31 = result.keyword; | 2491 Token keyword30 = result.keyword; |
| 2492 JUnitTestCase.assertNotNull(keyword31); | 2492 JUnitTestCase.assertNotNull(keyword30); |
| 2493 JUnitTestCase.assertEquals(TokenType.KEYWORD, keyword31.type); | 2493 JUnitTestCase.assertEquals(TokenType.KEYWORD, keyword30.type); |
| 2494 JUnitTestCase.assertEquals(Keyword.CONST, (keyword31 as KeywordToken).keywor
d); | 2494 JUnitTestCase.assertEquals(Keyword.CONST, ((keyword30 as KeywordToken)).keyw
ord); |
| 2495 JUnitTestCase.assertNotNull(result.type); | 2495 JUnitTestCase.assertNotNull(result.type); |
| 2496 } | 2496 } |
| 2497 void test_parseFinalConstVarOrType_final_noType() { | 2497 void test_parseFinalConstVarOrType_final_noType() { |
| 2498 FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType"
, <Object> [false], "final"); | 2498 FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType"
, <Object> [false], "final"); |
| 2499 Token keyword32 = result.keyword; | 2499 Token keyword31 = result.keyword; |
| 2500 JUnitTestCase.assertNotNull(keyword32); | 2500 JUnitTestCase.assertNotNull(keyword31); |
| 2501 JUnitTestCase.assertEquals(TokenType.KEYWORD, keyword32.type); | 2501 JUnitTestCase.assertEquals(TokenType.KEYWORD, keyword31.type); |
| 2502 JUnitTestCase.assertEquals(Keyword.FINAL, (keyword32 as KeywordToken).keywor
d); | 2502 JUnitTestCase.assertEquals(Keyword.FINAL, ((keyword31 as KeywordToken)).keyw
ord); |
| 2503 JUnitTestCase.assertNull(result.type); | 2503 JUnitTestCase.assertNull(result.type); |
| 2504 } | 2504 } |
| 2505 void test_parseFinalConstVarOrType_final_type() { | 2505 void test_parseFinalConstVarOrType_final_type() { |
| 2506 FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType"
, <Object> [false], "final A a"); | 2506 FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType"
, <Object> [false], "final A a"); |
| 2507 Token keyword33 = result.keyword; | 2507 Token keyword32 = result.keyword; |
| 2508 JUnitTestCase.assertNotNull(keyword33); | 2508 JUnitTestCase.assertNotNull(keyword32); |
| 2509 JUnitTestCase.assertEquals(TokenType.KEYWORD, keyword33.type); | 2509 JUnitTestCase.assertEquals(TokenType.KEYWORD, keyword32.type); |
| 2510 JUnitTestCase.assertEquals(Keyword.FINAL, (keyword33 as KeywordToken).keywor
d); | 2510 JUnitTestCase.assertEquals(Keyword.FINAL, ((keyword32 as KeywordToken)).keyw
ord); |
| 2511 JUnitTestCase.assertNotNull(result.type); | 2511 JUnitTestCase.assertNotNull(result.type); |
| 2512 } | 2512 } |
| 2513 void test_parseFinalConstVarOrType_type_parameterized() { | 2513 void test_parseFinalConstVarOrType_type_parameterized() { |
| 2514 FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType"
, <Object> [false], "A<B> a"); | 2514 FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType"
, <Object> [false], "A<B> a"); |
| 2515 JUnitTestCase.assertNull(result.keyword); | 2515 JUnitTestCase.assertNull(result.keyword); |
| 2516 JUnitTestCase.assertNotNull(result.type); | 2516 JUnitTestCase.assertNotNull(result.type); |
| 2517 } | 2517 } |
| 2518 void test_parseFinalConstVarOrType_type_prefixed() { | 2518 void test_parseFinalConstVarOrType_type_prefixed() { |
| 2519 FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType"
, <Object> [false], "p.A a"); | 2519 FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType"
, <Object> [false], "p.A a"); |
| 2520 JUnitTestCase.assertNull(result.keyword); | 2520 JUnitTestCase.assertNull(result.keyword); |
| 2521 JUnitTestCase.assertNotNull(result.type); | 2521 JUnitTestCase.assertNotNull(result.type); |
| 2522 } | 2522 } |
| 2523 void test_parseFinalConstVarOrType_type_prefixedAndParameterized() { | 2523 void test_parseFinalConstVarOrType_type_prefixedAndParameterized() { |
| 2524 FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType"
, <Object> [false], "p.A<B> a"); | 2524 FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType"
, <Object> [false], "p.A<B> a"); |
| 2525 JUnitTestCase.assertNull(result.keyword); | 2525 JUnitTestCase.assertNull(result.keyword); |
| 2526 JUnitTestCase.assertNotNull(result.type); | 2526 JUnitTestCase.assertNotNull(result.type); |
| 2527 } | 2527 } |
| 2528 void test_parseFinalConstVarOrType_type_simple() { | 2528 void test_parseFinalConstVarOrType_type_simple() { |
| 2529 FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType"
, <Object> [false], "A a"); | 2529 FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType"
, <Object> [false], "A a"); |
| 2530 JUnitTestCase.assertNull(result.keyword); | 2530 JUnitTestCase.assertNull(result.keyword); |
| 2531 JUnitTestCase.assertNotNull(result.type); | 2531 JUnitTestCase.assertNotNull(result.type); |
| 2532 } | 2532 } |
| 2533 void test_parseFinalConstVarOrType_var() { | 2533 void test_parseFinalConstVarOrType_var() { |
| 2534 FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType"
, <Object> [false], "var"); | 2534 FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType"
, <Object> [false], "var"); |
| 2535 Token keyword34 = result.keyword; | 2535 Token keyword33 = result.keyword; |
| 2536 JUnitTestCase.assertNotNull(keyword34); | 2536 JUnitTestCase.assertNotNull(keyword33); |
| 2537 JUnitTestCase.assertEquals(TokenType.KEYWORD, keyword34.type); | 2537 JUnitTestCase.assertEquals(TokenType.KEYWORD, keyword33.type); |
| 2538 JUnitTestCase.assertEquals(Keyword.VAR, (keyword34 as KeywordToken).keyword)
; | 2538 JUnitTestCase.assertEquals(Keyword.VAR, ((keyword33 as KeywordToken)).keywor
d); |
| 2539 JUnitTestCase.assertNull(result.type); | 2539 JUnitTestCase.assertNull(result.type); |
| 2540 } | 2540 } |
| 2541 void test_parseFormalParameter_final_withType_named() { | 2541 void test_parseFormalParameter_final_withType_named() { |
| 2542 ParameterKind kind = ParameterKind.NAMED; | 2542 ParameterKind kind = ParameterKind.NAMED; |
| 2543 DefaultFormalParameter parameter = ParserTestCase.parse("parseFormalParamete
r", <Object> [kind], "final A a : null"); | 2543 DefaultFormalParameter parameter = ParserTestCase.parse("parseFormalParamete
r", <Object> [kind], "final A a : null"); |
| 2544 SimpleFormalParameter simpleParameter = parameter.parameter as SimpleFormalP
arameter; | 2544 SimpleFormalParameter simpleParameter = (parameter.parameter as SimpleFormal
Parameter); |
| 2545 JUnitTestCase.assertNotNull(simpleParameter.identifier); | 2545 JUnitTestCase.assertNotNull(simpleParameter.identifier); |
| 2546 JUnitTestCase.assertNotNull(simpleParameter.keyword); | 2546 JUnitTestCase.assertNotNull(simpleParameter.keyword); |
| 2547 JUnitTestCase.assertNotNull(simpleParameter.type); | 2547 JUnitTestCase.assertNotNull(simpleParameter.type); |
| 2548 JUnitTestCase.assertEquals(kind, simpleParameter.kind); | 2548 JUnitTestCase.assertEquals(kind, simpleParameter.kind); |
| 2549 JUnitTestCase.assertNotNull(parameter.separator); | 2549 JUnitTestCase.assertNotNull(parameter.separator); |
| 2550 JUnitTestCase.assertNotNull(parameter.defaultValue); | 2550 JUnitTestCase.assertNotNull(parameter.defaultValue); |
| 2551 JUnitTestCase.assertEquals(kind, parameter.kind); | 2551 JUnitTestCase.assertEquals(kind, parameter.kind); |
| 2552 } | 2552 } |
| 2553 void test_parseFormalParameter_final_withType_normal() { | 2553 void test_parseFormalParameter_final_withType_normal() { |
| 2554 ParameterKind kind = ParameterKind.REQUIRED; | 2554 ParameterKind kind = ParameterKind.REQUIRED; |
| 2555 SimpleFormalParameter parameter = ParserTestCase.parse("parseFormalParameter
", <Object> [kind], "final A a"); | 2555 SimpleFormalParameter parameter = ParserTestCase.parse("parseFormalParameter
", <Object> [kind], "final A a"); |
| 2556 JUnitTestCase.assertNotNull(parameter.identifier); | 2556 JUnitTestCase.assertNotNull(parameter.identifier); |
| 2557 JUnitTestCase.assertNotNull(parameter.keyword); | 2557 JUnitTestCase.assertNotNull(parameter.keyword); |
| 2558 JUnitTestCase.assertNotNull(parameter.type); | 2558 JUnitTestCase.assertNotNull(parameter.type); |
| 2559 JUnitTestCase.assertEquals(kind, parameter.kind); | 2559 JUnitTestCase.assertEquals(kind, parameter.kind); |
| 2560 } | 2560 } |
| 2561 void test_parseFormalParameter_final_withType_positional() { | 2561 void test_parseFormalParameter_final_withType_positional() { |
| 2562 ParameterKind kind = ParameterKind.POSITIONAL; | 2562 ParameterKind kind = ParameterKind.POSITIONAL; |
| 2563 DefaultFormalParameter parameter = ParserTestCase.parse("parseFormalParamete
r", <Object> [kind], "final A a = null"); | 2563 DefaultFormalParameter parameter = ParserTestCase.parse("parseFormalParamete
r", <Object> [kind], "final A a = null"); |
| 2564 SimpleFormalParameter simpleParameter = parameter.parameter as SimpleFormalP
arameter; | 2564 SimpleFormalParameter simpleParameter = (parameter.parameter as SimpleFormal
Parameter); |
| 2565 JUnitTestCase.assertNotNull(simpleParameter.identifier); | 2565 JUnitTestCase.assertNotNull(simpleParameter.identifier); |
| 2566 JUnitTestCase.assertNotNull(simpleParameter.keyword); | 2566 JUnitTestCase.assertNotNull(simpleParameter.keyword); |
| 2567 JUnitTestCase.assertNotNull(simpleParameter.type); | 2567 JUnitTestCase.assertNotNull(simpleParameter.type); |
| 2568 JUnitTestCase.assertEquals(kind, simpleParameter.kind); | 2568 JUnitTestCase.assertEquals(kind, simpleParameter.kind); |
| 2569 JUnitTestCase.assertNotNull(parameter.separator); | 2569 JUnitTestCase.assertNotNull(parameter.separator); |
| 2570 JUnitTestCase.assertNotNull(parameter.defaultValue); | 2570 JUnitTestCase.assertNotNull(parameter.defaultValue); |
| 2571 JUnitTestCase.assertEquals(kind, parameter.kind); | 2571 JUnitTestCase.assertEquals(kind, parameter.kind); |
| 2572 } | 2572 } |
| 2573 void test_parseFormalParameter_nonFinal_withType_named() { | 2573 void test_parseFormalParameter_nonFinal_withType_named() { |
| 2574 ParameterKind kind = ParameterKind.NAMED; | 2574 ParameterKind kind = ParameterKind.NAMED; |
| 2575 DefaultFormalParameter parameter = ParserTestCase.parse("parseFormalParamete
r", <Object> [kind], "A a : null"); | 2575 DefaultFormalParameter parameter = ParserTestCase.parse("parseFormalParamete
r", <Object> [kind], "A a : null"); |
| 2576 SimpleFormalParameter simpleParameter = parameter.parameter as SimpleFormalP
arameter; | 2576 SimpleFormalParameter simpleParameter = (parameter.parameter as SimpleFormal
Parameter); |
| 2577 JUnitTestCase.assertNotNull(simpleParameter.identifier); | 2577 JUnitTestCase.assertNotNull(simpleParameter.identifier); |
| 2578 JUnitTestCase.assertNull(simpleParameter.keyword); | 2578 JUnitTestCase.assertNull(simpleParameter.keyword); |
| 2579 JUnitTestCase.assertNotNull(simpleParameter.type); | 2579 JUnitTestCase.assertNotNull(simpleParameter.type); |
| 2580 JUnitTestCase.assertEquals(kind, simpleParameter.kind); | 2580 JUnitTestCase.assertEquals(kind, simpleParameter.kind); |
| 2581 JUnitTestCase.assertNotNull(parameter.separator); | 2581 JUnitTestCase.assertNotNull(parameter.separator); |
| 2582 JUnitTestCase.assertNotNull(parameter.defaultValue); | 2582 JUnitTestCase.assertNotNull(parameter.defaultValue); |
| 2583 JUnitTestCase.assertEquals(kind, parameter.kind); | 2583 JUnitTestCase.assertEquals(kind, parameter.kind); |
| 2584 } | 2584 } |
| 2585 void test_parseFormalParameter_nonFinal_withType_normal() { | 2585 void test_parseFormalParameter_nonFinal_withType_normal() { |
| 2586 ParameterKind kind = ParameterKind.REQUIRED; | 2586 ParameterKind kind = ParameterKind.REQUIRED; |
| 2587 SimpleFormalParameter parameter = ParserTestCase.parse("parseFormalParameter
", <Object> [kind], "A a"); | 2587 SimpleFormalParameter parameter = ParserTestCase.parse("parseFormalParameter
", <Object> [kind], "A a"); |
| 2588 JUnitTestCase.assertNotNull(parameter.identifier); | 2588 JUnitTestCase.assertNotNull(parameter.identifier); |
| 2589 JUnitTestCase.assertNull(parameter.keyword); | 2589 JUnitTestCase.assertNull(parameter.keyword); |
| 2590 JUnitTestCase.assertNotNull(parameter.type); | 2590 JUnitTestCase.assertNotNull(parameter.type); |
| 2591 JUnitTestCase.assertEquals(kind, parameter.kind); | 2591 JUnitTestCase.assertEquals(kind, parameter.kind); |
| 2592 } | 2592 } |
| 2593 void test_parseFormalParameter_nonFinal_withType_positional() { | 2593 void test_parseFormalParameter_nonFinal_withType_positional() { |
| 2594 ParameterKind kind = ParameterKind.POSITIONAL; | 2594 ParameterKind kind = ParameterKind.POSITIONAL; |
| 2595 DefaultFormalParameter parameter = ParserTestCase.parse("parseFormalParamete
r", <Object> [kind], "A a = null"); | 2595 DefaultFormalParameter parameter = ParserTestCase.parse("parseFormalParamete
r", <Object> [kind], "A a = null"); |
| 2596 SimpleFormalParameter simpleParameter = parameter.parameter as SimpleFormalP
arameter; | 2596 SimpleFormalParameter simpleParameter = (parameter.parameter as SimpleFormal
Parameter); |
| 2597 JUnitTestCase.assertNotNull(simpleParameter.identifier); | 2597 JUnitTestCase.assertNotNull(simpleParameter.identifier); |
| 2598 JUnitTestCase.assertNull(simpleParameter.keyword); | 2598 JUnitTestCase.assertNull(simpleParameter.keyword); |
| 2599 JUnitTestCase.assertNotNull(simpleParameter.type); | 2599 JUnitTestCase.assertNotNull(simpleParameter.type); |
| 2600 JUnitTestCase.assertEquals(kind, simpleParameter.kind); | 2600 JUnitTestCase.assertEquals(kind, simpleParameter.kind); |
| 2601 JUnitTestCase.assertNotNull(parameter.separator); | 2601 JUnitTestCase.assertNotNull(parameter.separator); |
| 2602 JUnitTestCase.assertNotNull(parameter.defaultValue); | 2602 JUnitTestCase.assertNotNull(parameter.defaultValue); |
| 2603 JUnitTestCase.assertEquals(kind, parameter.kind); | 2603 JUnitTestCase.assertEquals(kind, parameter.kind); |
| 2604 } | 2604 } |
| 2605 void test_parseFormalParameter_var() { | 2605 void test_parseFormalParameter_var() { |
| 2606 ParameterKind kind = ParameterKind.REQUIRED; | 2606 ParameterKind kind = ParameterKind.REQUIRED; |
| 2607 SimpleFormalParameter parameter = ParserTestCase.parse("parseFormalParameter
", <Object> [kind], "var a"); | 2607 SimpleFormalParameter parameter = ParserTestCase.parse("parseFormalParameter
", <Object> [kind], "var a"); |
| 2608 JUnitTestCase.assertNotNull(parameter.identifier); | 2608 JUnitTestCase.assertNotNull(parameter.identifier); |
| 2609 JUnitTestCase.assertNotNull(parameter.keyword); | 2609 JUnitTestCase.assertNotNull(parameter.keyword); |
| 2610 JUnitTestCase.assertNull(parameter.type); | 2610 JUnitTestCase.assertNull(parameter.type); |
| 2611 JUnitTestCase.assertEquals(kind, parameter.kind); | 2611 JUnitTestCase.assertEquals(kind, parameter.kind); |
| 2612 } | 2612 } |
| 2613 void test_parseFormalParameter_var_named() { | 2613 void test_parseFormalParameter_var_named() { |
| 2614 ParameterKind kind = ParameterKind.NAMED; | 2614 ParameterKind kind = ParameterKind.NAMED; |
| 2615 DefaultFormalParameter parameter = ParserTestCase.parse("parseFormalParamete
r", <Object> [kind], "var a : null"); | 2615 DefaultFormalParameter parameter = ParserTestCase.parse("parseFormalParamete
r", <Object> [kind], "var a : null"); |
| 2616 SimpleFormalParameter simpleParameter = parameter.parameter as SimpleFormalP
arameter; | 2616 SimpleFormalParameter simpleParameter = (parameter.parameter as SimpleFormal
Parameter); |
| 2617 JUnitTestCase.assertNotNull(simpleParameter.identifier); | 2617 JUnitTestCase.assertNotNull(simpleParameter.identifier); |
| 2618 JUnitTestCase.assertNotNull(simpleParameter.keyword); | 2618 JUnitTestCase.assertNotNull(simpleParameter.keyword); |
| 2619 JUnitTestCase.assertNull(simpleParameter.type); | 2619 JUnitTestCase.assertNull(simpleParameter.type); |
| 2620 JUnitTestCase.assertEquals(kind, simpleParameter.kind); | 2620 JUnitTestCase.assertEquals(kind, simpleParameter.kind); |
| 2621 JUnitTestCase.assertNotNull(parameter.separator); | 2621 JUnitTestCase.assertNotNull(parameter.separator); |
| 2622 JUnitTestCase.assertNotNull(parameter.defaultValue); | 2622 JUnitTestCase.assertNotNull(parameter.defaultValue); |
| 2623 JUnitTestCase.assertEquals(kind, parameter.kind); | 2623 JUnitTestCase.assertEquals(kind, parameter.kind); |
| 2624 } | 2624 } |
| 2625 void test_parseFormalParameter_var_positional() { | 2625 void test_parseFormalParameter_var_positional() { |
| 2626 ParameterKind kind = ParameterKind.POSITIONAL; | 2626 ParameterKind kind = ParameterKind.POSITIONAL; |
| 2627 DefaultFormalParameter parameter = ParserTestCase.parse("parseFormalParamete
r", <Object> [kind], "var a = null"); | 2627 DefaultFormalParameter parameter = ParserTestCase.parse("parseFormalParamete
r", <Object> [kind], "var a = null"); |
| 2628 SimpleFormalParameter simpleParameter = parameter.parameter as SimpleFormalP
arameter; | 2628 SimpleFormalParameter simpleParameter = (parameter.parameter as SimpleFormal
Parameter); |
| 2629 JUnitTestCase.assertNotNull(simpleParameter.identifier); | 2629 JUnitTestCase.assertNotNull(simpleParameter.identifier); |
| 2630 JUnitTestCase.assertNotNull(simpleParameter.keyword); | 2630 JUnitTestCase.assertNotNull(simpleParameter.keyword); |
| 2631 JUnitTestCase.assertNull(simpleParameter.type); | 2631 JUnitTestCase.assertNull(simpleParameter.type); |
| 2632 JUnitTestCase.assertEquals(kind, simpleParameter.kind); | 2632 JUnitTestCase.assertEquals(kind, simpleParameter.kind); |
| 2633 JUnitTestCase.assertNotNull(parameter.separator); | 2633 JUnitTestCase.assertNotNull(parameter.separator); |
| 2634 JUnitTestCase.assertNotNull(parameter.defaultValue); | 2634 JUnitTestCase.assertNotNull(parameter.defaultValue); |
| 2635 JUnitTestCase.assertEquals(kind, parameter.kind); | 2635 JUnitTestCase.assertEquals(kind, parameter.kind); |
| 2636 } | 2636 } |
| 2637 void test_parseFormalParameterList_empty() { | 2637 void test_parseFormalParameterList_empty() { |
| 2638 FormalParameterList parameterList = ParserTestCase.parse4("parseFormalParame
terList", "()", []); | 2638 FormalParameterList parameterList = ParserTestCase.parse5("parseFormalParame
terList", "()", []); |
| 2639 JUnitTestCase.assertNotNull(parameterList.leftParenthesis); | 2639 JUnitTestCase.assertNotNull(parameterList.leftParenthesis); |
| 2640 JUnitTestCase.assertNull(parameterList.leftDelimiter); | 2640 JUnitTestCase.assertNull(parameterList.leftDelimiter); |
| 2641 EngineTestCase.assertSize(0, parameterList.parameters); | 2641 EngineTestCase.assertSize(0, parameterList.parameters); |
| 2642 JUnitTestCase.assertNull(parameterList.rightDelimiter); | 2642 JUnitTestCase.assertNull(parameterList.rightDelimiter); |
| 2643 JUnitTestCase.assertNotNull(parameterList.rightParenthesis); | 2643 JUnitTestCase.assertNotNull(parameterList.rightParenthesis); |
| 2644 } | 2644 } |
| 2645 void test_parseFormalParameterList_named_multiple() { | 2645 void test_parseFormalParameterList_named_multiple() { |
| 2646 FormalParameterList parameterList = ParserTestCase.parse4("parseFormalParame
terList", "({A a : 1, B b, C c : 3})", []); | 2646 FormalParameterList parameterList = ParserTestCase.parse5("parseFormalParame
terList", "({A a : 1, B b, C c : 3})", []); |
| 2647 JUnitTestCase.assertNotNull(parameterList.leftParenthesis); | 2647 JUnitTestCase.assertNotNull(parameterList.leftParenthesis); |
| 2648 JUnitTestCase.assertNotNull(parameterList.leftDelimiter); | 2648 JUnitTestCase.assertNotNull(parameterList.leftDelimiter); |
| 2649 EngineTestCase.assertSize(3, parameterList.parameters); | 2649 EngineTestCase.assertSize(3, parameterList.parameters); |
| 2650 JUnitTestCase.assertNotNull(parameterList.rightDelimiter); | 2650 JUnitTestCase.assertNotNull(parameterList.rightDelimiter); |
| 2651 JUnitTestCase.assertNotNull(parameterList.rightParenthesis); | 2651 JUnitTestCase.assertNotNull(parameterList.rightParenthesis); |
| 2652 } | 2652 } |
| 2653 void test_parseFormalParameterList_named_single() { | 2653 void test_parseFormalParameterList_named_single() { |
| 2654 FormalParameterList parameterList = ParserTestCase.parse4("parseFormalParame
terList", "({A a})", []); | 2654 FormalParameterList parameterList = ParserTestCase.parse5("parseFormalParame
terList", "({A a})", []); |
| 2655 JUnitTestCase.assertNotNull(parameterList.leftParenthesis); | 2655 JUnitTestCase.assertNotNull(parameterList.leftParenthesis); |
| 2656 JUnitTestCase.assertNotNull(parameterList.leftDelimiter); | 2656 JUnitTestCase.assertNotNull(parameterList.leftDelimiter); |
| 2657 EngineTestCase.assertSize(1, parameterList.parameters); | 2657 EngineTestCase.assertSize(1, parameterList.parameters); |
| 2658 JUnitTestCase.assertNotNull(parameterList.rightDelimiter); | 2658 JUnitTestCase.assertNotNull(parameterList.rightDelimiter); |
| 2659 JUnitTestCase.assertNotNull(parameterList.rightParenthesis); | 2659 JUnitTestCase.assertNotNull(parameterList.rightParenthesis); |
| 2660 } | 2660 } |
| 2661 void test_parseFormalParameterList_normal_multiple() { | 2661 void test_parseFormalParameterList_normal_multiple() { |
| 2662 FormalParameterList parameterList = ParserTestCase.parse4("parseFormalParame
terList", "(A a, B b, C c)", []); | 2662 FormalParameterList parameterList = ParserTestCase.parse5("parseFormalParame
terList", "(A a, B b, C c)", []); |
| 2663 JUnitTestCase.assertNotNull(parameterList.leftParenthesis); | 2663 JUnitTestCase.assertNotNull(parameterList.leftParenthesis); |
| 2664 JUnitTestCase.assertNull(parameterList.leftDelimiter); | 2664 JUnitTestCase.assertNull(parameterList.leftDelimiter); |
| 2665 EngineTestCase.assertSize(3, parameterList.parameters); | 2665 EngineTestCase.assertSize(3, parameterList.parameters); |
| 2666 JUnitTestCase.assertNull(parameterList.rightDelimiter); | 2666 JUnitTestCase.assertNull(parameterList.rightDelimiter); |
| 2667 JUnitTestCase.assertNotNull(parameterList.rightParenthesis); | 2667 JUnitTestCase.assertNotNull(parameterList.rightParenthesis); |
| 2668 } | 2668 } |
| 2669 void test_parseFormalParameterList_normal_named() { | 2669 void test_parseFormalParameterList_normal_named() { |
| 2670 FormalParameterList parameterList = ParserTestCase.parse4("parseFormalParame
terList", "(A a, {B b})", []); | 2670 FormalParameterList parameterList = ParserTestCase.parse5("parseFormalParame
terList", "(A a, {B b})", []); |
| 2671 JUnitTestCase.assertNotNull(parameterList.leftParenthesis); | 2671 JUnitTestCase.assertNotNull(parameterList.leftParenthesis); |
| 2672 JUnitTestCase.assertNotNull(parameterList.leftDelimiter); | 2672 JUnitTestCase.assertNotNull(parameterList.leftDelimiter); |
| 2673 EngineTestCase.assertSize(2, parameterList.parameters); | 2673 EngineTestCase.assertSize(2, parameterList.parameters); |
| 2674 JUnitTestCase.assertNotNull(parameterList.rightDelimiter); | 2674 JUnitTestCase.assertNotNull(parameterList.rightDelimiter); |
| 2675 JUnitTestCase.assertNotNull(parameterList.rightParenthesis); | 2675 JUnitTestCase.assertNotNull(parameterList.rightParenthesis); |
| 2676 } | 2676 } |
| 2677 void test_parseFormalParameterList_normal_positional() { | 2677 void test_parseFormalParameterList_normal_positional() { |
| 2678 FormalParameterList parameterList = ParserTestCase.parse4("parseFormalParame
terList", "(A a, [B b])", []); | 2678 FormalParameterList parameterList = ParserTestCase.parse5("parseFormalParame
terList", "(A a, [B b])", []); |
| 2679 JUnitTestCase.assertNotNull(parameterList.leftParenthesis); | 2679 JUnitTestCase.assertNotNull(parameterList.leftParenthesis); |
| 2680 JUnitTestCase.assertNotNull(parameterList.leftDelimiter); | 2680 JUnitTestCase.assertNotNull(parameterList.leftDelimiter); |
| 2681 EngineTestCase.assertSize(2, parameterList.parameters); | 2681 EngineTestCase.assertSize(2, parameterList.parameters); |
| 2682 JUnitTestCase.assertNotNull(parameterList.rightDelimiter); | 2682 JUnitTestCase.assertNotNull(parameterList.rightDelimiter); |
| 2683 JUnitTestCase.assertNotNull(parameterList.rightParenthesis); | 2683 JUnitTestCase.assertNotNull(parameterList.rightParenthesis); |
| 2684 } | 2684 } |
| 2685 void test_parseFormalParameterList_normal_single() { | 2685 void test_parseFormalParameterList_normal_single() { |
| 2686 FormalParameterList parameterList = ParserTestCase.parse4("parseFormalParame
terList", "(A a)", []); | 2686 FormalParameterList parameterList = ParserTestCase.parse5("parseFormalParame
terList", "(A a)", []); |
| 2687 JUnitTestCase.assertNotNull(parameterList.leftParenthesis); | 2687 JUnitTestCase.assertNotNull(parameterList.leftParenthesis); |
| 2688 JUnitTestCase.assertNull(parameterList.leftDelimiter); | 2688 JUnitTestCase.assertNull(parameterList.leftDelimiter); |
| 2689 EngineTestCase.assertSize(1, parameterList.parameters); | 2689 EngineTestCase.assertSize(1, parameterList.parameters); |
| 2690 JUnitTestCase.assertNull(parameterList.rightDelimiter); | 2690 JUnitTestCase.assertNull(parameterList.rightDelimiter); |
| 2691 JUnitTestCase.assertNotNull(parameterList.rightParenthesis); | 2691 JUnitTestCase.assertNotNull(parameterList.rightParenthesis); |
| 2692 } | 2692 } |
| 2693 void test_parseFormalParameterList_positional_multiple() { | 2693 void test_parseFormalParameterList_positional_multiple() { |
| 2694 FormalParameterList parameterList = ParserTestCase.parse4("parseFormalParame
terList", "([A a = null, B b, C c = null])", []); | 2694 FormalParameterList parameterList = ParserTestCase.parse5("parseFormalParame
terList", "([A a = null, B b, C c = null])", []); |
| 2695 JUnitTestCase.assertNotNull(parameterList.leftParenthesis); | 2695 JUnitTestCase.assertNotNull(parameterList.leftParenthesis); |
| 2696 JUnitTestCase.assertNotNull(parameterList.leftDelimiter); | 2696 JUnitTestCase.assertNotNull(parameterList.leftDelimiter); |
| 2697 EngineTestCase.assertSize(3, parameterList.parameters); | 2697 EngineTestCase.assertSize(3, parameterList.parameters); |
| 2698 JUnitTestCase.assertNotNull(parameterList.rightDelimiter); | 2698 JUnitTestCase.assertNotNull(parameterList.rightDelimiter); |
| 2699 JUnitTestCase.assertNotNull(parameterList.rightParenthesis); | 2699 JUnitTestCase.assertNotNull(parameterList.rightParenthesis); |
| 2700 } | 2700 } |
| 2701 void test_parseFormalParameterList_positional_single() { | 2701 void test_parseFormalParameterList_positional_single() { |
| 2702 FormalParameterList parameterList = ParserTestCase.parse4("parseFormalParame
terList", "([A a = null])", []); | 2702 FormalParameterList parameterList = ParserTestCase.parse5("parseFormalParame
terList", "([A a = null])", []); |
| 2703 JUnitTestCase.assertNotNull(parameterList.leftParenthesis); | 2703 JUnitTestCase.assertNotNull(parameterList.leftParenthesis); |
| 2704 JUnitTestCase.assertNotNull(parameterList.leftDelimiter); | 2704 JUnitTestCase.assertNotNull(parameterList.leftDelimiter); |
| 2705 EngineTestCase.assertSize(1, parameterList.parameters); | 2705 EngineTestCase.assertSize(1, parameterList.parameters); |
| 2706 JUnitTestCase.assertNotNull(parameterList.rightDelimiter); | 2706 JUnitTestCase.assertNotNull(parameterList.rightDelimiter); |
| 2707 JUnitTestCase.assertNotNull(parameterList.rightParenthesis); | 2707 JUnitTestCase.assertNotNull(parameterList.rightParenthesis); |
| 2708 } | 2708 } |
| 2709 void test_parseForStatement_each_identifier() { | 2709 void test_parseForStatement_each_identifier() { |
| 2710 ForEachStatement statement = ParserTestCase.parse4("parseForStatement", "for
(element in list) {}", []); | 2710 ForEachStatement statement = ParserTestCase.parse5("parseForStatement", "for
(element in list) {}", []); |
| 2711 JUnitTestCase.assertNotNull(statement.forKeyword); | 2711 JUnitTestCase.assertNotNull(statement.forKeyword); |
| 2712 JUnitTestCase.assertNotNull(statement.leftParenthesis); | 2712 JUnitTestCase.assertNotNull(statement.leftParenthesis); |
| 2713 JUnitTestCase.assertNotNull(statement.loopParameter); | 2713 JUnitTestCase.assertNotNull(statement.loopParameter); |
| 2714 JUnitTestCase.assertNotNull(statement.inKeyword); | 2714 JUnitTestCase.assertNotNull(statement.inKeyword); |
| 2715 JUnitTestCase.assertNotNull(statement.iterator); | 2715 JUnitTestCase.assertNotNull(statement.iterator); |
| 2716 JUnitTestCase.assertNotNull(statement.rightParenthesis); | 2716 JUnitTestCase.assertNotNull(statement.rightParenthesis); |
| 2717 JUnitTestCase.assertNotNull(statement.body); | 2717 JUnitTestCase.assertNotNull(statement.body); |
| 2718 } | 2718 } |
| 2719 void test_parseForStatement_each_noType() { | 2719 void test_parseForStatement_each_noType() { |
| 2720 ForEachStatement statement = ParserTestCase.parse4("parseForStatement", "for
(element in list) {}", []); | 2720 ForEachStatement statement = ParserTestCase.parse5("parseForStatement", "for
(element in list) {}", []); |
| 2721 JUnitTestCase.assertNotNull(statement.forKeyword); | 2721 JUnitTestCase.assertNotNull(statement.forKeyword); |
| 2722 JUnitTestCase.assertNotNull(statement.leftParenthesis); | 2722 JUnitTestCase.assertNotNull(statement.leftParenthesis); |
| 2723 JUnitTestCase.assertNotNull(statement.loopParameter); | 2723 JUnitTestCase.assertNotNull(statement.loopParameter); |
| 2724 JUnitTestCase.assertNotNull(statement.inKeyword); | 2724 JUnitTestCase.assertNotNull(statement.inKeyword); |
| 2725 JUnitTestCase.assertNotNull(statement.iterator); | 2725 JUnitTestCase.assertNotNull(statement.iterator); |
| 2726 JUnitTestCase.assertNotNull(statement.rightParenthesis); | 2726 JUnitTestCase.assertNotNull(statement.rightParenthesis); |
| 2727 JUnitTestCase.assertNotNull(statement.body); | 2727 JUnitTestCase.assertNotNull(statement.body); |
| 2728 } | 2728 } |
| 2729 void test_parseForStatement_each_type() { | 2729 void test_parseForStatement_each_type() { |
| 2730 ForEachStatement statement = ParserTestCase.parse4("parseForStatement", "for
(A element in list) {}", []); | 2730 ForEachStatement statement = ParserTestCase.parse5("parseForStatement", "for
(A element in list) {}", []); |
| 2731 JUnitTestCase.assertNotNull(statement.forKeyword); | 2731 JUnitTestCase.assertNotNull(statement.forKeyword); |
| 2732 JUnitTestCase.assertNotNull(statement.leftParenthesis); | 2732 JUnitTestCase.assertNotNull(statement.leftParenthesis); |
| 2733 JUnitTestCase.assertNotNull(statement.loopParameter); | 2733 JUnitTestCase.assertNotNull(statement.loopParameter); |
| 2734 JUnitTestCase.assertNotNull(statement.inKeyword); | 2734 JUnitTestCase.assertNotNull(statement.inKeyword); |
| 2735 JUnitTestCase.assertNotNull(statement.iterator); | 2735 JUnitTestCase.assertNotNull(statement.iterator); |
| 2736 JUnitTestCase.assertNotNull(statement.rightParenthesis); | 2736 JUnitTestCase.assertNotNull(statement.rightParenthesis); |
| 2737 JUnitTestCase.assertNotNull(statement.body); | 2737 JUnitTestCase.assertNotNull(statement.body); |
| 2738 } | 2738 } |
| 2739 void test_parseForStatement_each_var() { | 2739 void test_parseForStatement_each_var() { |
| 2740 ForEachStatement statement = ParserTestCase.parse4("parseForStatement", "for
(var element in list) {}", []); | 2740 ForEachStatement statement = ParserTestCase.parse5("parseForStatement", "for
(var element in list) {}", []); |
| 2741 JUnitTestCase.assertNotNull(statement.forKeyword); | 2741 JUnitTestCase.assertNotNull(statement.forKeyword); |
| 2742 JUnitTestCase.assertNotNull(statement.leftParenthesis); | 2742 JUnitTestCase.assertNotNull(statement.leftParenthesis); |
| 2743 JUnitTestCase.assertNotNull(statement.loopParameter); | 2743 JUnitTestCase.assertNotNull(statement.loopParameter); |
| 2744 JUnitTestCase.assertNotNull(statement.inKeyword); | 2744 JUnitTestCase.assertNotNull(statement.inKeyword); |
| 2745 JUnitTestCase.assertNotNull(statement.iterator); | 2745 JUnitTestCase.assertNotNull(statement.iterator); |
| 2746 JUnitTestCase.assertNotNull(statement.rightParenthesis); | 2746 JUnitTestCase.assertNotNull(statement.rightParenthesis); |
| 2747 JUnitTestCase.assertNotNull(statement.body); | 2747 JUnitTestCase.assertNotNull(statement.body); |
| 2748 } | 2748 } |
| 2749 void test_parseForStatement_loop_c() { | 2749 void test_parseForStatement_loop_c() { |
| 2750 ForStatement statement = ParserTestCase.parse4("parseForStatement", "for (;
i < count;) {}", []); | 2750 ForStatement statement = ParserTestCase.parse5("parseForStatement", "for (;
i < count;) {}", []); |
| 2751 JUnitTestCase.assertNotNull(statement.forKeyword); | 2751 JUnitTestCase.assertNotNull(statement.forKeyword); |
| 2752 JUnitTestCase.assertNotNull(statement.leftParenthesis); | 2752 JUnitTestCase.assertNotNull(statement.leftParenthesis); |
| 2753 JUnitTestCase.assertNull(statement.variables); | 2753 JUnitTestCase.assertNull(statement.variables); |
| 2754 JUnitTestCase.assertNull(statement.initialization); | 2754 JUnitTestCase.assertNull(statement.initialization); |
| 2755 JUnitTestCase.assertNotNull(statement.leftSeparator); | 2755 JUnitTestCase.assertNotNull(statement.leftSeparator); |
| 2756 JUnitTestCase.assertNotNull(statement.condition); | 2756 JUnitTestCase.assertNotNull(statement.condition); |
| 2757 JUnitTestCase.assertNotNull(statement.rightSeparator); | 2757 JUnitTestCase.assertNotNull(statement.rightSeparator); |
| 2758 EngineTestCase.assertSize(0, statement.updaters); | 2758 EngineTestCase.assertSize(0, statement.updaters); |
| 2759 JUnitTestCase.assertNotNull(statement.rightParenthesis); | 2759 JUnitTestCase.assertNotNull(statement.rightParenthesis); |
| 2760 JUnitTestCase.assertNotNull(statement.body); | 2760 JUnitTestCase.assertNotNull(statement.body); |
| 2761 } | 2761 } |
| 2762 void test_parseForStatement_loop_cu() { | 2762 void test_parseForStatement_loop_cu() { |
| 2763 ForStatement statement = ParserTestCase.parse4("parseForStatement", "for (;
i < count; i++) {}", []); | 2763 ForStatement statement = ParserTestCase.parse5("parseForStatement", "for (;
i < count; i++) {}", []); |
| 2764 JUnitTestCase.assertNotNull(statement.forKeyword); | 2764 JUnitTestCase.assertNotNull(statement.forKeyword); |
| 2765 JUnitTestCase.assertNotNull(statement.leftParenthesis); | 2765 JUnitTestCase.assertNotNull(statement.leftParenthesis); |
| 2766 JUnitTestCase.assertNull(statement.variables); | 2766 JUnitTestCase.assertNull(statement.variables); |
| 2767 JUnitTestCase.assertNull(statement.initialization); | 2767 JUnitTestCase.assertNull(statement.initialization); |
| 2768 JUnitTestCase.assertNotNull(statement.leftSeparator); | 2768 JUnitTestCase.assertNotNull(statement.leftSeparator); |
| 2769 JUnitTestCase.assertNotNull(statement.condition); | 2769 JUnitTestCase.assertNotNull(statement.condition); |
| 2770 JUnitTestCase.assertNotNull(statement.rightSeparator); | 2770 JUnitTestCase.assertNotNull(statement.rightSeparator); |
| 2771 EngineTestCase.assertSize(1, statement.updaters); | 2771 EngineTestCase.assertSize(1, statement.updaters); |
| 2772 JUnitTestCase.assertNotNull(statement.rightParenthesis); | 2772 JUnitTestCase.assertNotNull(statement.rightParenthesis); |
| 2773 JUnitTestCase.assertNotNull(statement.body); | 2773 JUnitTestCase.assertNotNull(statement.body); |
| 2774 } | 2774 } |
| 2775 void test_parseForStatement_loop_ecu() { | 2775 void test_parseForStatement_loop_ecu() { |
| 2776 ForStatement statement = ParserTestCase.parse4("parseForStatement", "for (i-
-; i < count; i++) {}", []); | 2776 ForStatement statement = ParserTestCase.parse5("parseForStatement", "for (i-
-; i < count; i++) {}", []); |
| 2777 JUnitTestCase.assertNotNull(statement.forKeyword); | 2777 JUnitTestCase.assertNotNull(statement.forKeyword); |
| 2778 JUnitTestCase.assertNotNull(statement.leftParenthesis); | 2778 JUnitTestCase.assertNotNull(statement.leftParenthesis); |
| 2779 JUnitTestCase.assertNull(statement.variables); | 2779 JUnitTestCase.assertNull(statement.variables); |
| 2780 JUnitTestCase.assertNotNull(statement.initialization); | 2780 JUnitTestCase.assertNotNull(statement.initialization); |
| 2781 JUnitTestCase.assertNotNull(statement.leftSeparator); | 2781 JUnitTestCase.assertNotNull(statement.leftSeparator); |
| 2782 JUnitTestCase.assertNotNull(statement.condition); | 2782 JUnitTestCase.assertNotNull(statement.condition); |
| 2783 JUnitTestCase.assertNotNull(statement.rightSeparator); | 2783 JUnitTestCase.assertNotNull(statement.rightSeparator); |
| 2784 EngineTestCase.assertSize(1, statement.updaters); | 2784 EngineTestCase.assertSize(1, statement.updaters); |
| 2785 JUnitTestCase.assertNotNull(statement.rightParenthesis); | 2785 JUnitTestCase.assertNotNull(statement.rightParenthesis); |
| 2786 JUnitTestCase.assertNotNull(statement.body); | 2786 JUnitTestCase.assertNotNull(statement.body); |
| 2787 } | 2787 } |
| 2788 void test_parseForStatement_loop_i() { | 2788 void test_parseForStatement_loop_i() { |
| 2789 ForStatement statement = ParserTestCase.parse4("parseForStatement", "for (va
r i = 0;;) {}", []); | 2789 ForStatement statement = ParserTestCase.parse5("parseForStatement", "for (va
r i = 0;;) {}", []); |
| 2790 JUnitTestCase.assertNotNull(statement.forKeyword); | 2790 JUnitTestCase.assertNotNull(statement.forKeyword); |
| 2791 JUnitTestCase.assertNotNull(statement.leftParenthesis); | 2791 JUnitTestCase.assertNotNull(statement.leftParenthesis); |
| 2792 VariableDeclarationList variables10 = statement.variables; | 2792 VariableDeclarationList variables8 = statement.variables; |
| 2793 JUnitTestCase.assertNotNull(variables10); | 2793 JUnitTestCase.assertNotNull(variables8); |
| 2794 EngineTestCase.assertSize(1, variables10.variables); | 2794 EngineTestCase.assertSize(1, variables8.variables); |
| 2795 JUnitTestCase.assertNull(statement.initialization); | 2795 JUnitTestCase.assertNull(statement.initialization); |
| 2796 JUnitTestCase.assertNotNull(statement.leftSeparator); | 2796 JUnitTestCase.assertNotNull(statement.leftSeparator); |
| 2797 JUnitTestCase.assertNull(statement.condition); | 2797 JUnitTestCase.assertNull(statement.condition); |
| 2798 JUnitTestCase.assertNotNull(statement.rightSeparator); | 2798 JUnitTestCase.assertNotNull(statement.rightSeparator); |
| 2799 EngineTestCase.assertSize(0, statement.updaters); | 2799 EngineTestCase.assertSize(0, statement.updaters); |
| 2800 JUnitTestCase.assertNotNull(statement.rightParenthesis); | 2800 JUnitTestCase.assertNotNull(statement.rightParenthesis); |
| 2801 JUnitTestCase.assertNotNull(statement.body); | 2801 JUnitTestCase.assertNotNull(statement.body); |
| 2802 } | 2802 } |
| 2803 void test_parseForStatement_loop_ic() { | 2803 void test_parseForStatement_loop_ic() { |
| 2804 ForStatement statement = ParserTestCase.parse4("parseForStatement", "for (va
r i = 0; i < count;) {}", []); | 2804 ForStatement statement = ParserTestCase.parse5("parseForStatement", "for (va
r i = 0; i < count;) {}", []); |
| 2805 JUnitTestCase.assertNotNull(statement.forKeyword); | 2805 JUnitTestCase.assertNotNull(statement.forKeyword); |
| 2806 JUnitTestCase.assertNotNull(statement.leftParenthesis); | 2806 JUnitTestCase.assertNotNull(statement.leftParenthesis); |
| 2807 VariableDeclarationList variables11 = statement.variables; | 2807 VariableDeclarationList variables9 = statement.variables; |
| 2808 JUnitTestCase.assertNotNull(variables11); | 2808 JUnitTestCase.assertNotNull(variables9); |
| 2809 EngineTestCase.assertSize(1, variables11.variables); | 2809 EngineTestCase.assertSize(1, variables9.variables); |
| 2810 JUnitTestCase.assertNull(statement.initialization); | 2810 JUnitTestCase.assertNull(statement.initialization); |
| 2811 JUnitTestCase.assertNotNull(statement.leftSeparator); | 2811 JUnitTestCase.assertNotNull(statement.leftSeparator); |
| 2812 JUnitTestCase.assertNotNull(statement.condition); | 2812 JUnitTestCase.assertNotNull(statement.condition); |
| 2813 JUnitTestCase.assertNotNull(statement.rightSeparator); | 2813 JUnitTestCase.assertNotNull(statement.rightSeparator); |
| 2814 EngineTestCase.assertSize(0, statement.updaters); | 2814 EngineTestCase.assertSize(0, statement.updaters); |
| 2815 JUnitTestCase.assertNotNull(statement.rightParenthesis); | 2815 JUnitTestCase.assertNotNull(statement.rightParenthesis); |
| 2816 JUnitTestCase.assertNotNull(statement.body); | 2816 JUnitTestCase.assertNotNull(statement.body); |
| 2817 } | 2817 } |
| 2818 void test_parseForStatement_loop_icu() { | 2818 void test_parseForStatement_loop_icu() { |
| 2819 ForStatement statement = ParserTestCase.parse4("parseForStatement", "for (va
r i = 0; i < count; i++) {}", []); | 2819 ForStatement statement = ParserTestCase.parse5("parseForStatement", "for (va
r i = 0; i < count; i++) {}", []); |
| 2820 JUnitTestCase.assertNotNull(statement.forKeyword); | 2820 JUnitTestCase.assertNotNull(statement.forKeyword); |
| 2821 JUnitTestCase.assertNotNull(statement.leftParenthesis); | 2821 JUnitTestCase.assertNotNull(statement.leftParenthesis); |
| 2822 VariableDeclarationList variables12 = statement.variables; | 2822 VariableDeclarationList variables10 = statement.variables; |
| 2823 JUnitTestCase.assertNotNull(variables12); | 2823 JUnitTestCase.assertNotNull(variables10); |
| 2824 EngineTestCase.assertSize(1, variables12.variables); | 2824 EngineTestCase.assertSize(1, variables10.variables); |
| 2825 JUnitTestCase.assertNull(statement.initialization); | 2825 JUnitTestCase.assertNull(statement.initialization); |
| 2826 JUnitTestCase.assertNotNull(statement.leftSeparator); | 2826 JUnitTestCase.assertNotNull(statement.leftSeparator); |
| 2827 JUnitTestCase.assertNotNull(statement.condition); | 2827 JUnitTestCase.assertNotNull(statement.condition); |
| 2828 JUnitTestCase.assertNotNull(statement.rightSeparator); | 2828 JUnitTestCase.assertNotNull(statement.rightSeparator); |
| 2829 EngineTestCase.assertSize(1, statement.updaters); | 2829 EngineTestCase.assertSize(1, statement.updaters); |
| 2830 JUnitTestCase.assertNotNull(statement.rightParenthesis); | 2830 JUnitTestCase.assertNotNull(statement.rightParenthesis); |
| 2831 JUnitTestCase.assertNotNull(statement.body); | 2831 JUnitTestCase.assertNotNull(statement.body); |
| 2832 } | 2832 } |
| 2833 void test_parseForStatement_loop_iicuu() { | 2833 void test_parseForStatement_loop_iicuu() { |
| 2834 ForStatement statement = ParserTestCase.parse4("parseForStatement", "for (in
t i = 0, j = count; i < j; i++, j--) {}", []); | 2834 ForStatement statement = ParserTestCase.parse5("parseForStatement", "for (in
t i = 0, j = count; i < j; i++, j--) {}", []); |
| 2835 JUnitTestCase.assertNotNull(statement.forKeyword); | 2835 JUnitTestCase.assertNotNull(statement.forKeyword); |
| 2836 JUnitTestCase.assertNotNull(statement.leftParenthesis); | 2836 JUnitTestCase.assertNotNull(statement.leftParenthesis); |
| 2837 VariableDeclarationList variables13 = statement.variables; | 2837 VariableDeclarationList variables11 = statement.variables; |
| 2838 JUnitTestCase.assertNotNull(variables13); | 2838 JUnitTestCase.assertNotNull(variables11); |
| 2839 EngineTestCase.assertSize(2, variables13.variables); | 2839 EngineTestCase.assertSize(2, variables11.variables); |
| 2840 JUnitTestCase.assertNull(statement.initialization); | 2840 JUnitTestCase.assertNull(statement.initialization); |
| 2841 JUnitTestCase.assertNotNull(statement.leftSeparator); | 2841 JUnitTestCase.assertNotNull(statement.leftSeparator); |
| 2842 JUnitTestCase.assertNotNull(statement.condition); | 2842 JUnitTestCase.assertNotNull(statement.condition); |
| 2843 JUnitTestCase.assertNotNull(statement.rightSeparator); | 2843 JUnitTestCase.assertNotNull(statement.rightSeparator); |
| 2844 EngineTestCase.assertSize(2, statement.updaters); | 2844 EngineTestCase.assertSize(2, statement.updaters); |
| 2845 JUnitTestCase.assertNotNull(statement.rightParenthesis); | 2845 JUnitTestCase.assertNotNull(statement.rightParenthesis); |
| 2846 JUnitTestCase.assertNotNull(statement.body); | 2846 JUnitTestCase.assertNotNull(statement.body); |
| 2847 } | 2847 } |
| 2848 void test_parseForStatement_loop_iu() { | 2848 void test_parseForStatement_loop_iu() { |
| 2849 ForStatement statement = ParserTestCase.parse4("parseForStatement", "for (va
r i = 0;; i++) {}", []); | 2849 ForStatement statement = ParserTestCase.parse5("parseForStatement", "for (va
r i = 0;; i++) {}", []); |
| 2850 JUnitTestCase.assertNotNull(statement.forKeyword); | 2850 JUnitTestCase.assertNotNull(statement.forKeyword); |
| 2851 JUnitTestCase.assertNotNull(statement.leftParenthesis); | 2851 JUnitTestCase.assertNotNull(statement.leftParenthesis); |
| 2852 VariableDeclarationList variables14 = statement.variables; | 2852 VariableDeclarationList variables12 = statement.variables; |
| 2853 JUnitTestCase.assertNotNull(variables14); | 2853 JUnitTestCase.assertNotNull(variables12); |
| 2854 EngineTestCase.assertSize(1, variables14.variables); | 2854 EngineTestCase.assertSize(1, variables12.variables); |
| 2855 JUnitTestCase.assertNull(statement.initialization); | 2855 JUnitTestCase.assertNull(statement.initialization); |
| 2856 JUnitTestCase.assertNotNull(statement.leftSeparator); | 2856 JUnitTestCase.assertNotNull(statement.leftSeparator); |
| 2857 JUnitTestCase.assertNull(statement.condition); | 2857 JUnitTestCase.assertNull(statement.condition); |
| 2858 JUnitTestCase.assertNotNull(statement.rightSeparator); | 2858 JUnitTestCase.assertNotNull(statement.rightSeparator); |
| 2859 EngineTestCase.assertSize(1, statement.updaters); | 2859 EngineTestCase.assertSize(1, statement.updaters); |
| 2860 JUnitTestCase.assertNotNull(statement.rightParenthesis); | 2860 JUnitTestCase.assertNotNull(statement.rightParenthesis); |
| 2861 JUnitTestCase.assertNotNull(statement.body); | 2861 JUnitTestCase.assertNotNull(statement.body); |
| 2862 } | 2862 } |
| 2863 void test_parseForStatement_loop_u() { | 2863 void test_parseForStatement_loop_u() { |
| 2864 ForStatement statement = ParserTestCase.parse4("parseForStatement", "for (;;
i++) {}", []); | 2864 ForStatement statement = ParserTestCase.parse5("parseForStatement", "for (;;
i++) {}", []); |
| 2865 JUnitTestCase.assertNotNull(statement.forKeyword); | 2865 JUnitTestCase.assertNotNull(statement.forKeyword); |
| 2866 JUnitTestCase.assertNotNull(statement.leftParenthesis); | 2866 JUnitTestCase.assertNotNull(statement.leftParenthesis); |
| 2867 JUnitTestCase.assertNull(statement.variables); | 2867 JUnitTestCase.assertNull(statement.variables); |
| 2868 JUnitTestCase.assertNull(statement.initialization); | 2868 JUnitTestCase.assertNull(statement.initialization); |
| 2869 JUnitTestCase.assertNotNull(statement.leftSeparator); | 2869 JUnitTestCase.assertNotNull(statement.leftSeparator); |
| 2870 JUnitTestCase.assertNull(statement.condition); | 2870 JUnitTestCase.assertNull(statement.condition); |
| 2871 JUnitTestCase.assertNotNull(statement.rightSeparator); | 2871 JUnitTestCase.assertNotNull(statement.rightSeparator); |
| 2872 EngineTestCase.assertSize(1, statement.updaters); | 2872 EngineTestCase.assertSize(1, statement.updaters); |
| 2873 JUnitTestCase.assertNotNull(statement.rightParenthesis); | 2873 JUnitTestCase.assertNotNull(statement.rightParenthesis); |
| 2874 JUnitTestCase.assertNotNull(statement.body); | 2874 JUnitTestCase.assertNotNull(statement.body); |
| 2875 } | 2875 } |
| 2876 void test_parseFunctionBody_block() { | 2876 void test_parseFunctionBody_block() { |
| 2877 BlockFunctionBody functionBody = ParserTestCase.parse("parseFunctionBody", <
Object> [false, false], "{}"); | 2877 BlockFunctionBody functionBody = ParserTestCase.parse("parseFunctionBody", <
Object> [false, false], "{}"); |
| 2878 JUnitTestCase.assertNotNull(functionBody.block); | 2878 JUnitTestCase.assertNotNull(functionBody.block); |
| 2879 } | 2879 } |
| 2880 void test_parseFunctionBody_empty() { | 2880 void test_parseFunctionBody_empty() { |
| 2881 EmptyFunctionBody functionBody = ParserTestCase.parse("parseFunctionBody", <
Object> [true, false], ";"); | 2881 EmptyFunctionBody functionBody = ParserTestCase.parse("parseFunctionBody", <
Object> [true, false], ";"); |
| 2882 JUnitTestCase.assertNotNull(functionBody.semicolon); | 2882 JUnitTestCase.assertNotNull(functionBody.semicolon); |
| 2883 } | 2883 } |
| 2884 void test_parseFunctionBody_expression() { | 2884 void test_parseFunctionBody_expression() { |
| 2885 ExpressionFunctionBody functionBody = ParserTestCase.parse("parseFunctionBod
y", <Object> [false, false], "=> y;"); | 2885 ExpressionFunctionBody functionBody = ParserTestCase.parse("parseFunctionBod
y", <Object> [false, false], "=> y;"); |
| 2886 JUnitTestCase.assertNotNull(functionBody.functionDefinition); | 2886 JUnitTestCase.assertNotNull(functionBody.functionDefinition); |
| 2887 JUnitTestCase.assertNotNull(functionBody.expression); | 2887 JUnitTestCase.assertNotNull(functionBody.expression); |
| 2888 JUnitTestCase.assertNotNull(functionBody.semicolon); | 2888 JUnitTestCase.assertNotNull(functionBody.semicolon); |
| 2889 } | 2889 } |
| 2890 void test_parseFunctionDeclaration_function() { | 2890 void test_parseFunctionDeclaration_function() { |
| 2891 Comment comment = Comment.createDocumentationComment(new List<Token>.fixedLe
ngth(0)); | 2891 Comment comment = Comment.createDocumentationComment(new List<Token>.fixedLe
ngth(0)); |
| 2892 TypeName returnType = new TypeName(new SimpleIdentifier(null), null); | 2892 TypeName returnType = new TypeName.full(new SimpleIdentifier.full(null), nul
l); |
| 2893 FunctionDeclaration declaration = ParserTestCase.parse("parseFunctionDeclara
tion", <Object> [commentAndMetadata(comment, []), null, returnType, false], "f()
{}"); | 2893 FunctionDeclaration declaration = ParserTestCase.parse("parseFunctionDeclara
tion", <Object> [commentAndMetadata(comment, []), null, returnType, false], "f()
{}"); |
| 2894 JUnitTestCase.assertEquals(comment, declaration.documentationComment); | 2894 JUnitTestCase.assertEquals(comment, declaration.documentationComment); |
| 2895 JUnitTestCase.assertEquals(returnType, declaration.returnType); | 2895 JUnitTestCase.assertEquals(returnType, declaration.returnType); |
| 2896 JUnitTestCase.assertNotNull(declaration.name); | 2896 JUnitTestCase.assertNotNull(declaration.name); |
| 2897 FunctionExpression expression = declaration.functionExpression; | 2897 FunctionExpression expression = declaration.functionExpression; |
| 2898 JUnitTestCase.assertNotNull(expression); | 2898 JUnitTestCase.assertNotNull(expression); |
| 2899 JUnitTestCase.assertNotNull(expression.body); | 2899 JUnitTestCase.assertNotNull(expression.body); |
| 2900 JUnitTestCase.assertNotNull(expression.parameters); | 2900 JUnitTestCase.assertNotNull(expression.parameters); |
| 2901 JUnitTestCase.assertNull(declaration.propertyKeyword); | 2901 JUnitTestCase.assertNull(declaration.propertyKeyword); |
| 2902 } | 2902 } |
| 2903 void test_parseFunctionDeclaration_function_inStatement() { | 2903 void test_parseFunctionDeclaration_function_inStatement() { |
| 2904 Comment comment = Comment.createDocumentationComment(new List<Token>.fixedLe
ngth(0)); | 2904 Comment comment = Comment.createDocumentationComment(new List<Token>.fixedLe
ngth(0)); |
| 2905 TypeName returnType = new TypeName(new SimpleIdentifier(null), null); | 2905 TypeName returnType = new TypeName.full(new SimpleIdentifier.full(null), nul
l); |
| 2906 FunctionDeclaration declaration = ParserTestCase.parse("parseFunctionDeclara
tion", <Object> [commentAndMetadata(comment, []), null, returnType, true], "f()
{};"); | 2906 FunctionDeclaration declaration = ParserTestCase.parse("parseFunctionDeclara
tion", <Object> [commentAndMetadata(comment, []), null, returnType, true], "f()
{};"); |
| 2907 JUnitTestCase.assertEquals(comment, declaration.documentationComment); | 2907 JUnitTestCase.assertEquals(comment, declaration.documentationComment); |
| 2908 JUnitTestCase.assertEquals(returnType, declaration.returnType); | 2908 JUnitTestCase.assertEquals(returnType, declaration.returnType); |
| 2909 JUnitTestCase.assertNotNull(declaration.name); | 2909 JUnitTestCase.assertNotNull(declaration.name); |
| 2910 FunctionExpression expression = declaration.functionExpression; | 2910 FunctionExpression expression = declaration.functionExpression; |
| 2911 JUnitTestCase.assertNotNull(expression); | 2911 JUnitTestCase.assertNotNull(expression); |
| 2912 JUnitTestCase.assertNotNull(expression.body); | 2912 JUnitTestCase.assertNotNull(expression.body); |
| 2913 JUnitTestCase.assertNotNull(expression.parameters); | 2913 JUnitTestCase.assertNotNull(expression.parameters); |
| 2914 JUnitTestCase.assertNull(declaration.propertyKeyword); | 2914 JUnitTestCase.assertNull(declaration.propertyKeyword); |
| 2915 } | 2915 } |
| 2916 void test_parseFunctionDeclaration_getter() { | 2916 void test_parseFunctionDeclaration_getter() { |
| 2917 Comment comment = Comment.createDocumentationComment(new List<Token>.fixedLe
ngth(0)); | 2917 Comment comment = Comment.createDocumentationComment(new List<Token>.fixedLe
ngth(0)); |
| 2918 TypeName returnType = new TypeName(new SimpleIdentifier(null), null); | 2918 TypeName returnType = new TypeName.full(new SimpleIdentifier.full(null), nul
l); |
| 2919 FunctionDeclaration declaration = ParserTestCase.parse("parseFunctionDeclara
tion", <Object> [commentAndMetadata(comment, []), null, returnType, false], "get
p => 0;"); | 2919 FunctionDeclaration declaration = ParserTestCase.parse("parseFunctionDeclara
tion", <Object> [commentAndMetadata(comment, []), null, returnType, false], "get
p => 0;"); |
| 2920 JUnitTestCase.assertEquals(comment, declaration.documentationComment); | 2920 JUnitTestCase.assertEquals(comment, declaration.documentationComment); |
| 2921 JUnitTestCase.assertEquals(returnType, declaration.returnType); | 2921 JUnitTestCase.assertEquals(returnType, declaration.returnType); |
| 2922 JUnitTestCase.assertNotNull(declaration.name); | 2922 JUnitTestCase.assertNotNull(declaration.name); |
| 2923 FunctionExpression expression = declaration.functionExpression; | 2923 FunctionExpression expression = declaration.functionExpression; |
| 2924 JUnitTestCase.assertNotNull(expression); | 2924 JUnitTestCase.assertNotNull(expression); |
| 2925 JUnitTestCase.assertNotNull(expression.body); | 2925 JUnitTestCase.assertNotNull(expression.body); |
| 2926 JUnitTestCase.assertNull(expression.parameters); | 2926 JUnitTestCase.assertNull(expression.parameters); |
| 2927 JUnitTestCase.assertNotNull(declaration.propertyKeyword); | 2927 JUnitTestCase.assertNotNull(declaration.propertyKeyword); |
| 2928 } | 2928 } |
| 2929 void test_parseFunctionDeclaration_setter() { | 2929 void test_parseFunctionDeclaration_setter() { |
| 2930 Comment comment = Comment.createDocumentationComment(new List<Token>.fixedLe
ngth(0)); | 2930 Comment comment = Comment.createDocumentationComment(new List<Token>.fixedLe
ngth(0)); |
| 2931 TypeName returnType = new TypeName(new SimpleIdentifier(null), null); | 2931 TypeName returnType = new TypeName.full(new SimpleIdentifier.full(null), nul
l); |
| 2932 FunctionDeclaration declaration = ParserTestCase.parse("parseFunctionDeclara
tion", <Object> [commentAndMetadata(comment, []), null, returnType, false], "set
p(v) {}"); | 2932 FunctionDeclaration declaration = ParserTestCase.parse("parseFunctionDeclara
tion", <Object> [commentAndMetadata(comment, []), null, returnType, false], "set
p(v) {}"); |
| 2933 JUnitTestCase.assertEquals(comment, declaration.documentationComment); | 2933 JUnitTestCase.assertEquals(comment, declaration.documentationComment); |
| 2934 JUnitTestCase.assertEquals(returnType, declaration.returnType); | 2934 JUnitTestCase.assertEquals(returnType, declaration.returnType); |
| 2935 JUnitTestCase.assertNotNull(declaration.name); | 2935 JUnitTestCase.assertNotNull(declaration.name); |
| 2936 FunctionExpression expression = declaration.functionExpression; | 2936 FunctionExpression expression = declaration.functionExpression; |
| 2937 JUnitTestCase.assertNotNull(expression); | 2937 JUnitTestCase.assertNotNull(expression); |
| 2938 JUnitTestCase.assertNotNull(expression.body); | 2938 JUnitTestCase.assertNotNull(expression.body); |
| 2939 JUnitTestCase.assertNotNull(expression.parameters); | 2939 JUnitTestCase.assertNotNull(expression.parameters); |
| 2940 JUnitTestCase.assertNotNull(declaration.propertyKeyword); | 2940 JUnitTestCase.assertNotNull(declaration.propertyKeyword); |
| 2941 } | 2941 } |
| 2942 void test_parseFunctionDeclarationStatement() { | 2942 void test_parseFunctionDeclarationStatement() { |
| 2943 FunctionDeclarationStatement statement = ParserTestCase.parse4("parseFunctio
nDeclarationStatement", "void f(int p) => p * 2;", []); | 2943 FunctionDeclarationStatement statement = ParserTestCase.parse5("parseFunctio
nDeclarationStatement", "void f(int p) => p * 2;", []); |
| 2944 JUnitTestCase.assertNotNull(statement.functionDeclaration); | 2944 JUnitTestCase.assertNotNull(statement.functionDeclaration); |
| 2945 } | 2945 } |
| 2946 void test_parseFunctionExpression_body_inExpression() { | 2946 void test_parseFunctionExpression_body_inExpression() { |
| 2947 FunctionExpression expression = ParserTestCase.parse4("parseFunctionExpressi
on", "(int i) => i++", []); | 2947 FunctionExpression expression = ParserTestCase.parse5("parseFunctionExpressi
on", "(int i) => i++", []); |
| 2948 JUnitTestCase.assertNotNull(expression.body); | 2948 JUnitTestCase.assertNotNull(expression.body); |
| 2949 JUnitTestCase.assertNotNull(expression.parameters); | 2949 JUnitTestCase.assertNotNull(expression.parameters); |
| 2950 JUnitTestCase.assertNull((expression.body as ExpressionFunctionBody).semicol
on); | 2950 JUnitTestCase.assertNull(((expression.body as ExpressionFunctionBody)).semic
olon); |
| 2951 } | 2951 } |
| 2952 void test_parseFunctionExpression_minimal() { | 2952 void test_parseFunctionExpression_minimal() { |
| 2953 FunctionExpression expression = ParserTestCase.parse4("parseFunctionExpressi
on", "() {}", []); | 2953 FunctionExpression expression = ParserTestCase.parse5("parseFunctionExpressi
on", "() {}", []); |
| 2954 JUnitTestCase.assertNotNull(expression.body); | 2954 JUnitTestCase.assertNotNull(expression.body); |
| 2955 JUnitTestCase.assertNotNull(expression.parameters); | 2955 JUnitTestCase.assertNotNull(expression.parameters); |
| 2956 } | 2956 } |
| 2957 void test_parseGetter_nonStatic() { | 2957 void test_parseGetter_nonStatic() { |
| 2958 Comment comment = Comment.createDocumentationComment(new List<Token>.fixedLe
ngth(0)); | 2958 Comment comment = Comment.createDocumentationComment(new List<Token>.fixedLe
ngth(0)); |
| 2959 TypeName returnType = new TypeName(new SimpleIdentifier(null), null); | 2959 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;"); | 2960 MethodDeclaration method = ParserTestCase.parse("parseGetter", <Object> [com
mentAndMetadata(comment, []), null, null, returnType], "get a;"); |
| 2961 JUnitTestCase.assertNotNull(method.body); | 2961 JUnitTestCase.assertNotNull(method.body); |
| 2962 JUnitTestCase.assertEquals(comment, method.documentationComment); | 2962 JUnitTestCase.assertEquals(comment, method.documentationComment); |
| 2963 JUnitTestCase.assertNull(method.externalKeyword); | 2963 JUnitTestCase.assertNull(method.externalKeyword); |
| 2964 JUnitTestCase.assertNull(method.modifierKeyword); | 2964 JUnitTestCase.assertNull(method.modifierKeyword); |
| 2965 JUnitTestCase.assertNotNull(method.name); | 2965 JUnitTestCase.assertNotNull(method.name); |
| 2966 JUnitTestCase.assertNull(method.operatorKeyword); | 2966 JUnitTestCase.assertNull(method.operatorKeyword); |
| 2967 JUnitTestCase.assertNull(method.parameters); | 2967 JUnitTestCase.assertNull(method.parameters); |
| 2968 JUnitTestCase.assertNotNull(method.propertyKeyword); | 2968 JUnitTestCase.assertNotNull(method.propertyKeyword); |
| 2969 JUnitTestCase.assertEquals(returnType, method.returnType); | 2969 JUnitTestCase.assertEquals(returnType, method.returnType); |
| 2970 } | 2970 } |
| 2971 void test_parseGetter_static() { | 2971 void test_parseGetter_static() { |
| 2972 Comment comment = Comment.createDocumentationComment(new List<Token>.fixedLe
ngth(0)); | 2972 Comment comment = Comment.createDocumentationComment(new List<Token>.fixedLe
ngth(0)); |
| 2973 Token staticKeyword = TokenFactory.token(Keyword.STATIC); | 2973 Token staticKeyword = TokenFactory.token(Keyword.STATIC); |
| 2974 TypeName returnType = new TypeName(new SimpleIdentifier(null), null); | 2974 TypeName returnType = new TypeName.full(new SimpleIdentifier.full(null), nul
l); |
| 2975 MethodDeclaration method = ParserTestCase.parse("parseGetter", <Object> [com
mentAndMetadata(comment, []), null, staticKeyword, returnType], "get a;"); | 2975 MethodDeclaration method = ParserTestCase.parse("parseGetter", <Object> [com
mentAndMetadata(comment, []), null, staticKeyword, returnType], "get a;"); |
| 2976 JUnitTestCase.assertNotNull(method.body); | 2976 JUnitTestCase.assertNotNull(method.body); |
| 2977 JUnitTestCase.assertEquals(comment, method.documentationComment); | 2977 JUnitTestCase.assertEquals(comment, method.documentationComment); |
| 2978 JUnitTestCase.assertNull(method.externalKeyword); | 2978 JUnitTestCase.assertNull(method.externalKeyword); |
| 2979 JUnitTestCase.assertEquals(staticKeyword, method.modifierKeyword); | 2979 JUnitTestCase.assertEquals(staticKeyword, method.modifierKeyword); |
| 2980 JUnitTestCase.assertNotNull(method.name); | 2980 JUnitTestCase.assertNotNull(method.name); |
| 2981 JUnitTestCase.assertNull(method.operatorKeyword); | 2981 JUnitTestCase.assertNull(method.operatorKeyword); |
| 2982 JUnitTestCase.assertNull(method.parameters); | 2982 JUnitTestCase.assertNull(method.parameters); |
| 2983 JUnitTestCase.assertNotNull(method.propertyKeyword); | 2983 JUnitTestCase.assertNotNull(method.propertyKeyword); |
| 2984 JUnitTestCase.assertEquals(returnType, method.returnType); | 2984 JUnitTestCase.assertEquals(returnType, method.returnType); |
| 2985 } | 2985 } |
| 2986 void test_parseIdentifierList_multiple() { | 2986 void test_parseIdentifierList_multiple() { |
| 2987 List<SimpleIdentifier> list = ParserTestCase.parse4("parseIdentifierList", "
a, b, c", []); | 2987 List<SimpleIdentifier> list = ParserTestCase.parse5("parseIdentifierList", "
a, b, c", []); |
| 2988 EngineTestCase.assertSize(3, list); | 2988 EngineTestCase.assertSize(3, list); |
| 2989 } | 2989 } |
| 2990 void test_parseIdentifierList_single() { | 2990 void test_parseIdentifierList_single() { |
| 2991 List<SimpleIdentifier> list = ParserTestCase.parse4("parseIdentifierList", "
a", []); | 2991 List<SimpleIdentifier> list = ParserTestCase.parse5("parseIdentifierList", "
a", []); |
| 2992 EngineTestCase.assertSize(1, list); | 2992 EngineTestCase.assertSize(1, list); |
| 2993 } | 2993 } |
| 2994 void test_parseIfStatement_else_block() { | 2994 void test_parseIfStatement_else_block() { |
| 2995 IfStatement statement = ParserTestCase.parse4("parseIfStatement", "if (x) {}
else {}", []); | 2995 IfStatement statement = ParserTestCase.parse5("parseIfStatement", "if (x) {}
else {}", []); |
| 2996 JUnitTestCase.assertNotNull(statement.ifKeyword); | 2996 JUnitTestCase.assertNotNull(statement.ifKeyword); |
| 2997 JUnitTestCase.assertNotNull(statement.leftParenthesis); | 2997 JUnitTestCase.assertNotNull(statement.leftParenthesis); |
| 2998 JUnitTestCase.assertNotNull(statement.condition); | 2998 JUnitTestCase.assertNotNull(statement.condition); |
| 2999 JUnitTestCase.assertNotNull(statement.rightParenthesis); | 2999 JUnitTestCase.assertNotNull(statement.rightParenthesis); |
| 3000 JUnitTestCase.assertNotNull(statement.thenStatement); | 3000 JUnitTestCase.assertNotNull(statement.thenStatement); |
| 3001 JUnitTestCase.assertNotNull(statement.elseKeyword); | 3001 JUnitTestCase.assertNotNull(statement.elseKeyword); |
| 3002 JUnitTestCase.assertNotNull(statement.elseStatement); | 3002 JUnitTestCase.assertNotNull(statement.elseStatement); |
| 3003 } | 3003 } |
| 3004 void test_parseIfStatement_else_statement() { | 3004 void test_parseIfStatement_else_statement() { |
| 3005 IfStatement statement = ParserTestCase.parse4("parseIfStatement", "if (x) f(
x); else f(y);", []); | 3005 IfStatement statement = ParserTestCase.parse5("parseIfStatement", "if (x) f(
x); else f(y);", []); |
| 3006 JUnitTestCase.assertNotNull(statement.ifKeyword); | 3006 JUnitTestCase.assertNotNull(statement.ifKeyword); |
| 3007 JUnitTestCase.assertNotNull(statement.leftParenthesis); | 3007 JUnitTestCase.assertNotNull(statement.leftParenthesis); |
| 3008 JUnitTestCase.assertNotNull(statement.condition); | 3008 JUnitTestCase.assertNotNull(statement.condition); |
| 3009 JUnitTestCase.assertNotNull(statement.rightParenthesis); | 3009 JUnitTestCase.assertNotNull(statement.rightParenthesis); |
| 3010 JUnitTestCase.assertNotNull(statement.thenStatement); | 3010 JUnitTestCase.assertNotNull(statement.thenStatement); |
| 3011 JUnitTestCase.assertNotNull(statement.elseKeyword); | 3011 JUnitTestCase.assertNotNull(statement.elseKeyword); |
| 3012 JUnitTestCase.assertNotNull(statement.elseStatement); | 3012 JUnitTestCase.assertNotNull(statement.elseStatement); |
| 3013 } | 3013 } |
| 3014 void test_parseIfStatement_noElse_block() { | 3014 void test_parseIfStatement_noElse_block() { |
| 3015 IfStatement statement = ParserTestCase.parse4("parseIfStatement", "if (x) {}
", []); | 3015 IfStatement statement = ParserTestCase.parse5("parseIfStatement", "if (x) {}
", []); |
| 3016 JUnitTestCase.assertNotNull(statement.ifKeyword); | 3016 JUnitTestCase.assertNotNull(statement.ifKeyword); |
| 3017 JUnitTestCase.assertNotNull(statement.leftParenthesis); | 3017 JUnitTestCase.assertNotNull(statement.leftParenthesis); |
| 3018 JUnitTestCase.assertNotNull(statement.condition); | 3018 JUnitTestCase.assertNotNull(statement.condition); |
| 3019 JUnitTestCase.assertNotNull(statement.rightParenthesis); | 3019 JUnitTestCase.assertNotNull(statement.rightParenthesis); |
| 3020 JUnitTestCase.assertNotNull(statement.thenStatement); | 3020 JUnitTestCase.assertNotNull(statement.thenStatement); |
| 3021 JUnitTestCase.assertNull(statement.elseKeyword); | 3021 JUnitTestCase.assertNull(statement.elseKeyword); |
| 3022 JUnitTestCase.assertNull(statement.elseStatement); | 3022 JUnitTestCase.assertNull(statement.elseStatement); |
| 3023 } | 3023 } |
| 3024 void test_parseIfStatement_noElse_statement() { | 3024 void test_parseIfStatement_noElse_statement() { |
| 3025 IfStatement statement = ParserTestCase.parse4("parseIfStatement", "if (x) f(
x);", []); | 3025 IfStatement statement = ParserTestCase.parse5("parseIfStatement", "if (x) f(
x);", []); |
| 3026 JUnitTestCase.assertNotNull(statement.ifKeyword); | 3026 JUnitTestCase.assertNotNull(statement.ifKeyword); |
| 3027 JUnitTestCase.assertNotNull(statement.leftParenthesis); | 3027 JUnitTestCase.assertNotNull(statement.leftParenthesis); |
| 3028 JUnitTestCase.assertNotNull(statement.condition); | 3028 JUnitTestCase.assertNotNull(statement.condition); |
| 3029 JUnitTestCase.assertNotNull(statement.rightParenthesis); | 3029 JUnitTestCase.assertNotNull(statement.rightParenthesis); |
| 3030 JUnitTestCase.assertNotNull(statement.thenStatement); | 3030 JUnitTestCase.assertNotNull(statement.thenStatement); |
| 3031 JUnitTestCase.assertNull(statement.elseKeyword); | 3031 JUnitTestCase.assertNull(statement.elseKeyword); |
| 3032 JUnitTestCase.assertNull(statement.elseStatement); | 3032 JUnitTestCase.assertNull(statement.elseStatement); |
| 3033 } | 3033 } |
| 3034 void test_parseImplementsClause_multiple() { | 3034 void test_parseImplementsClause_multiple() { |
| 3035 ImplementsClause clause = ParserTestCase.parse4("parseImplementsClause", "im
plements A, B, C", []); | 3035 ImplementsClause clause = ParserTestCase.parse5("parseImplementsClause", "im
plements A, B, C", []); |
| 3036 EngineTestCase.assertSize(3, clause.interfaces); | 3036 EngineTestCase.assertSize(3, clause.interfaces); |
| 3037 JUnitTestCase.assertNotNull(clause.keyword); | 3037 JUnitTestCase.assertNotNull(clause.keyword); |
| 3038 } | 3038 } |
| 3039 void test_parseImplementsClause_single() { | 3039 void test_parseImplementsClause_single() { |
| 3040 ImplementsClause clause = ParserTestCase.parse4("parseImplementsClause", "im
plements A", []); | 3040 ImplementsClause clause = ParserTestCase.parse5("parseImplementsClause", "im
plements A", []); |
| 3041 EngineTestCase.assertSize(1, clause.interfaces); | 3041 EngineTestCase.assertSize(1, clause.interfaces); |
| 3042 JUnitTestCase.assertNotNull(clause.keyword); | 3042 JUnitTestCase.assertNotNull(clause.keyword); |
| 3043 } | 3043 } |
| 3044 void test_parseImportDirective_hide() { | 3044 void test_parseImportDirective_hide() { |
| 3045 ImportDirective directive = ParserTestCase.parse("parseImportDirective", <Ob
ject> [emptyCommentAndMetadata()], "import 'lib/lib.dart' hide A, B;"); | 3045 ImportDirective directive = ParserTestCase.parse("parseImportDirective", <Ob
ject> [emptyCommentAndMetadata()], "import 'lib/lib.dart' hide A, B;"); |
| 3046 JUnitTestCase.assertNotNull(directive.keyword); | 3046 JUnitTestCase.assertNotNull(directive.keyword); |
| 3047 JUnitTestCase.assertNotNull(directive.libraryUri); | 3047 JUnitTestCase.assertNotNull(directive.uri); |
| 3048 JUnitTestCase.assertNull(directive.asToken); | 3048 JUnitTestCase.assertNull(directive.asToken); |
| 3049 JUnitTestCase.assertNull(directive.prefix); | 3049 JUnitTestCase.assertNull(directive.prefix); |
| 3050 EngineTestCase.assertSize(1, directive.combinators); | 3050 EngineTestCase.assertSize(1, directive.combinators); |
| 3051 JUnitTestCase.assertNotNull(directive.semicolon); | 3051 JUnitTestCase.assertNotNull(directive.semicolon); |
| 3052 } | 3052 } |
| 3053 void test_parseImportDirective_noCombinator() { | 3053 void test_parseImportDirective_noCombinator() { |
| 3054 ImportDirective directive = ParserTestCase.parse("parseImportDirective", <Ob
ject> [emptyCommentAndMetadata()], "import 'lib/lib.dart';"); | 3054 ImportDirective directive = ParserTestCase.parse("parseImportDirective", <Ob
ject> [emptyCommentAndMetadata()], "import 'lib/lib.dart';"); |
| 3055 JUnitTestCase.assertNotNull(directive.keyword); | 3055 JUnitTestCase.assertNotNull(directive.keyword); |
| 3056 JUnitTestCase.assertNotNull(directive.libraryUri); | 3056 JUnitTestCase.assertNotNull(directive.uri); |
| 3057 JUnitTestCase.assertNull(directive.asToken); | 3057 JUnitTestCase.assertNull(directive.asToken); |
| 3058 JUnitTestCase.assertNull(directive.prefix); | 3058 JUnitTestCase.assertNull(directive.prefix); |
| 3059 EngineTestCase.assertSize(0, directive.combinators); | 3059 EngineTestCase.assertSize(0, directive.combinators); |
| 3060 JUnitTestCase.assertNotNull(directive.semicolon); | 3060 JUnitTestCase.assertNotNull(directive.semicolon); |
| 3061 } | 3061 } |
| 3062 void test_parseImportDirective_prefix() { | 3062 void test_parseImportDirective_prefix() { |
| 3063 ImportDirective directive = ParserTestCase.parse("parseImportDirective", <Ob
ject> [emptyCommentAndMetadata()], "import 'lib/lib.dart' as a;"); | 3063 ImportDirective directive = ParserTestCase.parse("parseImportDirective", <Ob
ject> [emptyCommentAndMetadata()], "import 'lib/lib.dart' as a;"); |
| 3064 JUnitTestCase.assertNotNull(directive.keyword); | 3064 JUnitTestCase.assertNotNull(directive.keyword); |
| 3065 JUnitTestCase.assertNotNull(directive.libraryUri); | 3065 JUnitTestCase.assertNotNull(directive.uri); |
| 3066 JUnitTestCase.assertNotNull(directive.asToken); | 3066 JUnitTestCase.assertNotNull(directive.asToken); |
| 3067 JUnitTestCase.assertNotNull(directive.prefix); | 3067 JUnitTestCase.assertNotNull(directive.prefix); |
| 3068 EngineTestCase.assertSize(0, directive.combinators); | 3068 EngineTestCase.assertSize(0, directive.combinators); |
| 3069 JUnitTestCase.assertNotNull(directive.semicolon); | 3069 JUnitTestCase.assertNotNull(directive.semicolon); |
| 3070 } | 3070 } |
| 3071 void test_parseImportDirective_prefix_hide_show() { | 3071 void test_parseImportDirective_prefix_hide_show() { |
| 3072 ImportDirective directive = ParserTestCase.parse("parseImportDirective", <Ob
ject> [emptyCommentAndMetadata()], "import 'lib/lib.dart' as a hide A show B;"); | 3072 ImportDirective directive = ParserTestCase.parse("parseImportDirective", <Ob
ject> [emptyCommentAndMetadata()], "import 'lib/lib.dart' as a hide A show B;"); |
| 3073 JUnitTestCase.assertNotNull(directive.keyword); | 3073 JUnitTestCase.assertNotNull(directive.keyword); |
| 3074 JUnitTestCase.assertNotNull(directive.libraryUri); | 3074 JUnitTestCase.assertNotNull(directive.uri); |
| 3075 JUnitTestCase.assertNotNull(directive.asToken); | 3075 JUnitTestCase.assertNotNull(directive.asToken); |
| 3076 JUnitTestCase.assertNotNull(directive.prefix); | 3076 JUnitTestCase.assertNotNull(directive.prefix); |
| 3077 EngineTestCase.assertSize(2, directive.combinators); | 3077 EngineTestCase.assertSize(2, directive.combinators); |
| 3078 JUnitTestCase.assertNotNull(directive.semicolon); | 3078 JUnitTestCase.assertNotNull(directive.semicolon); |
| 3079 } | 3079 } |
| 3080 void test_parseImportDirective_prefix_show_hide() { | 3080 void test_parseImportDirective_prefix_show_hide() { |
| 3081 ImportDirective directive = ParserTestCase.parse("parseImportDirective", <Ob
ject> [emptyCommentAndMetadata()], "import 'lib/lib.dart' as a show B hide A;"); | 3081 ImportDirective directive = ParserTestCase.parse("parseImportDirective", <Ob
ject> [emptyCommentAndMetadata()], "import 'lib/lib.dart' as a show B hide A;"); |
| 3082 JUnitTestCase.assertNotNull(directive.keyword); | 3082 JUnitTestCase.assertNotNull(directive.keyword); |
| 3083 JUnitTestCase.assertNotNull(directive.libraryUri); | 3083 JUnitTestCase.assertNotNull(directive.uri); |
| 3084 JUnitTestCase.assertNotNull(directive.asToken); | 3084 JUnitTestCase.assertNotNull(directive.asToken); |
| 3085 JUnitTestCase.assertNotNull(directive.prefix); | 3085 JUnitTestCase.assertNotNull(directive.prefix); |
| 3086 EngineTestCase.assertSize(2, directive.combinators); | 3086 EngineTestCase.assertSize(2, directive.combinators); |
| 3087 JUnitTestCase.assertNotNull(directive.semicolon); | 3087 JUnitTestCase.assertNotNull(directive.semicolon); |
| 3088 } | 3088 } |
| 3089 void test_parseImportDirective_show() { | 3089 void test_parseImportDirective_show() { |
| 3090 ImportDirective directive = ParserTestCase.parse("parseImportDirective", <Ob
ject> [emptyCommentAndMetadata()], "import 'lib/lib.dart' show A, B;"); | 3090 ImportDirective directive = ParserTestCase.parse("parseImportDirective", <Ob
ject> [emptyCommentAndMetadata()], "import 'lib/lib.dart' show A, B;"); |
| 3091 JUnitTestCase.assertNotNull(directive.keyword); | 3091 JUnitTestCase.assertNotNull(directive.keyword); |
| 3092 JUnitTestCase.assertNotNull(directive.libraryUri); | 3092 JUnitTestCase.assertNotNull(directive.uri); |
| 3093 JUnitTestCase.assertNull(directive.asToken); | 3093 JUnitTestCase.assertNull(directive.asToken); |
| 3094 JUnitTestCase.assertNull(directive.prefix); | 3094 JUnitTestCase.assertNull(directive.prefix); |
| 3095 EngineTestCase.assertSize(1, directive.combinators); | 3095 EngineTestCase.assertSize(1, directive.combinators); |
| 3096 JUnitTestCase.assertNotNull(directive.semicolon); | 3096 JUnitTestCase.assertNotNull(directive.semicolon); |
| 3097 } | 3097 } |
| 3098 void test_parseInitializedIdentifierList_type() { | 3098 void test_parseInitializedIdentifierList_type() { |
| 3099 Comment comment = Comment.createDocumentationComment(new List<Token>.fixedLe
ngth(0)); | 3099 Comment comment = Comment.createDocumentationComment(new List<Token>.fixedLe
ngth(0)); |
| 3100 Token staticKeyword = TokenFactory.token(Keyword.STATIC); | 3100 Token staticKeyword = TokenFactory.token(Keyword.STATIC); |
| 3101 TypeName type = new TypeName(new SimpleIdentifier(null), null); | 3101 TypeName type = new TypeName.full(new SimpleIdentifier.full(null), null); |
| 3102 FieldDeclaration declaration = ParserTestCase.parse("parseInitializedIdentif
ierList", <Object> [commentAndMetadata(comment, []), staticKeyword, null, type],
"a = 1, b, c = 3;"); | 3102 FieldDeclaration declaration = ParserTestCase.parse("parseInitializedIdentif
ierList", <Object> [commentAndMetadata(comment, []), staticKeyword, null, type],
"a = 1, b, c = 3;"); |
| 3103 JUnitTestCase.assertEquals(comment, declaration.documentationComment); | 3103 JUnitTestCase.assertEquals(comment, declaration.documentationComment); |
| 3104 VariableDeclarationList fields5 = declaration.fields; | 3104 VariableDeclarationList fields3 = declaration.fields; |
| 3105 JUnitTestCase.assertNotNull(fields5); | 3105 JUnitTestCase.assertNotNull(fields3); |
| 3106 JUnitTestCase.assertNull(fields5.keyword); | 3106 JUnitTestCase.assertNull(fields3.keyword); |
| 3107 JUnitTestCase.assertEquals(type, fields5.type); | 3107 JUnitTestCase.assertEquals(type, fields3.type); |
| 3108 EngineTestCase.assertSize(3, fields5.variables); | 3108 EngineTestCase.assertSize(3, fields3.variables); |
| 3109 JUnitTestCase.assertEquals(staticKeyword, declaration.keyword); | 3109 JUnitTestCase.assertEquals(staticKeyword, declaration.keyword); |
| 3110 JUnitTestCase.assertNotNull(declaration.semicolon); | 3110 JUnitTestCase.assertNotNull(declaration.semicolon); |
| 3111 } | 3111 } |
| 3112 void test_parseInitializedIdentifierList_var() { | 3112 void test_parseInitializedIdentifierList_var() { |
| 3113 Comment comment = Comment.createDocumentationComment(new List<Token>.fixedLe
ngth(0)); | 3113 Comment comment = Comment.createDocumentationComment(new List<Token>.fixedLe
ngth(0)); |
| 3114 Token staticKeyword = TokenFactory.token(Keyword.STATIC); | 3114 Token staticKeyword = TokenFactory.token(Keyword.STATIC); |
| 3115 Token varKeyword = TokenFactory.token(Keyword.VAR); | 3115 Token varKeyword = TokenFactory.token(Keyword.VAR); |
| 3116 FieldDeclaration declaration = ParserTestCase.parse("parseInitializedIdentif
ierList", <Object> [commentAndMetadata(comment, []), staticKeyword, varKeyword,
null], "a = 1, b, c = 3;"); | 3116 FieldDeclaration declaration = ParserTestCase.parse("parseInitializedIdentif
ierList", <Object> [commentAndMetadata(comment, []), staticKeyword, varKeyword,
null], "a = 1, b, c = 3;"); |
| 3117 JUnitTestCase.assertEquals(comment, declaration.documentationComment); | 3117 JUnitTestCase.assertEquals(comment, declaration.documentationComment); |
| 3118 VariableDeclarationList fields6 = declaration.fields; | 3118 VariableDeclarationList fields4 = declaration.fields; |
| 3119 JUnitTestCase.assertNotNull(fields6); | 3119 JUnitTestCase.assertNotNull(fields4); |
| 3120 JUnitTestCase.assertEquals(varKeyword, fields6.keyword); | 3120 JUnitTestCase.assertEquals(varKeyword, fields4.keyword); |
| 3121 JUnitTestCase.assertNull(fields6.type); | 3121 JUnitTestCase.assertNull(fields4.type); |
| 3122 EngineTestCase.assertSize(3, fields6.variables); | 3122 EngineTestCase.assertSize(3, fields4.variables); |
| 3123 JUnitTestCase.assertEquals(staticKeyword, declaration.keyword); | 3123 JUnitTestCase.assertEquals(staticKeyword, declaration.keyword); |
| 3124 JUnitTestCase.assertNotNull(declaration.semicolon); | 3124 JUnitTestCase.assertNotNull(declaration.semicolon); |
| 3125 } | 3125 } |
| 3126 void test_parseInstanceCreationExpression_qualifiedType() { | 3126 void test_parseInstanceCreationExpression_qualifiedType() { |
| 3127 Token token5 = TokenFactory.token(Keyword.NEW); | 3127 Token token5 = TokenFactory.token(Keyword.NEW); |
| 3128 InstanceCreationExpression expression = ParserTestCase.parse("parseInstanceC
reationExpression", <Object> [token5], "A.B()"); | 3128 InstanceCreationExpression expression = ParserTestCase.parse("parseInstanceC
reationExpression", <Object> [token5], "A.B()"); |
| 3129 JUnitTestCase.assertEquals(token5, expression.keyword); | 3129 JUnitTestCase.assertEquals(token5, expression.keyword); |
| 3130 ConstructorName name = expression.constructorName; | 3130 ConstructorName name = expression.constructorName; |
| 3131 JUnitTestCase.assertNotNull(name); | 3131 JUnitTestCase.assertNotNull(name); |
| 3132 JUnitTestCase.assertNotNull(name.type); | 3132 JUnitTestCase.assertNotNull(name.type); |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3168 JUnitTestCase.assertNotNull(expression.argumentList); | 3168 JUnitTestCase.assertNotNull(expression.argumentList); |
| 3169 } | 3169 } |
| 3170 void test_parseLibraryDirective() { | 3170 void test_parseLibraryDirective() { |
| 3171 LibraryDirective directive = ParserTestCase.parse("parseLibraryDirective", <
Object> [emptyCommentAndMetadata()], "library l;"); | 3171 LibraryDirective directive = ParserTestCase.parse("parseLibraryDirective", <
Object> [emptyCommentAndMetadata()], "library l;"); |
| 3172 JUnitTestCase.assertNotNull(directive.libraryToken); | 3172 JUnitTestCase.assertNotNull(directive.libraryToken); |
| 3173 JUnitTestCase.assertNotNull(directive.name); | 3173 JUnitTestCase.assertNotNull(directive.name); |
| 3174 JUnitTestCase.assertNotNull(directive.semicolon); | 3174 JUnitTestCase.assertNotNull(directive.semicolon); |
| 3175 } | 3175 } |
| 3176 void test_parseLibraryIdentifier_multiple() { | 3176 void test_parseLibraryIdentifier_multiple() { |
| 3177 String name = "a.b.c"; | 3177 String name = "a.b.c"; |
| 3178 LibraryIdentifier identifier = ParserTestCase.parse4("parseLibraryIdentifier
", name, []); | 3178 LibraryIdentifier identifier = ParserTestCase.parse5("parseLibraryIdentifier
", name, []); |
| 3179 JUnitTestCase.assertEquals(name, identifier.name); | 3179 JUnitTestCase.assertEquals(name, identifier.name); |
| 3180 } | 3180 } |
| 3181 void test_parseLibraryIdentifier_single() { | 3181 void test_parseLibraryIdentifier_single() { |
| 3182 String name = "a"; | 3182 String name = "a"; |
| 3183 LibraryIdentifier identifier = ParserTestCase.parse4("parseLibraryIdentifier
", name, []); | 3183 LibraryIdentifier identifier = ParserTestCase.parse5("parseLibraryIdentifier
", name, []); |
| 3184 JUnitTestCase.assertEquals(name, identifier.name); | 3184 JUnitTestCase.assertEquals(name, identifier.name); |
| 3185 } | 3185 } |
| 3186 void test_parseListLiteral_empty_oneToken() { | 3186 void test_parseListLiteral_empty_oneToken() { |
| 3187 Token token9 = TokenFactory.token(Keyword.CONST); | 3187 Token token9 = TokenFactory.token(Keyword.CONST); |
| 3188 TypeArgumentList typeArguments = new TypeArgumentList(null, null, null); | 3188 TypeArgumentList typeArguments = new TypeArgumentList.full(null, null, null)
; |
| 3189 ListLiteral literal = ParserTestCase.parse("parseListLiteral", <Object> [tok
en9, typeArguments], "[]"); | 3189 ListLiteral literal = ParserTestCase.parse("parseListLiteral", <Object> [tok
en9, typeArguments], "[]"); |
| 3190 JUnitTestCase.assertEquals(token9, literal.modifier); | 3190 JUnitTestCase.assertEquals(token9, literal.modifier); |
| 3191 JUnitTestCase.assertEquals(typeArguments, literal.typeArguments); | 3191 JUnitTestCase.assertEquals(typeArguments, literal.typeArguments); |
| 3192 JUnitTestCase.assertNotNull(literal.leftBracket); | 3192 JUnitTestCase.assertNotNull(literal.leftBracket); |
| 3193 EngineTestCase.assertSize(0, literal.elements); | 3193 EngineTestCase.assertSize(0, literal.elements); |
| 3194 JUnitTestCase.assertNotNull(literal.rightBracket); | 3194 JUnitTestCase.assertNotNull(literal.rightBracket); |
| 3195 } | 3195 } |
| 3196 void test_parseListLiteral_empty_twoTokens() { | 3196 void test_parseListLiteral_empty_twoTokens() { |
| 3197 Token token10 = TokenFactory.token(Keyword.CONST); | 3197 Token token10 = TokenFactory.token(Keyword.CONST); |
| 3198 TypeArgumentList typeArguments = new TypeArgumentList(null, null, null); | 3198 TypeArgumentList typeArguments = new TypeArgumentList.full(null, null, null)
; |
| 3199 ListLiteral literal = ParserTestCase.parse("parseListLiteral", <Object> [tok
en10, typeArguments], "[ ]"); | 3199 ListLiteral literal = ParserTestCase.parse("parseListLiteral", <Object> [tok
en10, typeArguments], "[ ]"); |
| 3200 JUnitTestCase.assertEquals(token10, literal.modifier); | 3200 JUnitTestCase.assertEquals(token10, literal.modifier); |
| 3201 JUnitTestCase.assertEquals(typeArguments, literal.typeArguments); | 3201 JUnitTestCase.assertEquals(typeArguments, literal.typeArguments); |
| 3202 JUnitTestCase.assertNotNull(literal.leftBracket); | 3202 JUnitTestCase.assertNotNull(literal.leftBracket); |
| 3203 EngineTestCase.assertSize(0, literal.elements); | 3203 EngineTestCase.assertSize(0, literal.elements); |
| 3204 JUnitTestCase.assertNotNull(literal.rightBracket); | 3204 JUnitTestCase.assertNotNull(literal.rightBracket); |
| 3205 } | 3205 } |
| 3206 void test_parseListLiteral_multiple() { | 3206 void test_parseListLiteral_multiple() { |
| 3207 ListLiteral literal = ParserTestCase.parse("parseListLiteral", <Object> [nul
l, null], "[1, 2, 3]"); | 3207 ListLiteral literal = ParserTestCase.parse("parseListLiteral", <Object> [nul
l, null], "[1, 2, 3]"); |
| 3208 JUnitTestCase.assertNull(literal.modifier); | 3208 JUnitTestCase.assertNull(literal.modifier); |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3245 } | 3245 } |
| 3246 void test_parseListOrMapLiteral_map_type() { | 3246 void test_parseListOrMapLiteral_map_type() { |
| 3247 MapLiteral literal = ParserTestCase.parse("parseListOrMapLiteral", <Object>
[null], "<int> {'1' : 1}"); | 3247 MapLiteral literal = ParserTestCase.parse("parseListOrMapLiteral", <Object>
[null], "<int> {'1' : 1}"); |
| 3248 JUnitTestCase.assertNull(literal.modifier); | 3248 JUnitTestCase.assertNull(literal.modifier); |
| 3249 JUnitTestCase.assertNotNull(literal.typeArguments); | 3249 JUnitTestCase.assertNotNull(literal.typeArguments); |
| 3250 JUnitTestCase.assertNotNull(literal.leftBracket); | 3250 JUnitTestCase.assertNotNull(literal.leftBracket); |
| 3251 EngineTestCase.assertSize(1, literal.entries); | 3251 EngineTestCase.assertSize(1, literal.entries); |
| 3252 JUnitTestCase.assertNotNull(literal.rightBracket); | 3252 JUnitTestCase.assertNotNull(literal.rightBracket); |
| 3253 } | 3253 } |
| 3254 void test_parseLogicalAndExpression() { | 3254 void test_parseLogicalAndExpression() { |
| 3255 BinaryExpression expression = ParserTestCase.parse4("parseLogicalAndExpressi
on", "x && y", []); | 3255 BinaryExpression expression = ParserTestCase.parse5("parseLogicalAndExpressi
on", "x && y", []); |
| 3256 JUnitTestCase.assertNotNull(expression.leftOperand); | 3256 JUnitTestCase.assertNotNull(expression.leftOperand); |
| 3257 JUnitTestCase.assertNotNull(expression.operator); | 3257 JUnitTestCase.assertNotNull(expression.operator); |
| 3258 JUnitTestCase.assertEquals(TokenType.AMPERSAND_AMPERSAND, expression.operato
r.type); | 3258 JUnitTestCase.assertEquals(TokenType.AMPERSAND_AMPERSAND, expression.operato
r.type); |
| 3259 JUnitTestCase.assertNotNull(expression.rightOperand); | 3259 JUnitTestCase.assertNotNull(expression.rightOperand); |
| 3260 } | 3260 } |
| 3261 void test_parseLogicalOrExpression() { | 3261 void test_parseLogicalOrExpression() { |
| 3262 BinaryExpression expression = ParserTestCase.parse4("parseLogicalOrExpressio
n", "x || y", []); | 3262 BinaryExpression expression = ParserTestCase.parse5("parseLogicalOrExpressio
n", "x || y", []); |
| 3263 JUnitTestCase.assertNotNull(expression.leftOperand); | 3263 JUnitTestCase.assertNotNull(expression.leftOperand); |
| 3264 JUnitTestCase.assertNotNull(expression.operator); | 3264 JUnitTestCase.assertNotNull(expression.operator); |
| 3265 JUnitTestCase.assertEquals(TokenType.BAR_BAR, expression.operator.type); | 3265 JUnitTestCase.assertEquals(TokenType.BAR_BAR, expression.operator.type); |
| 3266 JUnitTestCase.assertNotNull(expression.rightOperand); | 3266 JUnitTestCase.assertNotNull(expression.rightOperand); |
| 3267 } | 3267 } |
| 3268 void test_parseMapLiteral_empty() { | 3268 void test_parseMapLiteral_empty() { |
| 3269 Token token11 = TokenFactory.token(Keyword.CONST); | 3269 Token token11 = TokenFactory.token(Keyword.CONST); |
| 3270 TypeArgumentList typeArguments = new TypeArgumentList(null, null, null); | 3270 TypeArgumentList typeArguments = new TypeArgumentList.full(null, null, null)
; |
| 3271 MapLiteral literal = ParserTestCase.parse("parseMapLiteral", <Object> [token
11, typeArguments], "{}"); | 3271 MapLiteral literal = ParserTestCase.parse("parseMapLiteral", <Object> [token
11, typeArguments], "{}"); |
| 3272 JUnitTestCase.assertEquals(token11, literal.modifier); | 3272 JUnitTestCase.assertEquals(token11, literal.modifier); |
| 3273 JUnitTestCase.assertEquals(typeArguments, literal.typeArguments); | 3273 JUnitTestCase.assertEquals(typeArguments, literal.typeArguments); |
| 3274 JUnitTestCase.assertNotNull(literal.leftBracket); | 3274 JUnitTestCase.assertNotNull(literal.leftBracket); |
| 3275 EngineTestCase.assertSize(0, literal.entries); | 3275 EngineTestCase.assertSize(0, literal.entries); |
| 3276 JUnitTestCase.assertNotNull(literal.rightBracket); | 3276 JUnitTestCase.assertNotNull(literal.rightBracket); |
| 3277 } | 3277 } |
| 3278 void test_parseMapLiteral_multiple() { | 3278 void test_parseMapLiteral_multiple() { |
| 3279 MapLiteral literal = ParserTestCase.parse("parseMapLiteral", <Object> [null,
null], "{'a' : b, 'x' : y}"); | 3279 MapLiteral literal = ParserTestCase.parse("parseMapLiteral", <Object> [null,
null], "{'a' : b, 'x' : y}"); |
| 3280 JUnitTestCase.assertNotNull(literal.leftBracket); | 3280 JUnitTestCase.assertNotNull(literal.leftBracket); |
| 3281 EngineTestCase.assertSize(2, literal.entries); | 3281 EngineTestCase.assertSize(2, literal.entries); |
| 3282 JUnitTestCase.assertNotNull(literal.rightBracket); | 3282 JUnitTestCase.assertNotNull(literal.rightBracket); |
| 3283 } | 3283 } |
| 3284 void test_parseMapLiteral_single() { | 3284 void test_parseMapLiteral_single() { |
| 3285 MapLiteral literal = ParserTestCase.parse("parseMapLiteral", <Object> [null,
null], "{'x' : y}"); | 3285 MapLiteral literal = ParserTestCase.parse("parseMapLiteral", <Object> [null,
null], "{'x' : y}"); |
| 3286 JUnitTestCase.assertNotNull(literal.leftBracket); | 3286 JUnitTestCase.assertNotNull(literal.leftBracket); |
| 3287 EngineTestCase.assertSize(1, literal.entries); | 3287 EngineTestCase.assertSize(1, literal.entries); |
| 3288 JUnitTestCase.assertNotNull(literal.rightBracket); | 3288 JUnitTestCase.assertNotNull(literal.rightBracket); |
| 3289 } | 3289 } |
| 3290 void test_parseMapLiteralEntry() { | 3290 void test_parseMapLiteralEntry() { |
| 3291 MapLiteralEntry entry = ParserTestCase.parse4("parseMapLiteralEntry", "'x' :
y", []); | 3291 MapLiteralEntry entry = ParserTestCase.parse5("parseMapLiteralEntry", "'x' :
y", []); |
| 3292 JUnitTestCase.assertNotNull(entry.key); | 3292 JUnitTestCase.assertNotNull(entry.key); |
| 3293 JUnitTestCase.assertNotNull(entry.separator); | 3293 JUnitTestCase.assertNotNull(entry.separator); |
| 3294 JUnitTestCase.assertNotNull(entry.value); | 3294 JUnitTestCase.assertNotNull(entry.value); |
| 3295 } | 3295 } |
| 3296 void test_parseModifiers_abstract() { | 3296 void test_parseModifiers_abstract() { |
| 3297 Modifiers modifiers = ParserTestCase.parse4("parseModifiers", "abstract A",
[]); | 3297 Modifiers modifiers = ParserTestCase.parse5("parseModifiers", "abstract A",
[]); |
| 3298 JUnitTestCase.assertNotNull(modifiers.abstractKeyword); | 3298 JUnitTestCase.assertNotNull(modifiers.abstractKeyword); |
| 3299 } | 3299 } |
| 3300 void test_parseModifiers_const() { | 3300 void test_parseModifiers_const() { |
| 3301 Modifiers modifiers = ParserTestCase.parse4("parseModifiers", "const A", [])
; | 3301 Modifiers modifiers = ParserTestCase.parse5("parseModifiers", "const A", [])
; |
| 3302 JUnitTestCase.assertNotNull(modifiers.constKeyword); | 3302 JUnitTestCase.assertNotNull(modifiers.constKeyword); |
| 3303 } | 3303 } |
| 3304 void test_parseModifiers_external() { | 3304 void test_parseModifiers_external() { |
| 3305 Modifiers modifiers = ParserTestCase.parse4("parseModifiers", "external A",
[]); | 3305 Modifiers modifiers = ParserTestCase.parse5("parseModifiers", "external A",
[]); |
| 3306 JUnitTestCase.assertNotNull(modifiers.externalKeyword); | 3306 JUnitTestCase.assertNotNull(modifiers.externalKeyword); |
| 3307 } | 3307 } |
| 3308 void test_parseModifiers_factory() { | 3308 void test_parseModifiers_factory() { |
| 3309 Modifiers modifiers = ParserTestCase.parse4("parseModifiers", "factory A", [
]); | 3309 Modifiers modifiers = ParserTestCase.parse5("parseModifiers", "factory A", [
]); |
| 3310 JUnitTestCase.assertNotNull(modifiers.factoryKeyword); | 3310 JUnitTestCase.assertNotNull(modifiers.factoryKeyword); |
| 3311 } | 3311 } |
| 3312 void test_parseModifiers_final() { | 3312 void test_parseModifiers_final() { |
| 3313 Modifiers modifiers = ParserTestCase.parse4("parseModifiers", "final A", [])
; | 3313 Modifiers modifiers = ParserTestCase.parse5("parseModifiers", "final A", [])
; |
| 3314 JUnitTestCase.assertNotNull(modifiers.finalKeyword); | 3314 JUnitTestCase.assertNotNull(modifiers.finalKeyword); |
| 3315 } | 3315 } |
| 3316 void test_parseModifiers_static() { | 3316 void test_parseModifiers_static() { |
| 3317 Modifiers modifiers = ParserTestCase.parse4("parseModifiers", "static A", []
); | 3317 Modifiers modifiers = ParserTestCase.parse5("parseModifiers", "static A", []
); |
| 3318 JUnitTestCase.assertNotNull(modifiers.staticKeyword); | 3318 JUnitTestCase.assertNotNull(modifiers.staticKeyword); |
| 3319 } | 3319 } |
| 3320 void test_parseModifiers_var() { | 3320 void test_parseModifiers_var() { |
| 3321 Modifiers modifiers = ParserTestCase.parse4("parseModifiers", "var A", []); | 3321 Modifiers modifiers = ParserTestCase.parse5("parseModifiers", "var A", []); |
| 3322 JUnitTestCase.assertNotNull(modifiers.varKeyword); | 3322 JUnitTestCase.assertNotNull(modifiers.varKeyword); |
| 3323 } | 3323 } |
| 3324 void test_parseMultiplicativeExpression_normal() { | 3324 void test_parseMultiplicativeExpression_normal() { |
| 3325 BinaryExpression expression = ParserTestCase.parse4("parseMultiplicativeExpr
ession", "x * y", []); | 3325 BinaryExpression expression = ParserTestCase.parse5("parseMultiplicativeExpr
ession", "x * y", []); |
| 3326 JUnitTestCase.assertNotNull(expression.leftOperand); | 3326 JUnitTestCase.assertNotNull(expression.leftOperand); |
| 3327 JUnitTestCase.assertNotNull(expression.operator); | 3327 JUnitTestCase.assertNotNull(expression.operator); |
| 3328 JUnitTestCase.assertEquals(TokenType.STAR, expression.operator.type); | 3328 JUnitTestCase.assertEquals(TokenType.STAR, expression.operator.type); |
| 3329 JUnitTestCase.assertNotNull(expression.rightOperand); | 3329 JUnitTestCase.assertNotNull(expression.rightOperand); |
| 3330 } | 3330 } |
| 3331 void test_parseMultiplicativeExpression_super() { | 3331 void test_parseMultiplicativeExpression_super() { |
| 3332 BinaryExpression expression = ParserTestCase.parse4("parseMultiplicativeExpr
ession", "super * y", []); | 3332 BinaryExpression expression = ParserTestCase.parse5("parseMultiplicativeExpr
ession", "super * y", []); |
| 3333 EngineTestCase.assertInstanceOf(SuperExpression, expression.leftOperand); | 3333 EngineTestCase.assertInstanceOf(SuperExpression, expression.leftOperand); |
| 3334 JUnitTestCase.assertNotNull(expression.operator); | 3334 JUnitTestCase.assertNotNull(expression.operator); |
| 3335 JUnitTestCase.assertEquals(TokenType.STAR, expression.operator.type); | 3335 JUnitTestCase.assertEquals(TokenType.STAR, expression.operator.type); |
| 3336 JUnitTestCase.assertNotNull(expression.rightOperand); | 3336 JUnitTestCase.assertNotNull(expression.rightOperand); |
| 3337 } | 3337 } |
| 3338 void test_parseNewExpression() { | 3338 void test_parseNewExpression() { |
| 3339 InstanceCreationExpression expression = ParserTestCase.parse4("parseNewExpre
ssion", "new A()", []); | 3339 InstanceCreationExpression expression = ParserTestCase.parse5("parseNewExpre
ssion", "new A()", []); |
| 3340 JUnitTestCase.assertNotNull(expression.keyword); | 3340 JUnitTestCase.assertNotNull(expression.keyword); |
| 3341 ConstructorName name = expression.constructorName; | 3341 ConstructorName name = expression.constructorName; |
| 3342 JUnitTestCase.assertNotNull(name); | 3342 JUnitTestCase.assertNotNull(name); |
| 3343 JUnitTestCase.assertNotNull(name.type); | 3343 JUnitTestCase.assertNotNull(name.type); |
| 3344 JUnitTestCase.assertNull(name.period); | 3344 JUnitTestCase.assertNull(name.period); |
| 3345 JUnitTestCase.assertNull(name.name); | 3345 JUnitTestCase.assertNull(name.name); |
| 3346 JUnitTestCase.assertNotNull(expression.argumentList); | 3346 JUnitTestCase.assertNotNull(expression.argumentList); |
| 3347 } | 3347 } |
| 3348 void test_parseNonLabeledStatement_const_list_empty() { | 3348 void test_parseNonLabeledStatement_const_list_empty() { |
| 3349 ExpressionStatement statement = ParserTestCase.parse4("parseNonLabeledStatem
ent", "const [];", []); | 3349 ExpressionStatement statement = ParserTestCase.parse5("parseNonLabeledStatem
ent", "const [];", []); |
| 3350 JUnitTestCase.assertNotNull(statement.expression); | 3350 JUnitTestCase.assertNotNull(statement.expression); |
| 3351 } | 3351 } |
| 3352 void test_parseNonLabeledStatement_const_list_nonEmpty() { | 3352 void test_parseNonLabeledStatement_const_list_nonEmpty() { |
| 3353 ExpressionStatement statement = ParserTestCase.parse4("parseNonLabeledStatem
ent", "const [1, 2];", []); | 3353 ExpressionStatement statement = ParserTestCase.parse5("parseNonLabeledStatem
ent", "const [1, 2];", []); |
| 3354 JUnitTestCase.assertNotNull(statement.expression); | 3354 JUnitTestCase.assertNotNull(statement.expression); |
| 3355 } | 3355 } |
| 3356 void test_parseNonLabeledStatement_const_map_empty() { | 3356 void test_parseNonLabeledStatement_const_map_empty() { |
| 3357 ExpressionStatement statement = ParserTestCase.parse4("parseNonLabeledStatem
ent", "const {};", []); | 3357 ExpressionStatement statement = ParserTestCase.parse5("parseNonLabeledStatem
ent", "const {};", []); |
| 3358 JUnitTestCase.assertNotNull(statement.expression); | 3358 JUnitTestCase.assertNotNull(statement.expression); |
| 3359 } | 3359 } |
| 3360 void test_parseNonLabeledStatement_const_map_nonEmpty() { | 3360 void test_parseNonLabeledStatement_const_map_nonEmpty() { |
| 3361 ExpressionStatement statement = ParserTestCase.parse4("parseNonLabeledStatem
ent", "const {'a' : 1};", []); | 3361 ExpressionStatement statement = ParserTestCase.parse5("parseNonLabeledStatem
ent", "const {'a' : 1};", []); |
| 3362 JUnitTestCase.assertNotNull(statement.expression); | 3362 JUnitTestCase.assertNotNull(statement.expression); |
| 3363 } | 3363 } |
| 3364 void test_parseNonLabeledStatement_const_object() { | 3364 void test_parseNonLabeledStatement_const_object() { |
| 3365 ExpressionStatement statement = ParserTestCase.parse4("parseNonLabeledStatem
ent", "const A();", []); | 3365 ExpressionStatement statement = ParserTestCase.parse5("parseNonLabeledStatem
ent", "const A();", []); |
| 3366 JUnitTestCase.assertNotNull(statement.expression); | 3366 JUnitTestCase.assertNotNull(statement.expression); |
| 3367 } | 3367 } |
| 3368 void test_parseNonLabeledStatement_const_object_named_typeParameters() { | 3368 void test_parseNonLabeledStatement_const_object_named_typeParameters() { |
| 3369 ExpressionStatement statement = ParserTestCase.parse4("parseNonLabeledStatem
ent", "const A<B>.c();", []); | 3369 ExpressionStatement statement = ParserTestCase.parse5("parseNonLabeledStatem
ent", "const A<B>.c();", []); |
| 3370 JUnitTestCase.assertNotNull(statement.expression); | 3370 JUnitTestCase.assertNotNull(statement.expression); |
| 3371 } | 3371 } |
| 3372 void test_parseNonLabeledStatement_constructorInvocation() { | 3372 void test_parseNonLabeledStatement_constructorInvocation() { |
| 3373 ExpressionStatement statement = ParserTestCase.parse4("parseNonLabeledStatem
ent", "new C().m();", []); | 3373 ExpressionStatement statement = ParserTestCase.parse5("parseNonLabeledStatem
ent", "new C().m();", []); |
| 3374 JUnitTestCase.assertNotNull(statement.expression); | 3374 JUnitTestCase.assertNotNull(statement.expression); |
| 3375 } | 3375 } |
| 3376 void test_parseNonLabeledStatement_false() { | 3376 void test_parseNonLabeledStatement_false() { |
| 3377 ExpressionStatement statement = ParserTestCase.parse4("parseNonLabeledStatem
ent", "false;", []); | 3377 ExpressionStatement statement = ParserTestCase.parse5("parseNonLabeledStatem
ent", "false;", []); |
| 3378 JUnitTestCase.assertNotNull(statement.expression); | 3378 JUnitTestCase.assertNotNull(statement.expression); |
| 3379 } | 3379 } |
| 3380 void test_parseNonLabeledStatement_functionDeclaration() { | 3380 void test_parseNonLabeledStatement_functionDeclaration() { |
| 3381 ParserTestCase.parse4("parseNonLabeledStatement", "f() {};", []); | 3381 ParserTestCase.parse5("parseNonLabeledStatement", "f() {};", []); |
| 3382 } | 3382 } |
| 3383 void test_parseNonLabeledStatement_functionDeclaration_arguments() { | 3383 void test_parseNonLabeledStatement_functionDeclaration_arguments() { |
| 3384 ParserTestCase.parse4("parseNonLabeledStatement", "f(void g()) {};", []); | 3384 ParserTestCase.parse5("parseNonLabeledStatement", "f(void g()) {};", []); |
| 3385 } | 3385 } |
| 3386 void test_parseNonLabeledStatement_functionExpressionIndex() { | 3386 void test_parseNonLabeledStatement_functionExpressionIndex() { |
| 3387 ParserTestCase.parse4("parseNonLabeledStatement", "() {}[0] = null;", []); | 3387 ParserTestCase.parse5("parseNonLabeledStatement", "() {}[0] = null;", []); |
| 3388 } | 3388 } |
| 3389 void test_parseNonLabeledStatement_functionInvocation() { | 3389 void test_parseNonLabeledStatement_functionInvocation() { |
| 3390 ExpressionStatement statement = ParserTestCase.parse4("parseNonLabeledStatem
ent", "f();", []); | 3390 ExpressionStatement statement = ParserTestCase.parse5("parseNonLabeledStatem
ent", "f();", []); |
| 3391 JUnitTestCase.assertNotNull(statement.expression); | 3391 JUnitTestCase.assertNotNull(statement.expression); |
| 3392 } | 3392 } |
| 3393 void test_parseNonLabeledStatement_invokeFunctionExpression() { | 3393 void test_parseNonLabeledStatement_invokeFunctionExpression() { |
| 3394 ExpressionStatement statement = ParserTestCase.parse4("parseNonLabeledStatem
ent", "(a) {return a + a;} (3);", []); | 3394 ExpressionStatement statement = ParserTestCase.parse5("parseNonLabeledStatem
ent", "(a) {return a + a;} (3);", []); |
| 3395 EngineTestCase.assertInstanceOf(FunctionExpressionInvocation, statement.expr
ession); | 3395 EngineTestCase.assertInstanceOf(FunctionExpressionInvocation, statement.expr
ession); |
| 3396 FunctionExpressionInvocation invocation = statement.expression as FunctionEx
pressionInvocation; | 3396 FunctionExpressionInvocation invocation = (statement.expression as FunctionE
xpressionInvocation); |
| 3397 EngineTestCase.assertInstanceOf(FunctionExpression, invocation.function); | 3397 EngineTestCase.assertInstanceOf(FunctionExpression, invocation.function); |
| 3398 FunctionExpression expression = invocation.function as FunctionExpression; | 3398 FunctionExpression expression = (invocation.function as FunctionExpression); |
| 3399 JUnitTestCase.assertNotNull(expression.parameters); | 3399 JUnitTestCase.assertNotNull(expression.parameters); |
| 3400 JUnitTestCase.assertNotNull(expression.body); | 3400 JUnitTestCase.assertNotNull(expression.body); |
| 3401 ArgumentList list = invocation.argumentList; | 3401 ArgumentList list = invocation.argumentList; |
| 3402 JUnitTestCase.assertNotNull(list); | 3402 JUnitTestCase.assertNotNull(list); |
| 3403 EngineTestCase.assertSize(1, list.arguments); | 3403 EngineTestCase.assertSize(1, list.arguments); |
| 3404 } | 3404 } |
| 3405 void test_parseNonLabeledStatement_null() { | 3405 void test_parseNonLabeledStatement_null() { |
| 3406 ExpressionStatement statement = ParserTestCase.parse4("parseNonLabeledStatem
ent", "null;", []); | 3406 ExpressionStatement statement = ParserTestCase.parse5("parseNonLabeledStatem
ent", "null;", []); |
| 3407 JUnitTestCase.assertNotNull(statement.expression); | 3407 JUnitTestCase.assertNotNull(statement.expression); |
| 3408 } | 3408 } |
| 3409 void test_parseNonLabeledStatement_startingWithBuiltInIdentifier() { | 3409 void test_parseNonLabeledStatement_startingWithBuiltInIdentifier() { |
| 3410 ExpressionStatement statement = ParserTestCase.parse4("parseNonLabeledStatem
ent", "library.getName();", []); | 3410 ExpressionStatement statement = ParserTestCase.parse5("parseNonLabeledStatem
ent", "library.getName();", []); |
| 3411 JUnitTestCase.assertNotNull(statement.expression); | 3411 JUnitTestCase.assertNotNull(statement.expression); |
| 3412 } | 3412 } |
| 3413 void test_parseNonLabeledStatement_true() { | 3413 void test_parseNonLabeledStatement_true() { |
| 3414 ExpressionStatement statement = ParserTestCase.parse4("parseNonLabeledStatem
ent", "true;", []); | 3414 ExpressionStatement statement = ParserTestCase.parse5("parseNonLabeledStatem
ent", "true;", []); |
| 3415 JUnitTestCase.assertNotNull(statement.expression); | 3415 JUnitTestCase.assertNotNull(statement.expression); |
| 3416 } | 3416 } |
| 3417 void test_parseNonLabeledStatement_typeCast() { | 3417 void test_parseNonLabeledStatement_typeCast() { |
| 3418 ExpressionStatement statement = ParserTestCase.parse4("parseNonLabeledStatem
ent", "double.NAN as num;", []); | 3418 ExpressionStatement statement = ParserTestCase.parse5("parseNonLabeledStatem
ent", "double.NAN as num;", []); |
| 3419 JUnitTestCase.assertNotNull(statement.expression); | 3419 JUnitTestCase.assertNotNull(statement.expression); |
| 3420 } | 3420 } |
| 3421 void test_parseNormalFormalParameter_field_const_noType() { | 3421 void test_parseNormalFormalParameter_field_const_noType() { |
| 3422 FieldFormalParameter parameter = ParserTestCase.parse4("parseNormalFormalPar
ameter", "const this.a)", []); | 3422 FieldFormalParameter parameter = ParserTestCase.parse5("parseNormalFormalPar
ameter", "const this.a)", []); |
| 3423 JUnitTestCase.assertNotNull(parameter.keyword); | 3423 JUnitTestCase.assertNotNull(parameter.keyword); |
| 3424 JUnitTestCase.assertNull(parameter.type); | 3424 JUnitTestCase.assertNull(parameter.type); |
| 3425 JUnitTestCase.assertNotNull(parameter.identifier); | 3425 JUnitTestCase.assertNotNull(parameter.identifier); |
| 3426 } | 3426 } |
| 3427 void test_parseNormalFormalParameter_field_const_type() { | 3427 void test_parseNormalFormalParameter_field_const_type() { |
| 3428 FieldFormalParameter parameter = ParserTestCase.parse4("parseNormalFormalPar
ameter", "const A this.a)", []); | 3428 FieldFormalParameter parameter = ParserTestCase.parse5("parseNormalFormalPar
ameter", "const A this.a)", []); |
| 3429 JUnitTestCase.assertNotNull(parameter.keyword); | 3429 JUnitTestCase.assertNotNull(parameter.keyword); |
| 3430 JUnitTestCase.assertNotNull(parameter.type); | 3430 JUnitTestCase.assertNotNull(parameter.type); |
| 3431 JUnitTestCase.assertNotNull(parameter.identifier); | 3431 JUnitTestCase.assertNotNull(parameter.identifier); |
| 3432 } | 3432 } |
| 3433 void test_parseNormalFormalParameter_field_final_noType() { | 3433 void test_parseNormalFormalParameter_field_final_noType() { |
| 3434 FieldFormalParameter parameter = ParserTestCase.parse4("parseNormalFormalPar
ameter", "final this.a)", []); | 3434 FieldFormalParameter parameter = ParserTestCase.parse5("parseNormalFormalPar
ameter", "final this.a)", []); |
| 3435 JUnitTestCase.assertNotNull(parameter.keyword); | 3435 JUnitTestCase.assertNotNull(parameter.keyword); |
| 3436 JUnitTestCase.assertNull(parameter.type); | 3436 JUnitTestCase.assertNull(parameter.type); |
| 3437 JUnitTestCase.assertNotNull(parameter.identifier); | 3437 JUnitTestCase.assertNotNull(parameter.identifier); |
| 3438 } | 3438 } |
| 3439 void test_parseNormalFormalParameter_field_final_type() { | 3439 void test_parseNormalFormalParameter_field_final_type() { |
| 3440 FieldFormalParameter parameter = ParserTestCase.parse4("parseNormalFormalPar
ameter", "final A this.a)", []); | 3440 FieldFormalParameter parameter = ParserTestCase.parse5("parseNormalFormalPar
ameter", "final A this.a)", []); |
| 3441 JUnitTestCase.assertNotNull(parameter.keyword); | 3441 JUnitTestCase.assertNotNull(parameter.keyword); |
| 3442 JUnitTestCase.assertNotNull(parameter.type); | 3442 JUnitTestCase.assertNotNull(parameter.type); |
| 3443 JUnitTestCase.assertNotNull(parameter.identifier); | 3443 JUnitTestCase.assertNotNull(parameter.identifier); |
| 3444 } | 3444 } |
| 3445 void test_parseNormalFormalParameter_field_noType() { | 3445 void test_parseNormalFormalParameter_field_noType() { |
| 3446 FieldFormalParameter parameter = ParserTestCase.parse4("parseNormalFormalPar
ameter", "this.a)", []); | 3446 FieldFormalParameter parameter = ParserTestCase.parse5("parseNormalFormalPar
ameter", "this.a)", []); |
| 3447 JUnitTestCase.assertNull(parameter.keyword); | 3447 JUnitTestCase.assertNull(parameter.keyword); |
| 3448 JUnitTestCase.assertNull(parameter.type); | 3448 JUnitTestCase.assertNull(parameter.type); |
| 3449 JUnitTestCase.assertNotNull(parameter.identifier); | 3449 JUnitTestCase.assertNotNull(parameter.identifier); |
| 3450 } | 3450 } |
| 3451 void test_parseNormalFormalParameter_field_type() { | 3451 void test_parseNormalFormalParameter_field_type() { |
| 3452 FieldFormalParameter parameter = ParserTestCase.parse4("parseNormalFormalPar
ameter", "A this.a)", []); | 3452 FieldFormalParameter parameter = ParserTestCase.parse5("parseNormalFormalPar
ameter", "A this.a)", []); |
| 3453 JUnitTestCase.assertNull(parameter.keyword); | 3453 JUnitTestCase.assertNull(parameter.keyword); |
| 3454 JUnitTestCase.assertNotNull(parameter.type); | 3454 JUnitTestCase.assertNotNull(parameter.type); |
| 3455 JUnitTestCase.assertNotNull(parameter.identifier); | 3455 JUnitTestCase.assertNotNull(parameter.identifier); |
| 3456 } | 3456 } |
| 3457 void test_parseNormalFormalParameter_field_var() { | 3457 void test_parseNormalFormalParameter_field_var() { |
| 3458 FieldFormalParameter parameter = ParserTestCase.parse4("parseNormalFormalPar
ameter", "var this.a)", []); | 3458 FieldFormalParameter parameter = ParserTestCase.parse5("parseNormalFormalPar
ameter", "var this.a)", []); |
| 3459 JUnitTestCase.assertNotNull(parameter.keyword); | 3459 JUnitTestCase.assertNotNull(parameter.keyword); |
| 3460 JUnitTestCase.assertNull(parameter.type); | 3460 JUnitTestCase.assertNull(parameter.type); |
| 3461 JUnitTestCase.assertNotNull(parameter.identifier); | 3461 JUnitTestCase.assertNotNull(parameter.identifier); |
| 3462 } | 3462 } |
| 3463 void test_parseNormalFormalParameter_function_noType() { | 3463 void test_parseNormalFormalParameter_function_noType() { |
| 3464 FunctionTypedFormalParameter parameter = ParserTestCase.parse4("parseNormalF
ormalParameter", "a())", []); | 3464 FunctionTypedFormalParameter parameter = ParserTestCase.parse5("parseNormalF
ormalParameter", "a())", []); |
| 3465 JUnitTestCase.assertNull(parameter.returnType); | 3465 JUnitTestCase.assertNull(parameter.returnType); |
| 3466 JUnitTestCase.assertNotNull(parameter.identifier); | 3466 JUnitTestCase.assertNotNull(parameter.identifier); |
| 3467 JUnitTestCase.assertNotNull(parameter.parameters); | 3467 JUnitTestCase.assertNotNull(parameter.parameters); |
| 3468 } | 3468 } |
| 3469 void test_parseNormalFormalParameter_function_type() { | 3469 void test_parseNormalFormalParameter_function_type() { |
| 3470 FunctionTypedFormalParameter parameter = ParserTestCase.parse4("parseNormalF
ormalParameter", "A a())", []); | 3470 FunctionTypedFormalParameter parameter = ParserTestCase.parse5("parseNormalF
ormalParameter", "A a())", []); |
| 3471 JUnitTestCase.assertNotNull(parameter.returnType); | 3471 JUnitTestCase.assertNotNull(parameter.returnType); |
| 3472 JUnitTestCase.assertNotNull(parameter.identifier); | 3472 JUnitTestCase.assertNotNull(parameter.identifier); |
| 3473 JUnitTestCase.assertNotNull(parameter.parameters); | 3473 JUnitTestCase.assertNotNull(parameter.parameters); |
| 3474 } | 3474 } |
| 3475 void test_parseNormalFormalParameter_function_void() { | 3475 void test_parseNormalFormalParameter_function_void() { |
| 3476 FunctionTypedFormalParameter parameter = ParserTestCase.parse4("parseNormalF
ormalParameter", "void a())", []); | 3476 FunctionTypedFormalParameter parameter = ParserTestCase.parse5("parseNormalF
ormalParameter", "void a())", []); |
| 3477 JUnitTestCase.assertNotNull(parameter.returnType); | 3477 JUnitTestCase.assertNotNull(parameter.returnType); |
| 3478 JUnitTestCase.assertNotNull(parameter.identifier); | 3478 JUnitTestCase.assertNotNull(parameter.identifier); |
| 3479 JUnitTestCase.assertNotNull(parameter.parameters); | 3479 JUnitTestCase.assertNotNull(parameter.parameters); |
| 3480 } | 3480 } |
| 3481 void test_parseNormalFormalParameter_simple_const_noType() { | 3481 void test_parseNormalFormalParameter_simple_const_noType() { |
| 3482 SimpleFormalParameter parameter = ParserTestCase.parse4("parseNormalFormalPa
rameter", "const a)", []); | 3482 SimpleFormalParameter parameter = ParserTestCase.parse5("parseNormalFormalPa
rameter", "const a)", []); |
| 3483 JUnitTestCase.assertNotNull(parameter.keyword); | 3483 JUnitTestCase.assertNotNull(parameter.keyword); |
| 3484 JUnitTestCase.assertNull(parameter.type); | 3484 JUnitTestCase.assertNull(parameter.type); |
| 3485 JUnitTestCase.assertNotNull(parameter.identifier); | 3485 JUnitTestCase.assertNotNull(parameter.identifier); |
| 3486 } | 3486 } |
| 3487 void test_parseNormalFormalParameter_simple_const_type() { | 3487 void test_parseNormalFormalParameter_simple_const_type() { |
| 3488 SimpleFormalParameter parameter = ParserTestCase.parse4("parseNormalFormalPa
rameter", "const A a)", []); | 3488 SimpleFormalParameter parameter = ParserTestCase.parse5("parseNormalFormalPa
rameter", "const A a)", []); |
| 3489 JUnitTestCase.assertNotNull(parameter.keyword); | 3489 JUnitTestCase.assertNotNull(parameter.keyword); |
| 3490 JUnitTestCase.assertNotNull(parameter.type); | 3490 JUnitTestCase.assertNotNull(parameter.type); |
| 3491 JUnitTestCase.assertNotNull(parameter.identifier); | 3491 JUnitTestCase.assertNotNull(parameter.identifier); |
| 3492 } | 3492 } |
| 3493 void test_parseNormalFormalParameter_simple_final_noType() { | 3493 void test_parseNormalFormalParameter_simple_final_noType() { |
| 3494 SimpleFormalParameter parameter = ParserTestCase.parse4("parseNormalFormalPa
rameter", "final a)", []); | 3494 SimpleFormalParameter parameter = ParserTestCase.parse5("parseNormalFormalPa
rameter", "final a)", []); |
| 3495 JUnitTestCase.assertNotNull(parameter.keyword); | 3495 JUnitTestCase.assertNotNull(parameter.keyword); |
| 3496 JUnitTestCase.assertNull(parameter.type); | 3496 JUnitTestCase.assertNull(parameter.type); |
| 3497 JUnitTestCase.assertNotNull(parameter.identifier); | 3497 JUnitTestCase.assertNotNull(parameter.identifier); |
| 3498 } | 3498 } |
| 3499 void test_parseNormalFormalParameter_simple_final_type() { | 3499 void test_parseNormalFormalParameter_simple_final_type() { |
| 3500 SimpleFormalParameter parameter = ParserTestCase.parse4("parseNormalFormalPa
rameter", "final A a)", []); | 3500 SimpleFormalParameter parameter = ParserTestCase.parse5("parseNormalFormalPa
rameter", "final A a)", []); |
| 3501 JUnitTestCase.assertNotNull(parameter.keyword); | 3501 JUnitTestCase.assertNotNull(parameter.keyword); |
| 3502 JUnitTestCase.assertNotNull(parameter.type); | 3502 JUnitTestCase.assertNotNull(parameter.type); |
| 3503 JUnitTestCase.assertNotNull(parameter.identifier); | 3503 JUnitTestCase.assertNotNull(parameter.identifier); |
| 3504 } | 3504 } |
| 3505 void test_parseNormalFormalParameter_simple_noType() { | 3505 void test_parseNormalFormalParameter_simple_noType() { |
| 3506 SimpleFormalParameter parameter = ParserTestCase.parse4("parseNormalFormalPa
rameter", "a)", []); | 3506 SimpleFormalParameter parameter = ParserTestCase.parse5("parseNormalFormalPa
rameter", "a)", []); |
| 3507 JUnitTestCase.assertNull(parameter.keyword); | 3507 JUnitTestCase.assertNull(parameter.keyword); |
| 3508 JUnitTestCase.assertNull(parameter.type); | 3508 JUnitTestCase.assertNull(parameter.type); |
| 3509 JUnitTestCase.assertNotNull(parameter.identifier); | 3509 JUnitTestCase.assertNotNull(parameter.identifier); |
| 3510 } | 3510 } |
| 3511 void test_parseNormalFormalParameter_simple_type() { | 3511 void test_parseNormalFormalParameter_simple_type() { |
| 3512 SimpleFormalParameter parameter = ParserTestCase.parse4("parseNormalFormalPa
rameter", "A a)", []); | 3512 SimpleFormalParameter parameter = ParserTestCase.parse5("parseNormalFormalPa
rameter", "A a)", []); |
| 3513 JUnitTestCase.assertNull(parameter.keyword); | 3513 JUnitTestCase.assertNull(parameter.keyword); |
| 3514 JUnitTestCase.assertNotNull(parameter.type); | 3514 JUnitTestCase.assertNotNull(parameter.type); |
| 3515 JUnitTestCase.assertNotNull(parameter.identifier); | 3515 JUnitTestCase.assertNotNull(parameter.identifier); |
| 3516 } | 3516 } |
| 3517 void test_parseOperator() { | 3517 void test_parseOperator() { |
| 3518 Comment comment = Comment.createDocumentationComment(new List<Token>.fixedLe
ngth(0)); | 3518 Comment comment = Comment.createDocumentationComment(new List<Token>.fixedLe
ngth(0)); |
| 3519 TypeName returnType = new TypeName(new SimpleIdentifier(null), null); | 3519 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);"); | 3520 MethodDeclaration method = ParserTestCase.parse("parseOperator", <Object> [c
ommentAndMetadata(comment, []), null, returnType], "operator +(A a);"); |
| 3521 JUnitTestCase.assertNotNull(method.body); | 3521 JUnitTestCase.assertNotNull(method.body); |
| 3522 JUnitTestCase.assertEquals(comment, method.documentationComment); | 3522 JUnitTestCase.assertEquals(comment, method.documentationComment); |
| 3523 JUnitTestCase.assertNull(method.externalKeyword); | 3523 JUnitTestCase.assertNull(method.externalKeyword); |
| 3524 JUnitTestCase.assertNull(method.modifierKeyword); | 3524 JUnitTestCase.assertNull(method.modifierKeyword); |
| 3525 JUnitTestCase.assertNotNull(method.name); | 3525 JUnitTestCase.assertNotNull(method.name); |
| 3526 JUnitTestCase.assertNotNull(method.operatorKeyword); | 3526 JUnitTestCase.assertNotNull(method.operatorKeyword); |
| 3527 JUnitTestCase.assertNotNull(method.parameters); | 3527 JUnitTestCase.assertNotNull(method.parameters); |
| 3528 JUnitTestCase.assertNull(method.propertyKeyword); | 3528 JUnitTestCase.assertNull(method.propertyKeyword); |
| 3529 JUnitTestCase.assertEquals(returnType, method.returnType); | 3529 JUnitTestCase.assertEquals(returnType, method.returnType); |
| 3530 } | 3530 } |
| 3531 void test_parseOptionalReturnType() { | 3531 void test_parseOptionalReturnType() { |
| 3532 } | 3532 } |
| 3533 void test_parsePartDirective_part() { | 3533 void test_parsePartDirective_part() { |
| 3534 PartDirective directive = ParserTestCase.parse("parsePartDirective", <Object
> [emptyCommentAndMetadata()], "part 'lib/lib.dart';"); | 3534 PartDirective directive = ParserTestCase.parse("parsePartDirective", <Object
> [emptyCommentAndMetadata()], "part 'lib/lib.dart';"); |
| 3535 JUnitTestCase.assertNotNull(directive.partToken); | 3535 JUnitTestCase.assertNotNull(directive.partToken); |
| 3536 JUnitTestCase.assertNotNull(directive.partUri); | 3536 JUnitTestCase.assertNotNull(directive.uri); |
| 3537 JUnitTestCase.assertNotNull(directive.semicolon); | 3537 JUnitTestCase.assertNotNull(directive.semicolon); |
| 3538 } | 3538 } |
| 3539 void test_parsePartDirective_partOf() { | 3539 void test_parsePartDirective_partOf() { |
| 3540 PartOfDirective directive = ParserTestCase.parse("parsePartDirective", <Obje
ct> [emptyCommentAndMetadata()], "part of l;"); | 3540 PartOfDirective directive = ParserTestCase.parse("parsePartDirective", <Obje
ct> [emptyCommentAndMetadata()], "part of l;"); |
| 3541 JUnitTestCase.assertNotNull(directive.partToken); | 3541 JUnitTestCase.assertNotNull(directive.partToken); |
| 3542 JUnitTestCase.assertNotNull(directive.ofToken); | 3542 JUnitTestCase.assertNotNull(directive.ofToken); |
| 3543 JUnitTestCase.assertNotNull(directive.libraryName); | 3543 JUnitTestCase.assertNotNull(directive.libraryName); |
| 3544 JUnitTestCase.assertNotNull(directive.semicolon); | 3544 JUnitTestCase.assertNotNull(directive.semicolon); |
| 3545 } | 3545 } |
| 3546 void test_parsePostfixExpression_decrement() { | 3546 void test_parsePostfixExpression_decrement() { |
| 3547 PostfixExpression expression = ParserTestCase.parse4("parsePostfixExpression
", "i--", []); | 3547 PostfixExpression expression = ParserTestCase.parse5("parsePostfixExpression
", "i--", []); |
| 3548 JUnitTestCase.assertNotNull(expression.operand); | 3548 JUnitTestCase.assertNotNull(expression.operand); |
| 3549 JUnitTestCase.assertNotNull(expression.operator); | 3549 JUnitTestCase.assertNotNull(expression.operator); |
| 3550 JUnitTestCase.assertEquals(TokenType.MINUS_MINUS, expression.operator.type); | 3550 JUnitTestCase.assertEquals(TokenType.MINUS_MINUS, expression.operator.type); |
| 3551 } | 3551 } |
| 3552 void test_parsePostfixExpression_increment() { | 3552 void test_parsePostfixExpression_increment() { |
| 3553 PostfixExpression expression = ParserTestCase.parse4("parsePostfixExpression
", "i++", []); | 3553 PostfixExpression expression = ParserTestCase.parse5("parsePostfixExpression
", "i++", []); |
| 3554 JUnitTestCase.assertNotNull(expression.operand); | 3554 JUnitTestCase.assertNotNull(expression.operand); |
| 3555 JUnitTestCase.assertNotNull(expression.operator); | 3555 JUnitTestCase.assertNotNull(expression.operator); |
| 3556 JUnitTestCase.assertEquals(TokenType.PLUS_PLUS, expression.operator.type); | 3556 JUnitTestCase.assertEquals(TokenType.PLUS_PLUS, expression.operator.type); |
| 3557 } | 3557 } |
| 3558 void test_parsePostfixExpression_none_indexExpression() { | 3558 void test_parsePostfixExpression_none_indexExpression() { |
| 3559 IndexExpression expression = ParserTestCase.parse4("parsePostfixExpression",
"a[0]", []); | 3559 IndexExpression expression = ParserTestCase.parse5("parsePostfixExpression",
"a[0]", []); |
| 3560 JUnitTestCase.assertNotNull(expression.array); | 3560 JUnitTestCase.assertNotNull(expression.array); |
| 3561 JUnitTestCase.assertNotNull(expression.index); | 3561 JUnitTestCase.assertNotNull(expression.index); |
| 3562 } | 3562 } |
| 3563 void test_parsePostfixExpression_none_methodInvocation() { | 3563 void test_parsePostfixExpression_none_methodInvocation() { |
| 3564 MethodInvocation expression = ParserTestCase.parse4("parsePostfixExpression"
, "a.m()", []); | 3564 MethodInvocation expression = ParserTestCase.parse5("parsePostfixExpression"
, "a.m()", []); |
| 3565 JUnitTestCase.assertNotNull(expression.target); | 3565 JUnitTestCase.assertNotNull(expression.target); |
| 3566 JUnitTestCase.assertNotNull(expression.methodName); | 3566 JUnitTestCase.assertNotNull(expression.methodName); |
| 3567 JUnitTestCase.assertNotNull(expression.argumentList); | 3567 JUnitTestCase.assertNotNull(expression.argumentList); |
| 3568 } | 3568 } |
| 3569 void test_parsePostfixExpression_none_propertyAccess() { | 3569 void test_parsePostfixExpression_none_propertyAccess() { |
| 3570 PrefixedIdentifier expression = ParserTestCase.parse4("parsePostfixExpressio
n", "a.b", []); | 3570 PrefixedIdentifier expression = ParserTestCase.parse5("parsePostfixExpressio
n", "a.b", []); |
| 3571 JUnitTestCase.assertNotNull(expression.prefix); | 3571 JUnitTestCase.assertNotNull(expression.prefix); |
| 3572 JUnitTestCase.assertNotNull(expression.identifier); | 3572 JUnitTestCase.assertNotNull(expression.identifier); |
| 3573 } | 3573 } |
| 3574 void test_parsePrefixedIdentifier_noPrefix() { | 3574 void test_parsePrefixedIdentifier_noPrefix() { |
| 3575 String lexeme = "bar"; | 3575 String lexeme = "bar"; |
| 3576 SimpleIdentifier identifier = ParserTestCase.parse4("parsePrefixedIdentifier
", lexeme, []); | 3576 SimpleIdentifier identifier = ParserTestCase.parse5("parsePrefixedIdentifier
", lexeme, []); |
| 3577 JUnitTestCase.assertNotNull(identifier.token); | 3577 JUnitTestCase.assertNotNull(identifier.token); |
| 3578 JUnitTestCase.assertEquals(lexeme, identifier.name); | 3578 JUnitTestCase.assertEquals(lexeme, identifier.name); |
| 3579 } | 3579 } |
| 3580 void test_parsePrefixedIdentifier_prefix() { | 3580 void test_parsePrefixedIdentifier_prefix() { |
| 3581 String lexeme = "foo.bar"; | 3581 String lexeme = "foo.bar"; |
| 3582 PrefixedIdentifier identifier = ParserTestCase.parse4("parsePrefixedIdentifi
er", lexeme, []); | 3582 PrefixedIdentifier identifier = ParserTestCase.parse5("parsePrefixedIdentifi
er", lexeme, []); |
| 3583 JUnitTestCase.assertEquals("foo", identifier.prefix.name); | 3583 JUnitTestCase.assertEquals("foo", identifier.prefix.name); |
| 3584 JUnitTestCase.assertNotNull(identifier.period); | 3584 JUnitTestCase.assertNotNull(identifier.period); |
| 3585 JUnitTestCase.assertEquals("bar", identifier.identifier.name); | 3585 JUnitTestCase.assertEquals("bar", identifier.identifier.name); |
| 3586 } | 3586 } |
| 3587 void test_parsePrimaryExpression_argumentDefinitionTest() { | 3587 void test_parsePrimaryExpression_argumentDefinitionTest() { |
| 3588 ArgumentDefinitionTest expression = ParserTestCase.parse4("parseArgumentDefi
nitionTest", "?a", []); | 3588 ArgumentDefinitionTest expression = ParserTestCase.parse5("parseArgumentDefi
nitionTest", "?a", []); |
| 3589 JUnitTestCase.assertNotNull(expression.question); | 3589 JUnitTestCase.assertNotNull(expression.question); |
| 3590 JUnitTestCase.assertNotNull(expression.identifier); | 3590 JUnitTestCase.assertNotNull(expression.identifier); |
| 3591 } | 3591 } |
| 3592 void test_parsePrimaryExpression_const() { | 3592 void test_parsePrimaryExpression_const() { |
| 3593 InstanceCreationExpression expression = ParserTestCase.parse4("parsePrimaryE
xpression", "const A()", []); | 3593 InstanceCreationExpression expression = ParserTestCase.parse5("parsePrimaryE
xpression", "const A()", []); |
| 3594 JUnitTestCase.assertNotNull(expression); | 3594 JUnitTestCase.assertNotNull(expression); |
| 3595 } | 3595 } |
| 3596 void test_parsePrimaryExpression_double() { | 3596 void test_parsePrimaryExpression_double() { |
| 3597 String doubleLiteral = "3.2e4"; | 3597 String doubleLiteral = "3.2e4"; |
| 3598 DoubleLiteral literal = ParserTestCase.parse4("parsePrimaryExpression", doub
leLiteral, []); | 3598 DoubleLiteral literal = ParserTestCase.parse5("parsePrimaryExpression", doub
leLiteral, []); |
| 3599 JUnitTestCase.assertNotNull(literal.literal); | 3599 JUnitTestCase.assertNotNull(literal.literal); |
| 3600 JUnitTestCase.assertEquals(double.parse(doubleLiteral), literal.value); | 3600 JUnitTestCase.assertEquals(double.parse(doubleLiteral), literal.value); |
| 3601 } | 3601 } |
| 3602 void test_parsePrimaryExpression_false() { | 3602 void test_parsePrimaryExpression_false() { |
| 3603 BooleanLiteral literal = ParserTestCase.parse4("parsePrimaryExpression", "fa
lse", []); | 3603 BooleanLiteral literal = ParserTestCase.parse5("parsePrimaryExpression", "fa
lse", []); |
| 3604 JUnitTestCase.assertNotNull(literal.literal); | 3604 JUnitTestCase.assertNotNull(literal.literal); |
| 3605 JUnitTestCase.assertFalse(literal.value); | 3605 JUnitTestCase.assertFalse(literal.value); |
| 3606 } | 3606 } |
| 3607 void test_parsePrimaryExpression_function_arguments() { | 3607 void test_parsePrimaryExpression_function_arguments() { |
| 3608 FunctionExpression expression = ParserTestCase.parse4("parsePrimaryExpressio
n", "(int i) => i + 1", []); | 3608 FunctionExpression expression = ParserTestCase.parse5("parsePrimaryExpressio
n", "(int i) => i + 1", []); |
| 3609 JUnitTestCase.assertNotNull(expression.parameters); | 3609 JUnitTestCase.assertNotNull(expression.parameters); |
| 3610 JUnitTestCase.assertNotNull(expression.body); | 3610 JUnitTestCase.assertNotNull(expression.body); |
| 3611 } | 3611 } |
| 3612 void test_parsePrimaryExpression_function_noArguments() { | 3612 void test_parsePrimaryExpression_function_noArguments() { |
| 3613 FunctionExpression expression = ParserTestCase.parse4("parsePrimaryExpressio
n", "() => 42", []); | 3613 FunctionExpression expression = ParserTestCase.parse5("parsePrimaryExpressio
n", "() => 42", []); |
| 3614 JUnitTestCase.assertNotNull(expression.parameters); | 3614 JUnitTestCase.assertNotNull(expression.parameters); |
| 3615 JUnitTestCase.assertNotNull(expression.body); | 3615 JUnitTestCase.assertNotNull(expression.body); |
| 3616 } | 3616 } |
| 3617 void test_parsePrimaryExpression_hex() { | 3617 void test_parsePrimaryExpression_hex() { |
| 3618 String hexLiteral = "3F"; | 3618 String hexLiteral = "3F"; |
| 3619 IntegerLiteral literal = ParserTestCase.parse4("parsePrimaryExpression", "0x
${hexLiteral}", []); | 3619 IntegerLiteral literal = ParserTestCase.parse5("parsePrimaryExpression", "0x
${hexLiteral}", []); |
| 3620 JUnitTestCase.assertNotNull(literal.literal); | 3620 JUnitTestCase.assertNotNull(literal.literal); |
| 3621 JUnitTestCase.assertEquals(int.parse(hexLiteral, radix: 16), literal.value); | 3621 JUnitTestCase.assertEquals(int.parse(hexLiteral, radix: 16), literal.value); |
| 3622 } | 3622 } |
| 3623 void test_parsePrimaryExpression_identifier() { | 3623 void test_parsePrimaryExpression_identifier() { |
| 3624 SimpleIdentifier identifier = ParserTestCase.parse4("parsePrimaryExpression"
, "a", []); | 3624 SimpleIdentifier identifier = ParserTestCase.parse5("parsePrimaryExpression"
, "a", []); |
| 3625 JUnitTestCase.assertNotNull(identifier); | 3625 JUnitTestCase.assertNotNull(identifier); |
| 3626 } | 3626 } |
| 3627 void test_parsePrimaryExpression_int() { | 3627 void test_parsePrimaryExpression_int() { |
| 3628 String intLiteral = "472"; | 3628 String intLiteral = "472"; |
| 3629 IntegerLiteral literal = ParserTestCase.parse4("parsePrimaryExpression", int
Literal, []); | 3629 IntegerLiteral literal = ParserTestCase.parse5("parsePrimaryExpression", int
Literal, []); |
| 3630 JUnitTestCase.assertNotNull(literal.literal); | 3630 JUnitTestCase.assertNotNull(literal.literal); |
| 3631 JUnitTestCase.assertEquals(int.parse(intLiteral), literal.value); | 3631 JUnitTestCase.assertEquals(int.parse(intLiteral), literal.value); |
| 3632 } | 3632 } |
| 3633 void test_parsePrimaryExpression_listLiteral() { | 3633 void test_parsePrimaryExpression_listLiteral() { |
| 3634 ListLiteral literal = ParserTestCase.parse4("parsePrimaryExpression", "[ ]",
[]); | 3634 ListLiteral literal = ParserTestCase.parse5("parsePrimaryExpression", "[ ]",
[]); |
| 3635 JUnitTestCase.assertNotNull(literal); | 3635 JUnitTestCase.assertNotNull(literal); |
| 3636 } | 3636 } |
| 3637 void test_parsePrimaryExpression_listLiteral_index() { | 3637 void test_parsePrimaryExpression_listLiteral_index() { |
| 3638 ListLiteral literal = ParserTestCase.parse4("parsePrimaryExpression", "[]",
[]); | 3638 ListLiteral literal = ParserTestCase.parse5("parsePrimaryExpression", "[]",
[]); |
| 3639 JUnitTestCase.assertNotNull(literal); | 3639 JUnitTestCase.assertNotNull(literal); |
| 3640 } | 3640 } |
| 3641 void test_parsePrimaryExpression_listLiteral_typed() { | 3641 void test_parsePrimaryExpression_listLiteral_typed() { |
| 3642 ListLiteral literal = ParserTestCase.parse4("parsePrimaryExpression", "<A>[
]", []); | 3642 ListLiteral literal = ParserTestCase.parse5("parsePrimaryExpression", "<A>[
]", []); |
| 3643 JUnitTestCase.assertNotNull(literal.typeArguments); | 3643 JUnitTestCase.assertNotNull(literal.typeArguments); |
| 3644 EngineTestCase.assertSize(1, literal.typeArguments.arguments); | 3644 EngineTestCase.assertSize(1, literal.typeArguments.arguments); |
| 3645 } | 3645 } |
| 3646 void test_parsePrimaryExpression_mapLiteral() { | 3646 void test_parsePrimaryExpression_mapLiteral() { |
| 3647 MapLiteral literal = ParserTestCase.parse4("parsePrimaryExpression", "{}", [
]); | 3647 MapLiteral literal = ParserTestCase.parse5("parsePrimaryExpression", "{}", [
]); |
| 3648 JUnitTestCase.assertNotNull(literal); | 3648 JUnitTestCase.assertNotNull(literal); |
| 3649 } | 3649 } |
| 3650 void test_parsePrimaryExpression_mapLiteral_typed() { | 3650 void test_parsePrimaryExpression_mapLiteral_typed() { |
| 3651 MapLiteral literal = ParserTestCase.parse4("parsePrimaryExpression", "<A>{}"
, []); | 3651 MapLiteral literal = ParserTestCase.parse5("parsePrimaryExpression", "<A>{}"
, []); |
| 3652 JUnitTestCase.assertNotNull(literal.typeArguments); | 3652 JUnitTestCase.assertNotNull(literal.typeArguments); |
| 3653 EngineTestCase.assertSize(1, literal.typeArguments.arguments); | 3653 EngineTestCase.assertSize(1, literal.typeArguments.arguments); |
| 3654 } | 3654 } |
| 3655 void test_parsePrimaryExpression_new() { | 3655 void test_parsePrimaryExpression_new() { |
| 3656 InstanceCreationExpression expression = ParserTestCase.parse4("parsePrimaryE
xpression", "new A()", []); | 3656 InstanceCreationExpression expression = ParserTestCase.parse5("parsePrimaryE
xpression", "new A()", []); |
| 3657 JUnitTestCase.assertNotNull(expression); | 3657 JUnitTestCase.assertNotNull(expression); |
| 3658 } | 3658 } |
| 3659 void test_parsePrimaryExpression_null() { | 3659 void test_parsePrimaryExpression_null() { |
| 3660 NullLiteral literal = ParserTestCase.parse4("parsePrimaryExpression", "null"
, []); | 3660 NullLiteral literal = ParserTestCase.parse5("parsePrimaryExpression", "null"
, []); |
| 3661 JUnitTestCase.assertNotNull(literal.literal); | 3661 JUnitTestCase.assertNotNull(literal.literal); |
| 3662 } | 3662 } |
| 3663 void test_parsePrimaryExpression_parenthesized() { | 3663 void test_parsePrimaryExpression_parenthesized() { |
| 3664 ParenthesizedExpression expression = ParserTestCase.parse4("parsePrimaryExpr
ession", "()", []); | 3664 ParenthesizedExpression expression = ParserTestCase.parse5("parsePrimaryExpr
ession", "()", []); |
| 3665 JUnitTestCase.assertNotNull(expression); | 3665 JUnitTestCase.assertNotNull(expression); |
| 3666 } | 3666 } |
| 3667 void test_parsePrimaryExpression_string() { | 3667 void test_parsePrimaryExpression_string() { |
| 3668 SimpleStringLiteral literal = ParserTestCase.parse4("parsePrimaryExpression"
, "\"string\"", []); | 3668 SimpleStringLiteral literal = ParserTestCase.parse5("parsePrimaryExpression"
, "\"string\"", []); |
| 3669 JUnitTestCase.assertFalse(literal.isMultiline()); | 3669 JUnitTestCase.assertFalse(literal.isMultiline()); |
| 3670 JUnitTestCase.assertEquals("string", literal.value); | 3670 JUnitTestCase.assertEquals("string", literal.value); |
| 3671 } | 3671 } |
| 3672 void test_parsePrimaryExpression_super() { | 3672 void test_parsePrimaryExpression_super() { |
| 3673 PropertyAccess propertyAccess = ParserTestCase.parse4("parsePrimaryExpressio
n", "super.x", []); | 3673 PropertyAccess propertyAccess = ParserTestCase.parse5("parsePrimaryExpressio
n", "super.x", []); |
| 3674 JUnitTestCase.assertTrue(propertyAccess.target is SuperExpression); | 3674 JUnitTestCase.assertTrue(propertyAccess.target is SuperExpression); |
| 3675 JUnitTestCase.assertNotNull(propertyAccess.operator); | 3675 JUnitTestCase.assertNotNull(propertyAccess.operator); |
| 3676 JUnitTestCase.assertEquals(TokenType.PERIOD, propertyAccess.operator.type); | 3676 JUnitTestCase.assertEquals(TokenType.PERIOD, propertyAccess.operator.type); |
| 3677 JUnitTestCase.assertNotNull(propertyAccess.propertyName); | 3677 JUnitTestCase.assertNotNull(propertyAccess.propertyName); |
| 3678 } | 3678 } |
| 3679 void test_parsePrimaryExpression_this() { | 3679 void test_parsePrimaryExpression_this() { |
| 3680 ThisExpression expression = ParserTestCase.parse4("parsePrimaryExpression",
"this", []); | 3680 ThisExpression expression = ParserTestCase.parse5("parsePrimaryExpression",
"this", []); |
| 3681 JUnitTestCase.assertNotNull(expression.keyword); | 3681 JUnitTestCase.assertNotNull(expression.keyword); |
| 3682 } | 3682 } |
| 3683 void test_parsePrimaryExpression_true() { | 3683 void test_parsePrimaryExpression_true() { |
| 3684 BooleanLiteral literal = ParserTestCase.parse4("parsePrimaryExpression", "tr
ue", []); | 3684 BooleanLiteral literal = ParserTestCase.parse5("parsePrimaryExpression", "tr
ue", []); |
| 3685 JUnitTestCase.assertNotNull(literal.literal); | 3685 JUnitTestCase.assertNotNull(literal.literal); |
| 3686 JUnitTestCase.assertTrue(literal.value); | 3686 JUnitTestCase.assertTrue(literal.value); |
| 3687 } | 3687 } |
| 3688 void test_Parser() { | 3688 void test_Parser() { |
| 3689 JUnitTestCase.assertNotNull(new Parser(null, null)); | 3689 JUnitTestCase.assertNotNull(new Parser(null, null)); |
| 3690 } | 3690 } |
| 3691 void test_parseRedirectingConstructorInvocation_named() { | 3691 void test_parseRedirectingConstructorInvocation_named() { |
| 3692 RedirectingConstructorInvocation invocation = ParserTestCase.parse4("parseRe
directingConstructorInvocation", "this.a()", []); | 3692 RedirectingConstructorInvocation invocation = ParserTestCase.parse5("parseRe
directingConstructorInvocation", "this.a()", []); |
| 3693 JUnitTestCase.assertNotNull(invocation.argumentList); | 3693 JUnitTestCase.assertNotNull(invocation.argumentList); |
| 3694 JUnitTestCase.assertNotNull(invocation.constructorName); | 3694 JUnitTestCase.assertNotNull(invocation.constructorName); |
| 3695 JUnitTestCase.assertNotNull(invocation.keyword); | 3695 JUnitTestCase.assertNotNull(invocation.keyword); |
| 3696 JUnitTestCase.assertNotNull(invocation.period); | 3696 JUnitTestCase.assertNotNull(invocation.period); |
| 3697 } | 3697 } |
| 3698 void test_parseRedirectingConstructorInvocation_unnamed() { | 3698 void test_parseRedirectingConstructorInvocation_unnamed() { |
| 3699 RedirectingConstructorInvocation invocation = ParserTestCase.parse4("parseRe
directingConstructorInvocation", "this()", []); | 3699 RedirectingConstructorInvocation invocation = ParserTestCase.parse5("parseRe
directingConstructorInvocation", "this()", []); |
| 3700 JUnitTestCase.assertNotNull(invocation.argumentList); | 3700 JUnitTestCase.assertNotNull(invocation.argumentList); |
| 3701 JUnitTestCase.assertNull(invocation.constructorName); | 3701 JUnitTestCase.assertNull(invocation.constructorName); |
| 3702 JUnitTestCase.assertNotNull(invocation.keyword); | 3702 JUnitTestCase.assertNotNull(invocation.keyword); |
| 3703 JUnitTestCase.assertNull(invocation.period); | 3703 JUnitTestCase.assertNull(invocation.period); |
| 3704 } | 3704 } |
| 3705 void test_parseRelationalExpression_as() { | 3705 void test_parseRelationalExpression_as() { |
| 3706 AsExpression expression = ParserTestCase.parse4("parseRelationalExpression",
"x as Y", []); | 3706 AsExpression expression = ParserTestCase.parse5("parseRelationalExpression",
"x as Y", []); |
| 3707 JUnitTestCase.assertNotNull(expression.expression); | 3707 JUnitTestCase.assertNotNull(expression.expression); |
| 3708 JUnitTestCase.assertNotNull(expression.asOperator); | 3708 JUnitTestCase.assertNotNull(expression.asOperator); |
| 3709 JUnitTestCase.assertNotNull(expression.type); | 3709 JUnitTestCase.assertNotNull(expression.type); |
| 3710 } | 3710 } |
| 3711 void test_parseRelationalExpression_is() { | 3711 void test_parseRelationalExpression_is() { |
| 3712 IsExpression expression = ParserTestCase.parse4("parseRelationalExpression",
"x is y", []); | 3712 IsExpression expression = ParserTestCase.parse5("parseRelationalExpression",
"x is y", []); |
| 3713 JUnitTestCase.assertNotNull(expression.expression); | 3713 JUnitTestCase.assertNotNull(expression.expression); |
| 3714 JUnitTestCase.assertNotNull(expression.isOperator); | 3714 JUnitTestCase.assertNotNull(expression.isOperator); |
| 3715 JUnitTestCase.assertNull(expression.notOperator); | 3715 JUnitTestCase.assertNull(expression.notOperator); |
| 3716 JUnitTestCase.assertNotNull(expression.type); | 3716 JUnitTestCase.assertNotNull(expression.type); |
| 3717 } | 3717 } |
| 3718 void test_parseRelationalExpression_isNot() { | 3718 void test_parseRelationalExpression_isNot() { |
| 3719 IsExpression expression = ParserTestCase.parse4("parseRelationalExpression",
"x is! y", []); | 3719 IsExpression expression = ParserTestCase.parse5("parseRelationalExpression",
"x is! y", []); |
| 3720 JUnitTestCase.assertNotNull(expression.expression); | 3720 JUnitTestCase.assertNotNull(expression.expression); |
| 3721 JUnitTestCase.assertNotNull(expression.isOperator); | 3721 JUnitTestCase.assertNotNull(expression.isOperator); |
| 3722 JUnitTestCase.assertNotNull(expression.notOperator); | 3722 JUnitTestCase.assertNotNull(expression.notOperator); |
| 3723 JUnitTestCase.assertNotNull(expression.type); | 3723 JUnitTestCase.assertNotNull(expression.type); |
| 3724 } | 3724 } |
| 3725 void test_parseRelationalExpression_normal() { | 3725 void test_parseRelationalExpression_normal() { |
| 3726 BinaryExpression expression = ParserTestCase.parse4("parseRelationalExpressi
on", "x < y", []); | 3726 BinaryExpression expression = ParserTestCase.parse5("parseRelationalExpressi
on", "x < y", []); |
| 3727 JUnitTestCase.assertNotNull(expression.leftOperand); | 3727 JUnitTestCase.assertNotNull(expression.leftOperand); |
| 3728 JUnitTestCase.assertNotNull(expression.operator); | 3728 JUnitTestCase.assertNotNull(expression.operator); |
| 3729 JUnitTestCase.assertEquals(TokenType.LT, expression.operator.type); | 3729 JUnitTestCase.assertEquals(TokenType.LT, expression.operator.type); |
| 3730 JUnitTestCase.assertNotNull(expression.rightOperand); | 3730 JUnitTestCase.assertNotNull(expression.rightOperand); |
| 3731 } | 3731 } |
| 3732 void test_parseRelationalExpression_super() { | 3732 void test_parseRelationalExpression_super() { |
| 3733 BinaryExpression expression = ParserTestCase.parse4("parseRelationalExpressi
on", "super < y", []); | 3733 BinaryExpression expression = ParserTestCase.parse5("parseRelationalExpressi
on", "super < y", []); |
| 3734 JUnitTestCase.assertNotNull(expression.leftOperand); | 3734 JUnitTestCase.assertNotNull(expression.leftOperand); |
| 3735 JUnitTestCase.assertNotNull(expression.operator); | 3735 JUnitTestCase.assertNotNull(expression.operator); |
| 3736 JUnitTestCase.assertEquals(TokenType.LT, expression.operator.type); | 3736 JUnitTestCase.assertEquals(TokenType.LT, expression.operator.type); |
| 3737 JUnitTestCase.assertNotNull(expression.rightOperand); | 3737 JUnitTestCase.assertNotNull(expression.rightOperand); |
| 3738 } | 3738 } |
| 3739 void test_parseReturnStatement_noValue() { | 3739 void test_parseReturnStatement_noValue() { |
| 3740 ReturnStatement statement = ParserTestCase.parse4("parseReturnStatement", "r
eturn;", []); | 3740 ReturnStatement statement = ParserTestCase.parse5("parseReturnStatement", "r
eturn;", []); |
| 3741 JUnitTestCase.assertNotNull(statement.keyword); | 3741 JUnitTestCase.assertNotNull(statement.keyword); |
| 3742 JUnitTestCase.assertNull(statement.expression); | 3742 JUnitTestCase.assertNull(statement.expression); |
| 3743 JUnitTestCase.assertNotNull(statement.semicolon); | 3743 JUnitTestCase.assertNotNull(statement.semicolon); |
| 3744 } | 3744 } |
| 3745 void test_parseReturnStatement_value() { | 3745 void test_parseReturnStatement_value() { |
| 3746 ReturnStatement statement = ParserTestCase.parse4("parseReturnStatement", "r
eturn x;", []); | 3746 ReturnStatement statement = ParserTestCase.parse5("parseReturnStatement", "r
eturn x;", []); |
| 3747 JUnitTestCase.assertNotNull(statement.keyword); | 3747 JUnitTestCase.assertNotNull(statement.keyword); |
| 3748 JUnitTestCase.assertNotNull(statement.expression); | 3748 JUnitTestCase.assertNotNull(statement.expression); |
| 3749 JUnitTestCase.assertNotNull(statement.semicolon); | 3749 JUnitTestCase.assertNotNull(statement.semicolon); |
| 3750 } | 3750 } |
| 3751 void test_parseReturnType_nonVoid() { | 3751 void test_parseReturnType_nonVoid() { |
| 3752 TypeName typeName = ParserTestCase.parse4("parseReturnType", "A<B>", []); | 3752 TypeName typeName = ParserTestCase.parse5("parseReturnType", "A<B>", []); |
| 3753 JUnitTestCase.assertNotNull(typeName.name); | 3753 JUnitTestCase.assertNotNull(typeName.name); |
| 3754 JUnitTestCase.assertNotNull(typeName.typeArguments); | 3754 JUnitTestCase.assertNotNull(typeName.typeArguments); |
| 3755 } | 3755 } |
| 3756 void test_parseReturnType_void() { | 3756 void test_parseReturnType_void() { |
| 3757 TypeName typeName = ParserTestCase.parse4("parseReturnType", "void", []); | 3757 TypeName typeName = ParserTestCase.parse5("parseReturnType", "void", []); |
| 3758 JUnitTestCase.assertNotNull(typeName.name); | 3758 JUnitTestCase.assertNotNull(typeName.name); |
| 3759 JUnitTestCase.assertNull(typeName.typeArguments); | 3759 JUnitTestCase.assertNull(typeName.typeArguments); |
| 3760 } | 3760 } |
| 3761 void test_parseSetter_nonStatic() { | 3761 void test_parseSetter_nonStatic() { |
| 3762 Comment comment = Comment.createDocumentationComment(new List<Token>.fixedLe
ngth(0)); | 3762 Comment comment = Comment.createDocumentationComment(new List<Token>.fixedLe
ngth(0)); |
| 3763 TypeName returnType = new TypeName(new SimpleIdentifier(null), null); | 3763 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);"); | 3764 MethodDeclaration method = ParserTestCase.parse("parseSetter", <Object> [com
mentAndMetadata(comment, []), null, null, returnType], "set a(var x);"); |
| 3765 JUnitTestCase.assertNotNull(method.body); | 3765 JUnitTestCase.assertNotNull(method.body); |
| 3766 JUnitTestCase.assertEquals(comment, method.documentationComment); | 3766 JUnitTestCase.assertEquals(comment, method.documentationComment); |
| 3767 JUnitTestCase.assertNull(method.externalKeyword); | 3767 JUnitTestCase.assertNull(method.externalKeyword); |
| 3768 JUnitTestCase.assertNull(method.modifierKeyword); | 3768 JUnitTestCase.assertNull(method.modifierKeyword); |
| 3769 JUnitTestCase.assertNotNull(method.name); | 3769 JUnitTestCase.assertNotNull(method.name); |
| 3770 JUnitTestCase.assertNull(method.operatorKeyword); | 3770 JUnitTestCase.assertNull(method.operatorKeyword); |
| 3771 JUnitTestCase.assertNotNull(method.parameters); | 3771 JUnitTestCase.assertNotNull(method.parameters); |
| 3772 JUnitTestCase.assertNotNull(method.propertyKeyword); | 3772 JUnitTestCase.assertNotNull(method.propertyKeyword); |
| 3773 JUnitTestCase.assertEquals(returnType, method.returnType); | 3773 JUnitTestCase.assertEquals(returnType, method.returnType); |
| 3774 } | 3774 } |
| 3775 void test_parseSetter_static() { | 3775 void test_parseSetter_static() { |
| 3776 Comment comment = Comment.createDocumentationComment(new List<Token>.fixedLe
ngth(0)); | 3776 Comment comment = Comment.createDocumentationComment(new List<Token>.fixedLe
ngth(0)); |
| 3777 Token staticKeyword = TokenFactory.token(Keyword.STATIC); | 3777 Token staticKeyword = TokenFactory.token(Keyword.STATIC); |
| 3778 TypeName returnType = new TypeName(new SimpleIdentifier(null), null); | 3778 TypeName returnType = new TypeName.full(new SimpleIdentifier.full(null), nul
l); |
| 3779 MethodDeclaration method = ParserTestCase.parse("parseSetter", <Object> [com
mentAndMetadata(comment, []), null, staticKeyword, returnType], "set a(var x) {}
"); | 3779 MethodDeclaration method = ParserTestCase.parse("parseSetter", <Object> [com
mentAndMetadata(comment, []), null, staticKeyword, returnType], "set a(var x) {}
"); |
| 3780 JUnitTestCase.assertNotNull(method.body); | 3780 JUnitTestCase.assertNotNull(method.body); |
| 3781 JUnitTestCase.assertEquals(comment, method.documentationComment); | 3781 JUnitTestCase.assertEquals(comment, method.documentationComment); |
| 3782 JUnitTestCase.assertNull(method.externalKeyword); | 3782 JUnitTestCase.assertNull(method.externalKeyword); |
| 3783 JUnitTestCase.assertEquals(staticKeyword, method.modifierKeyword); | 3783 JUnitTestCase.assertEquals(staticKeyword, method.modifierKeyword); |
| 3784 JUnitTestCase.assertNotNull(method.name); | 3784 JUnitTestCase.assertNotNull(method.name); |
| 3785 JUnitTestCase.assertNull(method.operatorKeyword); | 3785 JUnitTestCase.assertNull(method.operatorKeyword); |
| 3786 JUnitTestCase.assertNotNull(method.parameters); | 3786 JUnitTestCase.assertNotNull(method.parameters); |
| 3787 JUnitTestCase.assertNotNull(method.propertyKeyword); | 3787 JUnitTestCase.assertNotNull(method.propertyKeyword); |
| 3788 JUnitTestCase.assertEquals(returnType, method.returnType); | 3788 JUnitTestCase.assertEquals(returnType, method.returnType); |
| 3789 } | 3789 } |
| 3790 void test_parseShiftExpression_normal() { | 3790 void test_parseShiftExpression_normal() { |
| 3791 BinaryExpression expression = ParserTestCase.parse4("parseShiftExpression",
"x << y", []); | 3791 BinaryExpression expression = ParserTestCase.parse5("parseShiftExpression",
"x << y", []); |
| 3792 JUnitTestCase.assertNotNull(expression.leftOperand); | 3792 JUnitTestCase.assertNotNull(expression.leftOperand); |
| 3793 JUnitTestCase.assertNotNull(expression.operator); | 3793 JUnitTestCase.assertNotNull(expression.operator); |
| 3794 JUnitTestCase.assertEquals(TokenType.LT_LT, expression.operator.type); | 3794 JUnitTestCase.assertEquals(TokenType.LT_LT, expression.operator.type); |
| 3795 JUnitTestCase.assertNotNull(expression.rightOperand); | 3795 JUnitTestCase.assertNotNull(expression.rightOperand); |
| 3796 } | 3796 } |
| 3797 void test_parseShiftExpression_super() { | 3797 void test_parseShiftExpression_super() { |
| 3798 BinaryExpression expression = ParserTestCase.parse4("parseShiftExpression",
"super << y", []); | 3798 BinaryExpression expression = ParserTestCase.parse5("parseShiftExpression",
"super << y", []); |
| 3799 JUnitTestCase.assertNotNull(expression.leftOperand); | 3799 JUnitTestCase.assertNotNull(expression.leftOperand); |
| 3800 JUnitTestCase.assertNotNull(expression.operator); | 3800 JUnitTestCase.assertNotNull(expression.operator); |
| 3801 JUnitTestCase.assertEquals(TokenType.LT_LT, expression.operator.type); | 3801 JUnitTestCase.assertEquals(TokenType.LT_LT, expression.operator.type); |
| 3802 JUnitTestCase.assertNotNull(expression.rightOperand); | 3802 JUnitTestCase.assertNotNull(expression.rightOperand); |
| 3803 } | 3803 } |
| 3804 void test_parseSimpleIdentifier_builtInIdentifier() { | 3804 void test_parseSimpleIdentifier_builtInIdentifier() { |
| 3805 String lexeme = "as"; | 3805 String lexeme = "as"; |
| 3806 SimpleIdentifier identifier = ParserTestCase.parse4("parseSimpleIdentifier",
lexeme, []); | 3806 SimpleIdentifier identifier = ParserTestCase.parse5("parseSimpleIdentifier",
lexeme, []); |
| 3807 JUnitTestCase.assertNotNull(identifier.token); | 3807 JUnitTestCase.assertNotNull(identifier.token); |
| 3808 JUnitTestCase.assertEquals(lexeme, identifier.name); | 3808 JUnitTestCase.assertEquals(lexeme, identifier.name); |
| 3809 } | 3809 } |
| 3810 void test_parseSimpleIdentifier_normalIdentifier() { | 3810 void test_parseSimpleIdentifier_normalIdentifier() { |
| 3811 String lexeme = "foo"; | 3811 String lexeme = "foo"; |
| 3812 SimpleIdentifier identifier = ParserTestCase.parse4("parseSimpleIdentifier",
lexeme, []); | 3812 SimpleIdentifier identifier = ParserTestCase.parse5("parseSimpleIdentifier",
lexeme, []); |
| 3813 JUnitTestCase.assertNotNull(identifier.token); | 3813 JUnitTestCase.assertNotNull(identifier.token); |
| 3814 JUnitTestCase.assertEquals(lexeme, identifier.name); | 3814 JUnitTestCase.assertEquals(lexeme, identifier.name); |
| 3815 } | 3815 } |
| 3816 void test_parseSimpleIdentifier1_normalIdentifier() { | 3816 void test_parseSimpleIdentifier1_normalIdentifier() { |
| 3817 } | 3817 } |
| 3818 void test_parseStatement_functionDeclaration() { | 3818 void test_parseStatement_functionDeclaration() { |
| 3819 FunctionDeclarationStatement statement = ParserTestCase.parse4("parseStateme
nt", "int f(a, b) {};", []); | 3819 FunctionDeclarationStatement statement = ParserTestCase.parse5("parseStateme
nt", "int f(a, b) {};", []); |
| 3820 JUnitTestCase.assertNotNull(statement.functionDeclaration); | 3820 JUnitTestCase.assertNotNull(statement.functionDeclaration); |
| 3821 } | 3821 } |
| 3822 void test_parseStatement_mulipleLabels() { | 3822 void test_parseStatement_mulipleLabels() { |
| 3823 LabeledStatement statement = ParserTestCase.parse4("parseStatement", "l: m:
return x;", []); | 3823 LabeledStatement statement = ParserTestCase.parse5("parseStatement", "l: m:
return x;", []); |
| 3824 EngineTestCase.assertSize(2, statement.labels); | 3824 EngineTestCase.assertSize(2, statement.labels); |
| 3825 JUnitTestCase.assertNotNull(statement.statement); | 3825 JUnitTestCase.assertNotNull(statement.statement); |
| 3826 } | 3826 } |
| 3827 void test_parseStatement_noLabels() { | 3827 void test_parseStatement_noLabels() { |
| 3828 ParserTestCase.parse4("parseStatement", "return x;", []); | 3828 ParserTestCase.parse5("parseStatement", "return x;", []); |
| 3829 } | 3829 } |
| 3830 void test_parseStatement_singleLabel() { | 3830 void test_parseStatement_singleLabel() { |
| 3831 LabeledStatement statement = ParserTestCase.parse4("parseStatement", "l: ret
urn x;", []); | 3831 LabeledStatement statement = ParserTestCase.parse5("parseStatement", "l: ret
urn x;", []); |
| 3832 EngineTestCase.assertSize(1, statement.labels); | 3832 EngineTestCase.assertSize(1, statement.labels); |
| 3833 JUnitTestCase.assertNotNull(statement.statement); | 3833 JUnitTestCase.assertNotNull(statement.statement); |
| 3834 } | 3834 } |
| 3835 void test_parseStatements_multiple() { | 3835 void test_parseStatements_multiple() { |
| 3836 List<Statement> statements = ParserTestCase.parseStatements("return; return;
", 2, []); | 3836 List<Statement> statements = ParserTestCase.parseStatements("return; return;
", 2, []); |
| 3837 EngineTestCase.assertSize(2, statements); | 3837 EngineTestCase.assertSize(2, statements); |
| 3838 } | 3838 } |
| 3839 void test_parseStatements_single() { | 3839 void test_parseStatements_single() { |
| 3840 List<Statement> statements = ParserTestCase.parseStatements("return;", 1, []
); | 3840 List<Statement> statements = ParserTestCase.parseStatements("return;", 1, []
); |
| 3841 EngineTestCase.assertSize(1, statements); | 3841 EngineTestCase.assertSize(1, statements); |
| 3842 } | 3842 } |
| 3843 void test_parseStringLiteral_adjacent() { | 3843 void test_parseStringLiteral_adjacent() { |
| 3844 AdjacentStrings literal = ParserTestCase.parse4("parseStringLiteral", "'a' '
b'", []); | 3844 AdjacentStrings literal = ParserTestCase.parse5("parseStringLiteral", "'a' '
b'", []); |
| 3845 NodeList<StringLiteral> strings2 = literal.strings; | 3845 NodeList<StringLiteral> strings2 = literal.strings; |
| 3846 EngineTestCase.assertSize(2, strings2); | 3846 EngineTestCase.assertSize(2, strings2); |
| 3847 StringLiteral firstString = strings2[0]; | 3847 StringLiteral firstString = strings2[0]; |
| 3848 StringLiteral secondString = strings2[1]; | 3848 StringLiteral secondString = strings2[1]; |
| 3849 JUnitTestCase.assertEquals("a", (firstString as SimpleStringLiteral).value); | 3849 JUnitTestCase.assertEquals("a", ((firstString as SimpleStringLiteral)).value
); |
| 3850 JUnitTestCase.assertEquals("b", (secondString as SimpleStringLiteral).value)
; | 3850 JUnitTestCase.assertEquals("b", ((secondString as SimpleStringLiteral)).valu
e); |
| 3851 } | 3851 } |
| 3852 void test_parseStringLiteral_interpolated() { | 3852 void test_parseStringLiteral_interpolated() { |
| 3853 StringInterpolation literal = ParserTestCase.parse4("parseStringLiteral", "'
a \${b} c \$this d'", []); | 3853 StringInterpolation literal = ParserTestCase.parse5("parseStringLiteral", "'
a \${b} c \$this d'", []); |
| 3854 NodeList<InterpolationElement> elements2 = literal.elements; | 3854 NodeList<InterpolationElement> elements2 = literal.elements; |
| 3855 EngineTestCase.assertSize(5, elements2); | 3855 EngineTestCase.assertSize(5, elements2); |
| 3856 JUnitTestCase.assertTrue(elements2[0] is InterpolationString); | 3856 JUnitTestCase.assertTrue(elements2[0] is InterpolationString); |
| 3857 JUnitTestCase.assertTrue(elements2[1] is InterpolationExpression); | 3857 JUnitTestCase.assertTrue(elements2[1] is InterpolationExpression); |
| 3858 JUnitTestCase.assertTrue(elements2[2] is InterpolationString); | 3858 JUnitTestCase.assertTrue(elements2[2] is InterpolationString); |
| 3859 JUnitTestCase.assertTrue(elements2[3] is InterpolationExpression); | 3859 JUnitTestCase.assertTrue(elements2[3] is InterpolationExpression); |
| 3860 JUnitTestCase.assertTrue(elements2[4] is InterpolationString); | 3860 JUnitTestCase.assertTrue(elements2[4] is InterpolationString); |
| 3861 } | 3861 } |
| 3862 void test_parseStringLiteral_single() { | 3862 void test_parseStringLiteral_single() { |
| 3863 SimpleStringLiteral literal = ParserTestCase.parse4("parseStringLiteral", "'
a'", []); | 3863 SimpleStringLiteral literal = ParserTestCase.parse5("parseStringLiteral", "'
a'", []); |
| 3864 JUnitTestCase.assertNotNull(literal.literal); | 3864 JUnitTestCase.assertNotNull(literal.literal); |
| 3865 JUnitTestCase.assertEquals("a", literal.value); | 3865 JUnitTestCase.assertEquals("a", literal.value); |
| 3866 } | 3866 } |
| 3867 void test_parseSuperConstructorInvocation_named() { | 3867 void test_parseSuperConstructorInvocation_named() { |
| 3868 SuperConstructorInvocation invocation = ParserTestCase.parse4("parseSuperCon
structorInvocation", "super.a()", []); | 3868 SuperConstructorInvocation invocation = ParserTestCase.parse5("parseSuperCon
structorInvocation", "super.a()", []); |
| 3869 JUnitTestCase.assertNotNull(invocation.argumentList); | 3869 JUnitTestCase.assertNotNull(invocation.argumentList); |
| 3870 JUnitTestCase.assertNotNull(invocation.constructorName); | 3870 JUnitTestCase.assertNotNull(invocation.constructorName); |
| 3871 JUnitTestCase.assertNotNull(invocation.keyword); | 3871 JUnitTestCase.assertNotNull(invocation.keyword); |
| 3872 JUnitTestCase.assertNotNull(invocation.period); | 3872 JUnitTestCase.assertNotNull(invocation.period); |
| 3873 } | 3873 } |
| 3874 void test_parseSuperConstructorInvocation_unnamed() { | 3874 void test_parseSuperConstructorInvocation_unnamed() { |
| 3875 SuperConstructorInvocation invocation = ParserTestCase.parse4("parseSuperCon
structorInvocation", "super()", []); | 3875 SuperConstructorInvocation invocation = ParserTestCase.parse5("parseSuperCon
structorInvocation", "super()", []); |
| 3876 JUnitTestCase.assertNotNull(invocation.argumentList); | 3876 JUnitTestCase.assertNotNull(invocation.argumentList); |
| 3877 JUnitTestCase.assertNull(invocation.constructorName); | 3877 JUnitTestCase.assertNull(invocation.constructorName); |
| 3878 JUnitTestCase.assertNotNull(invocation.keyword); | 3878 JUnitTestCase.assertNotNull(invocation.keyword); |
| 3879 JUnitTestCase.assertNull(invocation.period); | 3879 JUnitTestCase.assertNull(invocation.period); |
| 3880 } | 3880 } |
| 3881 void test_parseSwitchStatement_case() { | 3881 void test_parseSwitchStatement_case() { |
| 3882 SwitchStatement statement = ParserTestCase.parse4("parseSwitchStatement", "s
witch (a) {case 1: return 'I';}", []); | 3882 SwitchStatement statement = ParserTestCase.parse5("parseSwitchStatement", "s
witch (a) {case 1: return 'I';}", []); |
| 3883 JUnitTestCase.assertNotNull(statement.keyword); | 3883 JUnitTestCase.assertNotNull(statement.keyword); |
| 3884 JUnitTestCase.assertNotNull(statement.leftParenthesis); | 3884 JUnitTestCase.assertNotNull(statement.leftParenthesis); |
| 3885 JUnitTestCase.assertNotNull(statement.expression); | 3885 JUnitTestCase.assertNotNull(statement.expression); |
| 3886 JUnitTestCase.assertNotNull(statement.rightParenthesis); | 3886 JUnitTestCase.assertNotNull(statement.rightParenthesis); |
| 3887 JUnitTestCase.assertNotNull(statement.leftBracket); | 3887 JUnitTestCase.assertNotNull(statement.leftBracket); |
| 3888 EngineTestCase.assertSize(1, statement.members); | 3888 EngineTestCase.assertSize(1, statement.members); |
| 3889 JUnitTestCase.assertNotNull(statement.rightBracket); | 3889 JUnitTestCase.assertNotNull(statement.rightBracket); |
| 3890 } | 3890 } |
| 3891 void test_parseSwitchStatement_empty() { | 3891 void test_parseSwitchStatement_empty() { |
| 3892 SwitchStatement statement = ParserTestCase.parse4("parseSwitchStatement", "s
witch (a) {}", []); | 3892 SwitchStatement statement = ParserTestCase.parse5("parseSwitchStatement", "s
witch (a) {}", []); |
| 3893 JUnitTestCase.assertNotNull(statement.keyword); | 3893 JUnitTestCase.assertNotNull(statement.keyword); |
| 3894 JUnitTestCase.assertNotNull(statement.leftParenthesis); | 3894 JUnitTestCase.assertNotNull(statement.leftParenthesis); |
| 3895 JUnitTestCase.assertNotNull(statement.expression); | 3895 JUnitTestCase.assertNotNull(statement.expression); |
| 3896 JUnitTestCase.assertNotNull(statement.rightParenthesis); | 3896 JUnitTestCase.assertNotNull(statement.rightParenthesis); |
| 3897 JUnitTestCase.assertNotNull(statement.leftBracket); | 3897 JUnitTestCase.assertNotNull(statement.leftBracket); |
| 3898 EngineTestCase.assertSize(0, statement.members); | 3898 EngineTestCase.assertSize(0, statement.members); |
| 3899 JUnitTestCase.assertNotNull(statement.rightBracket); | 3899 JUnitTestCase.assertNotNull(statement.rightBracket); |
| 3900 } | 3900 } |
| 3901 void test_parseSwitchStatement_labeledCase() { | 3901 void test_parseSwitchStatement_labeledCase() { |
| 3902 SwitchStatement statement = ParserTestCase.parse4("parseSwitchStatement", "s
witch (a) {l1: l2: l3: case(1):}", []); | 3902 SwitchStatement statement = ParserTestCase.parse5("parseSwitchStatement", "s
witch (a) {l1: l2: l3: case(1):}", []); |
| 3903 JUnitTestCase.assertNotNull(statement.keyword); | 3903 JUnitTestCase.assertNotNull(statement.keyword); |
| 3904 JUnitTestCase.assertNotNull(statement.leftParenthesis); | 3904 JUnitTestCase.assertNotNull(statement.leftParenthesis); |
| 3905 JUnitTestCase.assertNotNull(statement.expression); | 3905 JUnitTestCase.assertNotNull(statement.expression); |
| 3906 JUnitTestCase.assertNotNull(statement.rightParenthesis); | 3906 JUnitTestCase.assertNotNull(statement.rightParenthesis); |
| 3907 JUnitTestCase.assertNotNull(statement.leftBracket); | 3907 JUnitTestCase.assertNotNull(statement.leftBracket); |
| 3908 EngineTestCase.assertSize(1, statement.members); | 3908 EngineTestCase.assertSize(1, statement.members); |
| 3909 EngineTestCase.assertSize(3, statement.members[0].labels); | 3909 EngineTestCase.assertSize(3, statement.members[0].labels); |
| 3910 JUnitTestCase.assertNotNull(statement.rightBracket); | 3910 JUnitTestCase.assertNotNull(statement.rightBracket); |
| 3911 } | 3911 } |
| 3912 void test_parseSwitchStatement_labeledStatementInCase() { | 3912 void test_parseSwitchStatement_labeledStatementInCase() { |
| 3913 SwitchStatement statement = ParserTestCase.parse4("parseSwitchStatement", "s
witch (a) {case 0: f(); l1: g(); break;}", []); | 3913 SwitchStatement statement = ParserTestCase.parse5("parseSwitchStatement", "s
witch (a) {case 0: f(); l1: g(); break;}", []); |
| 3914 JUnitTestCase.assertNotNull(statement.keyword); | 3914 JUnitTestCase.assertNotNull(statement.keyword); |
| 3915 JUnitTestCase.assertNotNull(statement.leftParenthesis); | 3915 JUnitTestCase.assertNotNull(statement.leftParenthesis); |
| 3916 JUnitTestCase.assertNotNull(statement.expression); | 3916 JUnitTestCase.assertNotNull(statement.expression); |
| 3917 JUnitTestCase.assertNotNull(statement.rightParenthesis); | 3917 JUnitTestCase.assertNotNull(statement.rightParenthesis); |
| 3918 JUnitTestCase.assertNotNull(statement.leftBracket); | 3918 JUnitTestCase.assertNotNull(statement.leftBracket); |
| 3919 EngineTestCase.assertSize(1, statement.members); | 3919 EngineTestCase.assertSize(1, statement.members); |
| 3920 EngineTestCase.assertSize(3, statement.members[0].statements); | 3920 EngineTestCase.assertSize(3, statement.members[0].statements); |
| 3921 JUnitTestCase.assertNotNull(statement.rightBracket); | 3921 JUnitTestCase.assertNotNull(statement.rightBracket); |
| 3922 } | 3922 } |
| 3923 void test_parseThrowExpression_expression() { | 3923 void test_parseThrowExpression_expression() { |
| 3924 ThrowExpression statement = ParserTestCase.parse4("parseThrowExpression", "t
hrow x;", []); | 3924 ThrowExpression statement = ParserTestCase.parse5("parseThrowExpression", "t
hrow x;", []); |
| 3925 JUnitTestCase.assertNotNull(statement.keyword); | 3925 JUnitTestCase.assertNotNull(statement.keyword); |
| 3926 JUnitTestCase.assertNotNull(statement.expression); | 3926 JUnitTestCase.assertNotNull(statement.expression); |
| 3927 } | 3927 } |
| 3928 void test_parseThrowExpression_noExpression() { | 3928 void test_parseThrowExpression_noExpression() { |
| 3929 ThrowExpression statement = ParserTestCase.parse4("parseThrowExpression", "t
hrow;", []); | 3929 ThrowExpression statement = ParserTestCase.parse5("parseThrowExpression", "t
hrow;", []); |
| 3930 JUnitTestCase.assertNotNull(statement.keyword); | 3930 JUnitTestCase.assertNotNull(statement.keyword); |
| 3931 JUnitTestCase.assertNull(statement.expression); | 3931 JUnitTestCase.assertNull(statement.expression); |
| 3932 } | 3932 } |
| 3933 void test_parseThrowExpressionWithoutCascade_expression() { | 3933 void test_parseThrowExpressionWithoutCascade_expression() { |
| 3934 ThrowExpression statement = ParserTestCase.parse4("parseThrowExpressionWitho
utCascade", "throw x;", []); | 3934 ThrowExpression statement = ParserTestCase.parse5("parseThrowExpressionWitho
utCascade", "throw x;", []); |
| 3935 JUnitTestCase.assertNotNull(statement.keyword); | 3935 JUnitTestCase.assertNotNull(statement.keyword); |
| 3936 JUnitTestCase.assertNotNull(statement.expression); | 3936 JUnitTestCase.assertNotNull(statement.expression); |
| 3937 } | 3937 } |
| 3938 void test_parseThrowExpressionWithoutCascade_noExpression() { | 3938 void test_parseThrowExpressionWithoutCascade_noExpression() { |
| 3939 ThrowExpression statement = ParserTestCase.parse4("parseThrowExpressionWitho
utCascade", "throw;", []); | 3939 ThrowExpression statement = ParserTestCase.parse5("parseThrowExpressionWitho
utCascade", "throw;", []); |
| 3940 JUnitTestCase.assertNotNull(statement.keyword); | 3940 JUnitTestCase.assertNotNull(statement.keyword); |
| 3941 JUnitTestCase.assertNull(statement.expression); | 3941 JUnitTestCase.assertNull(statement.expression); |
| 3942 } | 3942 } |
| 3943 void test_parseTryStatement_catch() { | 3943 void test_parseTryStatement_catch() { |
| 3944 TryStatement statement = ParserTestCase.parse4("parseTryStatement", "try {}
catch (e) {}", []); | 3944 TryStatement statement = ParserTestCase.parse5("parseTryStatement", "try {}
catch (e) {}", []); |
| 3945 JUnitTestCase.assertNotNull(statement.tryKeyword); | 3945 JUnitTestCase.assertNotNull(statement.tryKeyword); |
| 3946 JUnitTestCase.assertNotNull(statement.body); | 3946 JUnitTestCase.assertNotNull(statement.body); |
| 3947 NodeList<CatchClause> catchClauses2 = statement.catchClauses; | 3947 NodeList<CatchClause> catchClauses2 = statement.catchClauses; |
| 3948 EngineTestCase.assertSize(1, catchClauses2); | 3948 EngineTestCase.assertSize(1, catchClauses2); |
| 3949 CatchClause clause = catchClauses2[0]; | 3949 CatchClause clause = catchClauses2[0]; |
| 3950 JUnitTestCase.assertNull(clause.onKeyword); | 3950 JUnitTestCase.assertNull(clause.onKeyword); |
| 3951 JUnitTestCase.assertNull(clause.exceptionType); | 3951 JUnitTestCase.assertNull(clause.exceptionType); |
| 3952 JUnitTestCase.assertNotNull(clause.catchKeyword); | 3952 JUnitTestCase.assertNotNull(clause.catchKeyword); |
| 3953 JUnitTestCase.assertNotNull(clause.exceptionParameter); | 3953 JUnitTestCase.assertNotNull(clause.exceptionParameter); |
| 3954 JUnitTestCase.assertNull(clause.comma); | 3954 JUnitTestCase.assertNull(clause.comma); |
| 3955 JUnitTestCase.assertNull(clause.stackTraceParameter); | 3955 JUnitTestCase.assertNull(clause.stackTraceParameter); |
| 3956 JUnitTestCase.assertNotNull(clause.body); | 3956 JUnitTestCase.assertNotNull(clause.body); |
| 3957 JUnitTestCase.assertNull(statement.finallyKeyword); | 3957 JUnitTestCase.assertNull(statement.finallyKeyword); |
| 3958 JUnitTestCase.assertNull(statement.finallyClause); | 3958 JUnitTestCase.assertNull(statement.finallyClause); |
| 3959 } | 3959 } |
| 3960 void test_parseTryStatement_catch_finally() { | 3960 void test_parseTryStatement_catch_finally() { |
| 3961 TryStatement statement = ParserTestCase.parse4("parseTryStatement", "try {}
catch (e, s) {} finally {}", []); | 3961 TryStatement statement = ParserTestCase.parse5("parseTryStatement", "try {}
catch (e, s) {} finally {}", []); |
| 3962 JUnitTestCase.assertNotNull(statement.tryKeyword); | 3962 JUnitTestCase.assertNotNull(statement.tryKeyword); |
| 3963 JUnitTestCase.assertNotNull(statement.body); | 3963 JUnitTestCase.assertNotNull(statement.body); |
| 3964 NodeList<CatchClause> catchClauses3 = statement.catchClauses; | 3964 NodeList<CatchClause> catchClauses3 = statement.catchClauses; |
| 3965 EngineTestCase.assertSize(1, catchClauses3); | 3965 EngineTestCase.assertSize(1, catchClauses3); |
| 3966 CatchClause clause = catchClauses3[0]; | 3966 CatchClause clause = catchClauses3[0]; |
| 3967 JUnitTestCase.assertNull(clause.onKeyword); | 3967 JUnitTestCase.assertNull(clause.onKeyword); |
| 3968 JUnitTestCase.assertNull(clause.exceptionType); | 3968 JUnitTestCase.assertNull(clause.exceptionType); |
| 3969 JUnitTestCase.assertNotNull(clause.catchKeyword); | 3969 JUnitTestCase.assertNotNull(clause.catchKeyword); |
| 3970 JUnitTestCase.assertNotNull(clause.exceptionParameter); | 3970 JUnitTestCase.assertNotNull(clause.exceptionParameter); |
| 3971 JUnitTestCase.assertNotNull(clause.comma); | 3971 JUnitTestCase.assertNotNull(clause.comma); |
| 3972 JUnitTestCase.assertNotNull(clause.stackTraceParameter); | 3972 JUnitTestCase.assertNotNull(clause.stackTraceParameter); |
| 3973 JUnitTestCase.assertNotNull(clause.body); | 3973 JUnitTestCase.assertNotNull(clause.body); |
| 3974 JUnitTestCase.assertNotNull(statement.finallyKeyword); | 3974 JUnitTestCase.assertNotNull(statement.finallyKeyword); |
| 3975 JUnitTestCase.assertNotNull(statement.finallyClause); | 3975 JUnitTestCase.assertNotNull(statement.finallyClause); |
| 3976 } | 3976 } |
| 3977 void test_parseTryStatement_finally() { | 3977 void test_parseTryStatement_finally() { |
| 3978 TryStatement statement = ParserTestCase.parse4("parseTryStatement", "try {}
finally {}", []); | 3978 TryStatement statement = ParserTestCase.parse5("parseTryStatement", "try {}
finally {}", []); |
| 3979 JUnitTestCase.assertNotNull(statement.tryKeyword); | 3979 JUnitTestCase.assertNotNull(statement.tryKeyword); |
| 3980 JUnitTestCase.assertNotNull(statement.body); | 3980 JUnitTestCase.assertNotNull(statement.body); |
| 3981 EngineTestCase.assertSize(0, statement.catchClauses); | 3981 EngineTestCase.assertSize(0, statement.catchClauses); |
| 3982 JUnitTestCase.assertNotNull(statement.finallyKeyword); | 3982 JUnitTestCase.assertNotNull(statement.finallyKeyword); |
| 3983 JUnitTestCase.assertNotNull(statement.finallyClause); | 3983 JUnitTestCase.assertNotNull(statement.finallyClause); |
| 3984 } | 3984 } |
| 3985 void test_parseTryStatement_multiple() { | 3985 void test_parseTryStatement_multiple() { |
| 3986 TryStatement statement = ParserTestCase.parse4("parseTryStatement", "try {}
on NPE catch (e) {} on Error {} catch (e) {}", []); | 3986 TryStatement statement = ParserTestCase.parse5("parseTryStatement", "try {}
on NPE catch (e) {} on Error {} catch (e) {}", []); |
| 3987 JUnitTestCase.assertNotNull(statement.tryKeyword); | 3987 JUnitTestCase.assertNotNull(statement.tryKeyword); |
| 3988 JUnitTestCase.assertNotNull(statement.body); | 3988 JUnitTestCase.assertNotNull(statement.body); |
| 3989 EngineTestCase.assertSize(3, statement.catchClauses); | 3989 EngineTestCase.assertSize(3, statement.catchClauses); |
| 3990 JUnitTestCase.assertNull(statement.finallyKeyword); | 3990 JUnitTestCase.assertNull(statement.finallyKeyword); |
| 3991 JUnitTestCase.assertNull(statement.finallyClause); | 3991 JUnitTestCase.assertNull(statement.finallyClause); |
| 3992 } | 3992 } |
| 3993 void test_parseTryStatement_on() { | 3993 void test_parseTryStatement_on() { |
| 3994 TryStatement statement = ParserTestCase.parse4("parseTryStatement", "try {}
on Error {}", []); | 3994 TryStatement statement = ParserTestCase.parse5("parseTryStatement", "try {}
on Error {}", []); |
| 3995 JUnitTestCase.assertNotNull(statement.tryKeyword); | 3995 JUnitTestCase.assertNotNull(statement.tryKeyword); |
| 3996 JUnitTestCase.assertNotNull(statement.body); | 3996 JUnitTestCase.assertNotNull(statement.body); |
| 3997 NodeList<CatchClause> catchClauses4 = statement.catchClauses; | 3997 NodeList<CatchClause> catchClauses4 = statement.catchClauses; |
| 3998 EngineTestCase.assertSize(1, catchClauses4); | 3998 EngineTestCase.assertSize(1, catchClauses4); |
| 3999 CatchClause clause = catchClauses4[0]; | 3999 CatchClause clause = catchClauses4[0]; |
| 4000 JUnitTestCase.assertNotNull(clause.onKeyword); | 4000 JUnitTestCase.assertNotNull(clause.onKeyword); |
| 4001 JUnitTestCase.assertNotNull(clause.exceptionType); | 4001 JUnitTestCase.assertNotNull(clause.exceptionType); |
| 4002 JUnitTestCase.assertNull(clause.catchKeyword); | 4002 JUnitTestCase.assertNull(clause.catchKeyword); |
| 4003 JUnitTestCase.assertNull(clause.exceptionParameter); | 4003 JUnitTestCase.assertNull(clause.exceptionParameter); |
| 4004 JUnitTestCase.assertNull(clause.comma); | 4004 JUnitTestCase.assertNull(clause.comma); |
| 4005 JUnitTestCase.assertNull(clause.stackTraceParameter); | 4005 JUnitTestCase.assertNull(clause.stackTraceParameter); |
| 4006 JUnitTestCase.assertNotNull(clause.body); | 4006 JUnitTestCase.assertNotNull(clause.body); |
| 4007 JUnitTestCase.assertNull(statement.finallyKeyword); | 4007 JUnitTestCase.assertNull(statement.finallyKeyword); |
| 4008 JUnitTestCase.assertNull(statement.finallyClause); | 4008 JUnitTestCase.assertNull(statement.finallyClause); |
| 4009 } | 4009 } |
| 4010 void test_parseTryStatement_on_catch() { | 4010 void test_parseTryStatement_on_catch() { |
| 4011 TryStatement statement = ParserTestCase.parse4("parseTryStatement", "try {}
on Error catch (e, s) {}", []); | 4011 TryStatement statement = ParserTestCase.parse5("parseTryStatement", "try {}
on Error catch (e, s) {}", []); |
| 4012 JUnitTestCase.assertNotNull(statement.tryKeyword); | 4012 JUnitTestCase.assertNotNull(statement.tryKeyword); |
| 4013 JUnitTestCase.assertNotNull(statement.body); | 4013 JUnitTestCase.assertNotNull(statement.body); |
| 4014 NodeList<CatchClause> catchClauses5 = statement.catchClauses; | 4014 NodeList<CatchClause> catchClauses5 = statement.catchClauses; |
| 4015 EngineTestCase.assertSize(1, catchClauses5); | 4015 EngineTestCase.assertSize(1, catchClauses5); |
| 4016 CatchClause clause = catchClauses5[0]; | 4016 CatchClause clause = catchClauses5[0]; |
| 4017 JUnitTestCase.assertNotNull(clause.onKeyword); | 4017 JUnitTestCase.assertNotNull(clause.onKeyword); |
| 4018 JUnitTestCase.assertNotNull(clause.exceptionType); | 4018 JUnitTestCase.assertNotNull(clause.exceptionType); |
| 4019 JUnitTestCase.assertNotNull(clause.catchKeyword); | 4019 JUnitTestCase.assertNotNull(clause.catchKeyword); |
| 4020 JUnitTestCase.assertNotNull(clause.exceptionParameter); | 4020 JUnitTestCase.assertNotNull(clause.exceptionParameter); |
| 4021 JUnitTestCase.assertNotNull(clause.comma); | 4021 JUnitTestCase.assertNotNull(clause.comma); |
| 4022 JUnitTestCase.assertNotNull(clause.stackTraceParameter); | 4022 JUnitTestCase.assertNotNull(clause.stackTraceParameter); |
| 4023 JUnitTestCase.assertNotNull(clause.body); | 4023 JUnitTestCase.assertNotNull(clause.body); |
| 4024 JUnitTestCase.assertNull(statement.finallyKeyword); | 4024 JUnitTestCase.assertNull(statement.finallyKeyword); |
| 4025 JUnitTestCase.assertNull(statement.finallyClause); | 4025 JUnitTestCase.assertNull(statement.finallyClause); |
| 4026 } | 4026 } |
| 4027 void test_parseTryStatement_on_catch_finally() { | 4027 void test_parseTryStatement_on_catch_finally() { |
| 4028 TryStatement statement = ParserTestCase.parse4("parseTryStatement", "try {}
on Error catch (e, s) {} finally {}", []); | 4028 TryStatement statement = ParserTestCase.parse5("parseTryStatement", "try {}
on Error catch (e, s) {} finally {}", []); |
| 4029 JUnitTestCase.assertNotNull(statement.tryKeyword); | 4029 JUnitTestCase.assertNotNull(statement.tryKeyword); |
| 4030 JUnitTestCase.assertNotNull(statement.body); | 4030 JUnitTestCase.assertNotNull(statement.body); |
| 4031 NodeList<CatchClause> catchClauses6 = statement.catchClauses; | 4031 NodeList<CatchClause> catchClauses6 = statement.catchClauses; |
| 4032 EngineTestCase.assertSize(1, catchClauses6); | 4032 EngineTestCase.assertSize(1, catchClauses6); |
| 4033 CatchClause clause = catchClauses6[0]; | 4033 CatchClause clause = catchClauses6[0]; |
| 4034 JUnitTestCase.assertNotNull(clause.onKeyword); | 4034 JUnitTestCase.assertNotNull(clause.onKeyword); |
| 4035 JUnitTestCase.assertNotNull(clause.exceptionType); | 4035 JUnitTestCase.assertNotNull(clause.exceptionType); |
| 4036 JUnitTestCase.assertNotNull(clause.catchKeyword); | 4036 JUnitTestCase.assertNotNull(clause.catchKeyword); |
| 4037 JUnitTestCase.assertNotNull(clause.exceptionParameter); | 4037 JUnitTestCase.assertNotNull(clause.exceptionParameter); |
| 4038 JUnitTestCase.assertNotNull(clause.comma); | 4038 JUnitTestCase.assertNotNull(clause.comma); |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4089 void test_parseTypeAlias_voidReturnType() { | 4089 void test_parseTypeAlias_voidReturnType() { |
| 4090 FunctionTypeAlias typeAlias = ParserTestCase.parse("parseTypeAlias", <Object
> [emptyCommentAndMetadata()], "typedef void F();"); | 4090 FunctionTypeAlias typeAlias = ParserTestCase.parse("parseTypeAlias", <Object
> [emptyCommentAndMetadata()], "typedef void F();"); |
| 4091 JUnitTestCase.assertNotNull(typeAlias.keyword); | 4091 JUnitTestCase.assertNotNull(typeAlias.keyword); |
| 4092 JUnitTestCase.assertNotNull(typeAlias.name); | 4092 JUnitTestCase.assertNotNull(typeAlias.name); |
| 4093 JUnitTestCase.assertNotNull(typeAlias.parameters); | 4093 JUnitTestCase.assertNotNull(typeAlias.parameters); |
| 4094 JUnitTestCase.assertNotNull(typeAlias.returnType); | 4094 JUnitTestCase.assertNotNull(typeAlias.returnType); |
| 4095 JUnitTestCase.assertNotNull(typeAlias.semicolon); | 4095 JUnitTestCase.assertNotNull(typeAlias.semicolon); |
| 4096 JUnitTestCase.assertNull(typeAlias.typeParameters); | 4096 JUnitTestCase.assertNull(typeAlias.typeParameters); |
| 4097 } | 4097 } |
| 4098 void test_parseTypeArgumentList_multiple() { | 4098 void test_parseTypeArgumentList_multiple() { |
| 4099 TypeArgumentList argumentList = ParserTestCase.parse4("parseTypeArgumentList
", "<int, int, int>", []); | 4099 TypeArgumentList argumentList = ParserTestCase.parse5("parseTypeArgumentList
", "<int, int, int>", []); |
| 4100 JUnitTestCase.assertNotNull(argumentList.leftBracket); | 4100 JUnitTestCase.assertNotNull(argumentList.leftBracket); |
| 4101 EngineTestCase.assertSize(3, argumentList.arguments); | 4101 EngineTestCase.assertSize(3, argumentList.arguments); |
| 4102 JUnitTestCase.assertNotNull(argumentList.rightBracket); | 4102 JUnitTestCase.assertNotNull(argumentList.rightBracket); |
| 4103 } | 4103 } |
| 4104 void test_parseTypeArgumentList_nested() { | 4104 void test_parseTypeArgumentList_nested() { |
| 4105 TypeArgumentList argumentList = ParserTestCase.parse4("parseTypeArgumentList
", "<A<B>>", []); | 4105 TypeArgumentList argumentList = ParserTestCase.parse5("parseTypeArgumentList
", "<A<B>>", []); |
| 4106 JUnitTestCase.assertNotNull(argumentList.leftBracket); | 4106 JUnitTestCase.assertNotNull(argumentList.leftBracket); |
| 4107 EngineTestCase.assertSize(1, argumentList.arguments); | 4107 EngineTestCase.assertSize(1, argumentList.arguments); |
| 4108 TypeName argument = argumentList.arguments[0]; | 4108 TypeName argument = argumentList.arguments[0]; |
| 4109 JUnitTestCase.assertNotNull(argument); | 4109 JUnitTestCase.assertNotNull(argument); |
| 4110 TypeArgumentList innerList = argument.typeArguments; | 4110 TypeArgumentList innerList = argument.typeArguments; |
| 4111 JUnitTestCase.assertNotNull(innerList); | 4111 JUnitTestCase.assertNotNull(innerList); |
| 4112 EngineTestCase.assertSize(1, innerList.arguments); | 4112 EngineTestCase.assertSize(1, innerList.arguments); |
| 4113 JUnitTestCase.assertNotNull(argumentList.rightBracket); | 4113 JUnitTestCase.assertNotNull(argumentList.rightBracket); |
| 4114 } | 4114 } |
| 4115 void test_parseTypeArgumentList_single() { | 4115 void test_parseTypeArgumentList_single() { |
| 4116 TypeArgumentList argumentList = ParserTestCase.parse4("parseTypeArgumentList
", "<int>", []); | 4116 TypeArgumentList argumentList = ParserTestCase.parse5("parseTypeArgumentList
", "<int>", []); |
| 4117 JUnitTestCase.assertNotNull(argumentList.leftBracket); | 4117 JUnitTestCase.assertNotNull(argumentList.leftBracket); |
| 4118 EngineTestCase.assertSize(1, argumentList.arguments); | 4118 EngineTestCase.assertSize(1, argumentList.arguments); |
| 4119 JUnitTestCase.assertNotNull(argumentList.rightBracket); | 4119 JUnitTestCase.assertNotNull(argumentList.rightBracket); |
| 4120 } | 4120 } |
| 4121 void test_parseTypeName_parameterized() { | 4121 void test_parseTypeName_parameterized() { |
| 4122 TypeName typeName = ParserTestCase.parse4("parseTypeName", "List<int>", []); | 4122 TypeName typeName = ParserTestCase.parse5("parseTypeName", "List<int>", []); |
| 4123 JUnitTestCase.assertNotNull(typeName.name); | 4123 JUnitTestCase.assertNotNull(typeName.name); |
| 4124 JUnitTestCase.assertNotNull(typeName.typeArguments); | 4124 JUnitTestCase.assertNotNull(typeName.typeArguments); |
| 4125 } | 4125 } |
| 4126 void test_parseTypeName_simple() { | 4126 void test_parseTypeName_simple() { |
| 4127 TypeName typeName = ParserTestCase.parse4("parseTypeName", "int", []); | 4127 TypeName typeName = ParserTestCase.parse5("parseTypeName", "int", []); |
| 4128 JUnitTestCase.assertNotNull(typeName.name); | 4128 JUnitTestCase.assertNotNull(typeName.name); |
| 4129 JUnitTestCase.assertNull(typeName.typeArguments); | 4129 JUnitTestCase.assertNull(typeName.typeArguments); |
| 4130 } | 4130 } |
| 4131 void test_parseTypeParameter_bounded() { | 4131 void test_parseTypeParameter_bounded() { |
| 4132 TypeParameter parameter = ParserTestCase.parse4("parseTypeParameter", "A ext
ends B", []); | 4132 TypeParameter parameter = ParserTestCase.parse5("parseTypeParameter", "A ext
ends B", []); |
| 4133 JUnitTestCase.assertNotNull(parameter.bound); | 4133 JUnitTestCase.assertNotNull(parameter.bound); |
| 4134 JUnitTestCase.assertNotNull(parameter.keyword); | 4134 JUnitTestCase.assertNotNull(parameter.keyword); |
| 4135 JUnitTestCase.assertNotNull(parameter.name); | 4135 JUnitTestCase.assertNotNull(parameter.name); |
| 4136 } | 4136 } |
| 4137 void test_parseTypeParameter_simple() { | 4137 void test_parseTypeParameter_simple() { |
| 4138 TypeParameter parameter = ParserTestCase.parse4("parseTypeParameter", "A", [
]); | 4138 TypeParameter parameter = ParserTestCase.parse5("parseTypeParameter", "A", [
]); |
| 4139 JUnitTestCase.assertNull(parameter.bound); | 4139 JUnitTestCase.assertNull(parameter.bound); |
| 4140 JUnitTestCase.assertNull(parameter.keyword); | 4140 JUnitTestCase.assertNull(parameter.keyword); |
| 4141 JUnitTestCase.assertNotNull(parameter.name); | 4141 JUnitTestCase.assertNotNull(parameter.name); |
| 4142 } | 4142 } |
| 4143 void test_parseTypeParameterList_multiple() { | 4143 void test_parseTypeParameterList_multiple() { |
| 4144 TypeParameterList parameterList = ParserTestCase.parse4("parseTypeParameterL
ist", "<A, B extends C, D>", []); | 4144 TypeParameterList parameterList = ParserTestCase.parse5("parseTypeParameterL
ist", "<A, B extends C, D>", []); |
| 4145 JUnitTestCase.assertNotNull(parameterList.leftBracket); | 4145 JUnitTestCase.assertNotNull(parameterList.leftBracket); |
| 4146 JUnitTestCase.assertNotNull(parameterList.rightBracket); | 4146 JUnitTestCase.assertNotNull(parameterList.rightBracket); |
| 4147 EngineTestCase.assertSize(3, parameterList.typeParameters); | 4147 EngineTestCase.assertSize(3, parameterList.typeParameters); |
| 4148 } | 4148 } |
| 4149 void test_parseTypeParameterList_parameterizedWithTrailingEquals() { | 4149 void test_parseTypeParameterList_parameterizedWithTrailingEquals() { |
| 4150 TypeParameterList parameterList = ParserTestCase.parse4("parseTypeParameterL
ist", "<A extends B<E>>=", []); | 4150 TypeParameterList parameterList = ParserTestCase.parse5("parseTypeParameterL
ist", "<A extends B<E>>=", []); |
| 4151 JUnitTestCase.assertNotNull(parameterList.leftBracket); | 4151 JUnitTestCase.assertNotNull(parameterList.leftBracket); |
| 4152 JUnitTestCase.assertNotNull(parameterList.rightBracket); | 4152 JUnitTestCase.assertNotNull(parameterList.rightBracket); |
| 4153 EngineTestCase.assertSize(1, parameterList.typeParameters); | 4153 EngineTestCase.assertSize(1, parameterList.typeParameters); |
| 4154 } | 4154 } |
| 4155 void test_parseTypeParameterList_single() { | 4155 void test_parseTypeParameterList_single() { |
| 4156 TypeParameterList parameterList = ParserTestCase.parse4("parseTypeParameterL
ist", "<A>", []); | 4156 TypeParameterList parameterList = ParserTestCase.parse5("parseTypeParameterL
ist", "<A>", []); |
| 4157 JUnitTestCase.assertNotNull(parameterList.leftBracket); | 4157 JUnitTestCase.assertNotNull(parameterList.leftBracket); |
| 4158 JUnitTestCase.assertNotNull(parameterList.rightBracket); | 4158 JUnitTestCase.assertNotNull(parameterList.rightBracket); |
| 4159 EngineTestCase.assertSize(1, parameterList.typeParameters); | 4159 EngineTestCase.assertSize(1, parameterList.typeParameters); |
| 4160 } | 4160 } |
| 4161 void test_parseTypeParameterList_withTrailingEquals() { | 4161 void test_parseTypeParameterList_withTrailingEquals() { |
| 4162 TypeParameterList parameterList = ParserTestCase.parse4("parseTypeParameterL
ist", "<A>=", []); | 4162 TypeParameterList parameterList = ParserTestCase.parse5("parseTypeParameterL
ist", "<A>=", []); |
| 4163 JUnitTestCase.assertNotNull(parameterList.leftBracket); | 4163 JUnitTestCase.assertNotNull(parameterList.leftBracket); |
| 4164 JUnitTestCase.assertNotNull(parameterList.rightBracket); | 4164 JUnitTestCase.assertNotNull(parameterList.rightBracket); |
| 4165 EngineTestCase.assertSize(1, parameterList.typeParameters); | 4165 EngineTestCase.assertSize(1, parameterList.typeParameters); |
| 4166 } | 4166 } |
| 4167 void test_parseUnaryExpression_decrement_normal() { | 4167 void test_parseUnaryExpression_decrement_normal() { |
| 4168 PrefixExpression expression = ParserTestCase.parse4("parseUnaryExpression",
"--x", []); | 4168 PrefixExpression expression = ParserTestCase.parse5("parseUnaryExpression",
"--x", []); |
| 4169 JUnitTestCase.assertNotNull(expression.operator); | 4169 JUnitTestCase.assertNotNull(expression.operator); |
| 4170 JUnitTestCase.assertEquals(TokenType.MINUS_MINUS, expression.operator.type); | 4170 JUnitTestCase.assertEquals(TokenType.MINUS_MINUS, expression.operator.type); |
| 4171 JUnitTestCase.assertNotNull(expression.operand); | 4171 JUnitTestCase.assertNotNull(expression.operand); |
| 4172 } | 4172 } |
| 4173 void test_parseUnaryExpression_decrement_super() { | 4173 void test_parseUnaryExpression_decrement_super() { |
| 4174 PrefixExpression expression = ParserTestCase.parse4("parseUnaryExpression",
"--super", []); | 4174 PrefixExpression expression = ParserTestCase.parse5("parseUnaryExpression",
"--super", []); |
| 4175 JUnitTestCase.assertNotNull(expression.operator); | 4175 JUnitTestCase.assertNotNull(expression.operator); |
| 4176 JUnitTestCase.assertEquals(TokenType.MINUS, expression.operator.type); | 4176 JUnitTestCase.assertEquals(TokenType.MINUS, expression.operator.type); |
| 4177 Expression innerExpression = expression.operand; | 4177 Expression innerExpression = expression.operand; |
| 4178 JUnitTestCase.assertNotNull(innerExpression); | 4178 JUnitTestCase.assertNotNull(innerExpression); |
| 4179 JUnitTestCase.assertTrue(innerExpression is PrefixExpression); | 4179 JUnitTestCase.assertTrue(innerExpression is PrefixExpression); |
| 4180 PrefixExpression operand = innerExpression as PrefixExpression; | 4180 PrefixExpression operand = (innerExpression as PrefixExpression); |
| 4181 JUnitTestCase.assertNotNull(operand.operator); | 4181 JUnitTestCase.assertNotNull(operand.operator); |
| 4182 JUnitTestCase.assertEquals(TokenType.MINUS, operand.operator.type); | 4182 JUnitTestCase.assertEquals(TokenType.MINUS, operand.operator.type); |
| 4183 JUnitTestCase.assertNotNull(operand.operand); | 4183 JUnitTestCase.assertNotNull(operand.operand); |
| 4184 } | 4184 } |
| 4185 void test_parseUnaryExpression_increment_normal() { | 4185 void test_parseUnaryExpression_increment_normal() { |
| 4186 PrefixExpression expression = ParserTestCase.parse4("parseUnaryExpression",
"++x", []); | 4186 PrefixExpression expression = ParserTestCase.parse5("parseUnaryExpression",
"++x", []); |
| 4187 JUnitTestCase.assertNotNull(expression.operator); | 4187 JUnitTestCase.assertNotNull(expression.operator); |
| 4188 JUnitTestCase.assertEquals(TokenType.PLUS_PLUS, expression.operator.type); | 4188 JUnitTestCase.assertEquals(TokenType.PLUS_PLUS, expression.operator.type); |
| 4189 JUnitTestCase.assertNotNull(expression.operand); | 4189 JUnitTestCase.assertNotNull(expression.operand); |
| 4190 } | 4190 } |
| 4191 void test_parseUnaryExpression_minus_normal() { | 4191 void test_parseUnaryExpression_minus_normal() { |
| 4192 PrefixExpression expression = ParserTestCase.parse4("parseUnaryExpression",
"-x", []); | 4192 PrefixExpression expression = ParserTestCase.parse5("parseUnaryExpression",
"-x", []); |
| 4193 JUnitTestCase.assertNotNull(expression.operator); | 4193 JUnitTestCase.assertNotNull(expression.operator); |
| 4194 JUnitTestCase.assertEquals(TokenType.MINUS, expression.operator.type); | 4194 JUnitTestCase.assertEquals(TokenType.MINUS, expression.operator.type); |
| 4195 JUnitTestCase.assertNotNull(expression.operand); | 4195 JUnitTestCase.assertNotNull(expression.operand); |
| 4196 } | 4196 } |
| 4197 void test_parseUnaryExpression_minus_super() { | 4197 void test_parseUnaryExpression_minus_super() { |
| 4198 PrefixExpression expression = ParserTestCase.parse4("parseUnaryExpression",
"-super", []); | 4198 PrefixExpression expression = ParserTestCase.parse5("parseUnaryExpression",
"-super", []); |
| 4199 JUnitTestCase.assertNotNull(expression.operator); | 4199 JUnitTestCase.assertNotNull(expression.operator); |
| 4200 JUnitTestCase.assertEquals(TokenType.MINUS, expression.operator.type); | 4200 JUnitTestCase.assertEquals(TokenType.MINUS, expression.operator.type); |
| 4201 JUnitTestCase.assertNotNull(expression.operand); | 4201 JUnitTestCase.assertNotNull(expression.operand); |
| 4202 } | 4202 } |
| 4203 void test_parseUnaryExpression_not_normal() { | 4203 void test_parseUnaryExpression_not_normal() { |
| 4204 PrefixExpression expression = ParserTestCase.parse4("parseUnaryExpression",
"!x", []); | 4204 PrefixExpression expression = ParserTestCase.parse5("parseUnaryExpression",
"!x", []); |
| 4205 JUnitTestCase.assertNotNull(expression.operator); | 4205 JUnitTestCase.assertNotNull(expression.operator); |
| 4206 JUnitTestCase.assertEquals(TokenType.BANG, expression.operator.type); | 4206 JUnitTestCase.assertEquals(TokenType.BANG, expression.operator.type); |
| 4207 JUnitTestCase.assertNotNull(expression.operand); | 4207 JUnitTestCase.assertNotNull(expression.operand); |
| 4208 } | 4208 } |
| 4209 void test_parseUnaryExpression_not_super() { | 4209 void test_parseUnaryExpression_not_super() { |
| 4210 PrefixExpression expression = ParserTestCase.parse4("parseUnaryExpression",
"!super", []); | 4210 PrefixExpression expression = ParserTestCase.parse5("parseUnaryExpression",
"!super", []); |
| 4211 JUnitTestCase.assertNotNull(expression.operator); | 4211 JUnitTestCase.assertNotNull(expression.operator); |
| 4212 JUnitTestCase.assertEquals(TokenType.BANG, expression.operator.type); | 4212 JUnitTestCase.assertEquals(TokenType.BANG, expression.operator.type); |
| 4213 JUnitTestCase.assertNotNull(expression.operand); | 4213 JUnitTestCase.assertNotNull(expression.operand); |
| 4214 } | 4214 } |
| 4215 void test_parseUnaryExpression_tilda_normal() { | 4215 void test_parseUnaryExpression_tilda_normal() { |
| 4216 PrefixExpression expression = ParserTestCase.parse4("parseUnaryExpression",
"~x", []); | 4216 PrefixExpression expression = ParserTestCase.parse5("parseUnaryExpression",
"~x", []); |
| 4217 JUnitTestCase.assertNotNull(expression.operator); | 4217 JUnitTestCase.assertNotNull(expression.operator); |
| 4218 JUnitTestCase.assertEquals(TokenType.TILDE, expression.operator.type); | 4218 JUnitTestCase.assertEquals(TokenType.TILDE, expression.operator.type); |
| 4219 JUnitTestCase.assertNotNull(expression.operand); | 4219 JUnitTestCase.assertNotNull(expression.operand); |
| 4220 } | 4220 } |
| 4221 void test_parseUnaryExpression_tilda_super() { | 4221 void test_parseUnaryExpression_tilda_super() { |
| 4222 PrefixExpression expression = ParserTestCase.parse4("parseUnaryExpression",
"~super", []); | 4222 PrefixExpression expression = ParserTestCase.parse5("parseUnaryExpression",
"~super", []); |
| 4223 JUnitTestCase.assertNotNull(expression.operator); | 4223 JUnitTestCase.assertNotNull(expression.operator); |
| 4224 JUnitTestCase.assertEquals(TokenType.TILDE, expression.operator.type); | 4224 JUnitTestCase.assertEquals(TokenType.TILDE, expression.operator.type); |
| 4225 JUnitTestCase.assertNotNull(expression.operand); | 4225 JUnitTestCase.assertNotNull(expression.operand); |
| 4226 } | 4226 } |
| 4227 void test_parseVariableDeclaration_equals() { | 4227 void test_parseVariableDeclaration_equals() { |
| 4228 VariableDeclaration declaration = ParserTestCase.parse4("parseVariableDeclar
ation", "a = b", []); | 4228 VariableDeclaration declaration = ParserTestCase.parse5("parseVariableDeclar
ation", "a = b", []); |
| 4229 JUnitTestCase.assertNotNull(declaration.name); | 4229 JUnitTestCase.assertNotNull(declaration.name); |
| 4230 JUnitTestCase.assertNotNull(declaration.equals); | 4230 JUnitTestCase.assertNotNull(declaration.equals); |
| 4231 JUnitTestCase.assertNotNull(declaration.initializer); | 4231 JUnitTestCase.assertNotNull(declaration.initializer); |
| 4232 } | 4232 } |
| 4233 void test_parseVariableDeclaration_noEquals() { | 4233 void test_parseVariableDeclaration_noEquals() { |
| 4234 VariableDeclaration declaration = ParserTestCase.parse4("parseVariableDeclar
ation", "a", []); | 4234 VariableDeclaration declaration = ParserTestCase.parse5("parseVariableDeclar
ation", "a", []); |
| 4235 JUnitTestCase.assertNotNull(declaration.name); | 4235 JUnitTestCase.assertNotNull(declaration.name); |
| 4236 JUnitTestCase.assertNull(declaration.equals); | 4236 JUnitTestCase.assertNull(declaration.equals); |
| 4237 JUnitTestCase.assertNull(declaration.initializer); | 4237 JUnitTestCase.assertNull(declaration.initializer); |
| 4238 } | 4238 } |
| 4239 void test_parseVariableDeclarationList_const_noType() { | 4239 void test_parseVariableDeclarationList_const_noType() { |
| 4240 VariableDeclarationList declarationList = ParserTestCase.parse4("parseVariab
leDeclarationList", "const a", []); | 4240 VariableDeclarationList declarationList = ParserTestCase.parse5("parseVariab
leDeclarationList", "const a", []); |
| 4241 JUnitTestCase.assertNotNull(declarationList.keyword); | 4241 JUnitTestCase.assertNotNull(declarationList.keyword); |
| 4242 JUnitTestCase.assertNull(declarationList.type); | 4242 JUnitTestCase.assertNull(declarationList.type); |
| 4243 EngineTestCase.assertSize(1, declarationList.variables); | 4243 EngineTestCase.assertSize(1, declarationList.variables); |
| 4244 } | 4244 } |
| 4245 void test_parseVariableDeclarationList_const_type() { | 4245 void test_parseVariableDeclarationList_const_type() { |
| 4246 VariableDeclarationList declarationList = ParserTestCase.parse4("parseVariab
leDeclarationList", "const A a", []); | 4246 VariableDeclarationList declarationList = ParserTestCase.parse5("parseVariab
leDeclarationList", "const A a", []); |
| 4247 JUnitTestCase.assertNotNull(declarationList.keyword); | 4247 JUnitTestCase.assertNotNull(declarationList.keyword); |
| 4248 JUnitTestCase.assertNotNull(declarationList.type); | 4248 JUnitTestCase.assertNotNull(declarationList.type); |
| 4249 EngineTestCase.assertSize(1, declarationList.variables); | 4249 EngineTestCase.assertSize(1, declarationList.variables); |
| 4250 } | 4250 } |
| 4251 void test_parseVariableDeclarationList_final_noType() { | 4251 void test_parseVariableDeclarationList_final_noType() { |
| 4252 VariableDeclarationList declarationList = ParserTestCase.parse4("parseVariab
leDeclarationList", "final a", []); | 4252 VariableDeclarationList declarationList = ParserTestCase.parse5("parseVariab
leDeclarationList", "final a", []); |
| 4253 JUnitTestCase.assertNotNull(declarationList.keyword); | 4253 JUnitTestCase.assertNotNull(declarationList.keyword); |
| 4254 JUnitTestCase.assertNull(declarationList.type); | 4254 JUnitTestCase.assertNull(declarationList.type); |
| 4255 EngineTestCase.assertSize(1, declarationList.variables); | 4255 EngineTestCase.assertSize(1, declarationList.variables); |
| 4256 } | 4256 } |
| 4257 void test_parseVariableDeclarationList_final_type() { | 4257 void test_parseVariableDeclarationList_final_type() { |
| 4258 VariableDeclarationList declarationList = ParserTestCase.parse4("parseVariab
leDeclarationList", "final A a", []); | 4258 VariableDeclarationList declarationList = ParserTestCase.parse5("parseVariab
leDeclarationList", "final A a", []); |
| 4259 JUnitTestCase.assertNotNull(declarationList.keyword); | 4259 JUnitTestCase.assertNotNull(declarationList.keyword); |
| 4260 JUnitTestCase.assertNotNull(declarationList.type); | 4260 JUnitTestCase.assertNotNull(declarationList.type); |
| 4261 EngineTestCase.assertSize(1, declarationList.variables); | 4261 EngineTestCase.assertSize(1, declarationList.variables); |
| 4262 } | 4262 } |
| 4263 void test_parseVariableDeclarationList_type_multiple() { | 4263 void test_parseVariableDeclarationList_type_multiple() { |
| 4264 VariableDeclarationList declarationList = ParserTestCase.parse4("parseVariab
leDeclarationList", "A a, b, c", []); | 4264 VariableDeclarationList declarationList = ParserTestCase.parse5("parseVariab
leDeclarationList", "A a, b, c", []); |
| 4265 JUnitTestCase.assertNull(declarationList.keyword); | 4265 JUnitTestCase.assertNull(declarationList.keyword); |
| 4266 JUnitTestCase.assertNotNull(declarationList.type); | 4266 JUnitTestCase.assertNotNull(declarationList.type); |
| 4267 EngineTestCase.assertSize(3, declarationList.variables); | 4267 EngineTestCase.assertSize(3, declarationList.variables); |
| 4268 } | 4268 } |
| 4269 void test_parseVariableDeclarationList_type_single() { | 4269 void test_parseVariableDeclarationList_type_single() { |
| 4270 VariableDeclarationList declarationList = ParserTestCase.parse4("parseVariab
leDeclarationList", "A a", []); | 4270 VariableDeclarationList declarationList = ParserTestCase.parse5("parseVariab
leDeclarationList", "A a", []); |
| 4271 JUnitTestCase.assertNull(declarationList.keyword); | 4271 JUnitTestCase.assertNull(declarationList.keyword); |
| 4272 JUnitTestCase.assertNotNull(declarationList.type); | 4272 JUnitTestCase.assertNotNull(declarationList.type); |
| 4273 EngineTestCase.assertSize(1, declarationList.variables); | 4273 EngineTestCase.assertSize(1, declarationList.variables); |
| 4274 } | 4274 } |
| 4275 void test_parseVariableDeclarationList_var_multiple() { | 4275 void test_parseVariableDeclarationList_var_multiple() { |
| 4276 VariableDeclarationList declarationList = ParserTestCase.parse4("parseVariab
leDeclarationList", "var a, b, c", []); | 4276 VariableDeclarationList declarationList = ParserTestCase.parse5("parseVariab
leDeclarationList", "var a, b, c", []); |
| 4277 JUnitTestCase.assertNotNull(declarationList.keyword); | 4277 JUnitTestCase.assertNotNull(declarationList.keyword); |
| 4278 JUnitTestCase.assertNull(declarationList.type); | 4278 JUnitTestCase.assertNull(declarationList.type); |
| 4279 EngineTestCase.assertSize(3, declarationList.variables); | 4279 EngineTestCase.assertSize(3, declarationList.variables); |
| 4280 } | 4280 } |
| 4281 void test_parseVariableDeclarationList_var_single() { | 4281 void test_parseVariableDeclarationList_var_single() { |
| 4282 VariableDeclarationList declarationList = ParserTestCase.parse4("parseVariab
leDeclarationList", "var a", []); | 4282 VariableDeclarationList declarationList = ParserTestCase.parse5("parseVariab
leDeclarationList", "var a", []); |
| 4283 JUnitTestCase.assertNotNull(declarationList.keyword); | 4283 JUnitTestCase.assertNotNull(declarationList.keyword); |
| 4284 JUnitTestCase.assertNull(declarationList.type); | 4284 JUnitTestCase.assertNull(declarationList.type); |
| 4285 EngineTestCase.assertSize(1, declarationList.variables); | 4285 EngineTestCase.assertSize(1, declarationList.variables); |
| 4286 } | 4286 } |
| 4287 void test_parseVariableDeclarationList2_type() { | 4287 void test_parseVariableDeclarationList2_type() { |
| 4288 TypeName type = new TypeName(new SimpleIdentifier(null), null); | 4288 TypeName type = new TypeName.full(new SimpleIdentifier.full(null), null); |
| 4289 VariableDeclarationList declarationList = ParserTestCase.parse("parseVariabl
eDeclarationList", <Object> [null, type], "a"); | 4289 VariableDeclarationList declarationList = ParserTestCase.parse("parseVariabl
eDeclarationList", <Object> [null, type], "a"); |
| 4290 JUnitTestCase.assertNull(declarationList.keyword); | 4290 JUnitTestCase.assertNull(declarationList.keyword); |
| 4291 JUnitTestCase.assertEquals(type, declarationList.type); | 4291 JUnitTestCase.assertEquals(type, declarationList.type); |
| 4292 EngineTestCase.assertSize(1, declarationList.variables); | 4292 EngineTestCase.assertSize(1, declarationList.variables); |
| 4293 } | 4293 } |
| 4294 void test_parseVariableDeclarationList2_var() { | 4294 void test_parseVariableDeclarationList2_var() { |
| 4295 Token keyword = TokenFactory.token(Keyword.VAR); | 4295 Token keyword = TokenFactory.token(Keyword.VAR); |
| 4296 VariableDeclarationList declarationList = ParserTestCase.parse("parseVariabl
eDeclarationList", <Object> [keyword, null], "a, b, c"); | 4296 VariableDeclarationList declarationList = ParserTestCase.parse("parseVariabl
eDeclarationList", <Object> [keyword, null], "a, b, c"); |
| 4297 JUnitTestCase.assertEquals(keyword, declarationList.keyword); | 4297 JUnitTestCase.assertEquals(keyword, declarationList.keyword); |
| 4298 JUnitTestCase.assertNull(declarationList.type); | 4298 JUnitTestCase.assertNull(declarationList.type); |
| 4299 EngineTestCase.assertSize(3, declarationList.variables); | 4299 EngineTestCase.assertSize(3, declarationList.variables); |
| 4300 } | 4300 } |
| 4301 void test_parseVariableDeclarationStatement_multiple() { | 4301 void test_parseVariableDeclarationStatement_multiple() { |
| 4302 VariableDeclarationStatement statement = ParserTestCase.parse4("parseVariabl
eDeclarationStatement", "var x, y, z;", []); | 4302 VariableDeclarationStatement statement = ParserTestCase.parse5("parseVariabl
eDeclarationStatement", "var x, y, z;", []); |
| 4303 JUnitTestCase.assertNotNull(statement.semicolon); | 4303 JUnitTestCase.assertNotNull(statement.semicolon); |
| 4304 VariableDeclarationList variableList = statement.variables; | 4304 VariableDeclarationList variableList = statement.variables; |
| 4305 JUnitTestCase.assertNotNull(variableList); | 4305 JUnitTestCase.assertNotNull(variableList); |
| 4306 EngineTestCase.assertSize(3, variableList.variables); | 4306 EngineTestCase.assertSize(3, variableList.variables); |
| 4307 } | 4307 } |
| 4308 void test_parseVariableDeclarationStatement_single() { | 4308 void test_parseVariableDeclarationStatement_single() { |
| 4309 VariableDeclarationStatement statement = ParserTestCase.parse4("parseVariabl
eDeclarationStatement", "var x;", []); | 4309 VariableDeclarationStatement statement = ParserTestCase.parse5("parseVariabl
eDeclarationStatement", "var x;", []); |
| 4310 JUnitTestCase.assertNotNull(statement.semicolon); | 4310 JUnitTestCase.assertNotNull(statement.semicolon); |
| 4311 VariableDeclarationList variableList = statement.variables; | 4311 VariableDeclarationList variableList = statement.variables; |
| 4312 JUnitTestCase.assertNotNull(variableList); | 4312 JUnitTestCase.assertNotNull(variableList); |
| 4313 EngineTestCase.assertSize(1, variableList.variables); | 4313 EngineTestCase.assertSize(1, variableList.variables); |
| 4314 } | 4314 } |
| 4315 void test_parseWhileStatement() { | 4315 void test_parseWhileStatement() { |
| 4316 WhileStatement statement = ParserTestCase.parse4("parseWhileStatement", "whi
le (x) {}", []); | 4316 WhileStatement statement = ParserTestCase.parse5("parseWhileStatement", "whi
le (x) {}", []); |
| 4317 JUnitTestCase.assertNotNull(statement.keyword); | 4317 JUnitTestCase.assertNotNull(statement.keyword); |
| 4318 JUnitTestCase.assertNotNull(statement.leftParenthesis); | 4318 JUnitTestCase.assertNotNull(statement.leftParenthesis); |
| 4319 JUnitTestCase.assertNotNull(statement.condition); | 4319 JUnitTestCase.assertNotNull(statement.condition); |
| 4320 JUnitTestCase.assertNotNull(statement.rightParenthesis); | 4320 JUnitTestCase.assertNotNull(statement.rightParenthesis); |
| 4321 JUnitTestCase.assertNotNull(statement.body); | 4321 JUnitTestCase.assertNotNull(statement.body); |
| 4322 } | 4322 } |
| 4323 void test_parseWithClause_multiple() { | 4323 void test_parseWithClause_multiple() { |
| 4324 WithClause clause = ParserTestCase.parse4("parseWithClause", "with A, B, C",
[]); | 4324 WithClause clause = ParserTestCase.parse5("parseWithClause", "with A, B, C",
[]); |
| 4325 JUnitTestCase.assertNotNull(clause.withKeyword); | 4325 JUnitTestCase.assertNotNull(clause.withKeyword); |
| 4326 EngineTestCase.assertSize(3, clause.mixinTypes); | 4326 EngineTestCase.assertSize(3, clause.mixinTypes); |
| 4327 } | 4327 } |
| 4328 void test_parseWithClause_single() { | 4328 void test_parseWithClause_single() { |
| 4329 WithClause clause = ParserTestCase.parse4("parseWithClause", "with M", []); | 4329 WithClause clause = ParserTestCase.parse5("parseWithClause", "with M", []); |
| 4330 JUnitTestCase.assertNotNull(clause.withKeyword); | 4330 JUnitTestCase.assertNotNull(clause.withKeyword); |
| 4331 EngineTestCase.assertSize(1, clause.mixinTypes); | 4331 EngineTestCase.assertSize(1, clause.mixinTypes); |
| 4332 } | 4332 } |
| 4333 void test_skipPrefixedIdentifier_invalid() { | 4333 void test_skipPrefixedIdentifier_invalid() { |
| 4334 Token following = skip("skipPrefixedIdentifier", "+"); | 4334 Token following = skip("skipPrefixedIdentifier", "+"); |
| 4335 JUnitTestCase.assertNull(following); | 4335 JUnitTestCase.assertNull(following); |
| 4336 } | 4336 } |
| 4337 void test_skipPrefixedIdentifier_notPrefixed() { | 4337 void test_skipPrefixedIdentifier_notPrefixed() { |
| 4338 Token following = skip("skipPrefixedIdentifier", "a +"); | 4338 Token following = skip("skipPrefixedIdentifier", "a +"); |
| 4339 JUnitTestCase.assertNotNull(following); | 4339 JUnitTestCase.assertNotNull(following); |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4419 JUnitTestCase.assertNotNull(following); | 4419 JUnitTestCase.assertNotNull(following); |
| 4420 JUnitTestCase.assertEquals(TokenType.PLUS, following.type); | 4420 JUnitTestCase.assertEquals(TokenType.PLUS, following.type); |
| 4421 } | 4421 } |
| 4422 /** | 4422 /** |
| 4423 * Invoke the method {@link Parser#computeStringValue(String)} with the given
argument. | 4423 * Invoke the method {@link Parser#computeStringValue(String)} with the given
argument. |
| 4424 * @param lexeme the argument to the method | 4424 * @param lexeme the argument to the method |
| 4425 * @return the result of invoking the method | 4425 * @return the result of invoking the method |
| 4426 * @throws Exception if the method could not be invoked or throws an exception | 4426 * @throws Exception if the method could not be invoked or throws an exception |
| 4427 */ | 4427 */ |
| 4428 String computeStringValue(String lexeme) { | 4428 String computeStringValue(String lexeme) { |
| 4429 AnalysisErrorListener listener = new AnalysisErrorListener_4(); | 4429 AnalysisErrorListener listener = new AnalysisErrorListener_10(); |
| 4430 Parser parser = new Parser(null, listener); | 4430 Parser parser = new Parser(null, listener); |
| 4431 return invokeParserMethodImpl(parser, "computeStringValue", <Object> [lexeme
], null) as String; | 4431 return (invokeParserMethodImpl(parser, "computeStringValue", <Object> [lexem
e], null) as String); |
| 4432 } | 4432 } |
| 4433 /** | 4433 /** |
| 4434 * Invoke the method {@link Parser#createSyntheticIdentifier()} with the parse
r set to the token | 4434 * Invoke the method {@link Parser#createSyntheticIdentifier()} with the parse
r set to the token |
| 4435 * stream produced by scanning the given source. | 4435 * stream produced by scanning the given source. |
| 4436 * @param source the source to be scanned to produce the token stream being te
sted | 4436 * @param source the source to be scanned to produce the token stream being te
sted |
| 4437 * @return the result of invoking the method | 4437 * @return the result of invoking the method |
| 4438 * @throws Exception if the method could not be invoked or throws an exception | 4438 * @throws Exception if the method could not be invoked or throws an exception |
| 4439 */ | 4439 */ |
| 4440 SimpleIdentifier createSyntheticIdentifier() { | 4440 SimpleIdentifier createSyntheticIdentifier() { |
| 4441 GatheringErrorListener listener = new GatheringErrorListener(); | 4441 GatheringErrorListener listener = new GatheringErrorListener(); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 4468 * produced by scanning the given source. | 4468 * produced by scanning the given source. |
| 4469 * @param source the source to be scanned to produce the token stream being te
sted | 4469 * @param source the source to be scanned to produce the token stream being te
sted |
| 4470 * @return the result of invoking the method | 4470 * @return the result of invoking the method |
| 4471 * @throws Exception if the method could not be invoked or throws an exception | 4471 * @throws Exception if the method could not be invoked or throws an exception |
| 4472 */ | 4472 */ |
| 4473 bool isFunctionExpression(String source) { | 4473 bool isFunctionExpression(String source) { |
| 4474 GatheringErrorListener listener = new GatheringErrorListener(); | 4474 GatheringErrorListener listener = new GatheringErrorListener(); |
| 4475 StringScanner scanner = new StringScanner(null, source, listener); | 4475 StringScanner scanner = new StringScanner(null, source, listener); |
| 4476 Token tokenStream = scanner.tokenize(); | 4476 Token tokenStream = scanner.tokenize(); |
| 4477 Parser parser = new Parser(null, listener); | 4477 Parser parser = new Parser(null, listener); |
| 4478 return invokeParserMethodImpl(parser, "isFunctionExpression", <Object> [toke
nStream], tokenStream) as bool; | 4478 return (invokeParserMethodImpl(parser, "isFunctionExpression", <Object> [tok
enStream], tokenStream) as bool); |
| 4479 } | 4479 } |
| 4480 /** | 4480 /** |
| 4481 * Invoke the method {@link Parser#isInitializedVariableDeclaration()} with th
e parser set to the | 4481 * Invoke the method {@link Parser#isInitializedVariableDeclaration()} with th
e parser set to the |
| 4482 * token stream produced by scanning the given source. | 4482 * token stream produced by scanning the given source. |
| 4483 * @param source the source to be scanned to produce the token stream being te
sted | 4483 * @param source the source to be scanned to produce the token stream being te
sted |
| 4484 * @return the result of invoking the method | 4484 * @return the result of invoking the method |
| 4485 * @throws Exception if the method could not be invoked or throws an exception | 4485 * @throws Exception if the method could not be invoked or throws an exception |
| 4486 */ | 4486 */ |
| 4487 bool isInitializedVariableDeclaration(String source) { | 4487 bool isInitializedVariableDeclaration(String source) { |
| 4488 GatheringErrorListener listener = new GatheringErrorListener(); | 4488 GatheringErrorListener listener = new GatheringErrorListener(); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 4506 * @param source the source to be processed by the method | 4506 * @param source the source to be processed by the method |
| 4507 * @return the result of invoking the method | 4507 * @return the result of invoking the method |
| 4508 * @throws Exception if the method could not be invoked or throws an exception | 4508 * @throws Exception if the method could not be invoked or throws an exception |
| 4509 * @throws AssertionFailedError if the result is {@code null} | 4509 * @throws AssertionFailedError if the result is {@code null} |
| 4510 */ | 4510 */ |
| 4511 Token skip(String methodName, String source) { | 4511 Token skip(String methodName, String source) { |
| 4512 GatheringErrorListener listener = new GatheringErrorListener(); | 4512 GatheringErrorListener listener = new GatheringErrorListener(); |
| 4513 StringScanner scanner = new StringScanner(null, source, listener); | 4513 StringScanner scanner = new StringScanner(null, source, listener); |
| 4514 Token tokenStream = scanner.tokenize(); | 4514 Token tokenStream = scanner.tokenize(); |
| 4515 Parser parser = new Parser(null, listener); | 4515 Parser parser = new Parser(null, listener); |
| 4516 return invokeParserMethodImpl(parser, methodName, <Object> [tokenStream], to
kenStream) as Token; | 4516 return (invokeParserMethodImpl(parser, methodName, <Object> [tokenStream], t
okenStream) as Token); |
| 4517 } | 4517 } |
| 4518 static dartSuite() { | 4518 static dartSuite() { |
| 4519 _ut.group('SimpleParserTest', () { | 4519 _ut.group('SimpleParserTest', () { |
| 4520 _ut.test('test_Parser', () { | 4520 _ut.test('test_Parser', () { |
| 4521 final __test = new SimpleParserTest(); | 4521 final __test = new SimpleParserTest(); |
| 4522 runJUnitTest(__test, __test.test_Parser); | 4522 runJUnitTest(__test, __test.test_Parser); |
| 4523 }); | 4523 }); |
| 4524 _ut.test('test_computeStringValue_emptyInterpolationPrefix', () { | 4524 _ut.test('test_computeStringValue_emptyInterpolationPrefix', () { |
| 4525 final __test = new SimpleParserTest(); | 4525 final __test = new SimpleParserTest(); |
| 4526 runJUnitTest(__test, __test.test_computeStringValue_emptyInterpolationPr
efix); | 4526 runJUnitTest(__test, __test.test_computeStringValue_emptyInterpolationPr
efix); |
| (...skipping 1950 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6477 final __test = new SimpleParserTest(); | 6477 final __test = new SimpleParserTest(); |
| 6478 runJUnitTest(__test, __test.test_skipTypeName_parameterized); | 6478 runJUnitTest(__test, __test.test_skipTypeName_parameterized); |
| 6479 }); | 6479 }); |
| 6480 _ut.test('test_skipTypeName_simple', () { | 6480 _ut.test('test_skipTypeName_simple', () { |
| 6481 final __test = new SimpleParserTest(); | 6481 final __test = new SimpleParserTest(); |
| 6482 runJUnitTest(__test, __test.test_skipTypeName_simple); | 6482 runJUnitTest(__test, __test.test_skipTypeName_simple); |
| 6483 }); | 6483 }); |
| 6484 }); | 6484 }); |
| 6485 } | 6485 } |
| 6486 } | 6486 } |
| 6487 class AnalysisErrorListener_4 implements AnalysisErrorListener { | 6487 class AnalysisErrorListener_10 implements AnalysisErrorListener { |
| 6488 void onError(AnalysisError event) { | 6488 void onError(AnalysisError event) { |
| 6489 JUnitTestCase.fail("Unexpected compilation error: ${event.message} (${event.
offset}, ${event.length})"); | 6489 JUnitTestCase.fail("Unexpected compilation error: ${event.message} (${event.
offset}, ${event.length})"); |
| 6490 } | 6490 } |
| 6491 } | 6491 } |
| 6492 /** | 6492 /** |
| 6493 * The class {@code ComplexParserTest} defines parser tests that test the parsin
g of more complex | 6493 * 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 | 6494 * 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. | 6495 * that the precedence of operations is being handled correctly should be define
d in this class. |
| 6496 * <p> | 6496 * <p> |
| 6497 * Simpler tests should be defined in the class {@link SimpleParserTest}. | 6497 * Simpler tests should be defined in the class {@link SimpleParserTest}. |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6604 BinaryExpression expression = ParserTestCase.parseExpression("x ^ y & z", []
); | 6604 BinaryExpression expression = ParserTestCase.parseExpression("x ^ y & z", []
); |
| 6605 EngineTestCase.assertInstanceOf(BinaryExpression, expression.rightOperand); | 6605 EngineTestCase.assertInstanceOf(BinaryExpression, expression.rightOperand); |
| 6606 } | 6606 } |
| 6607 void test_bitwiseXorExpression_super() { | 6607 void test_bitwiseXorExpression_super() { |
| 6608 BinaryExpression expression = ParserTestCase.parseExpression("super ^ y ^ z"
, []); | 6608 BinaryExpression expression = ParserTestCase.parseExpression("super ^ y ^ z"
, []); |
| 6609 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); | 6609 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); |
| 6610 } | 6610 } |
| 6611 void test_conditionalExpression_precedence_argumentDefinitionTest_not() { | 6611 void test_conditionalExpression_precedence_argumentDefinitionTest_not() { |
| 6612 ConditionalExpression conditional = ParserTestCase.parseExpression("!?a?!?b:
!?c", []); | 6612 ConditionalExpression conditional = ParserTestCase.parseExpression("!?a?!?b:
!?c", []); |
| 6613 EngineTestCase.assertInstanceOf(PrefixExpression, conditional.condition); | 6613 EngineTestCase.assertInstanceOf(PrefixExpression, conditional.condition); |
| 6614 EngineTestCase.assertInstanceOf(ArgumentDefinitionTest, (conditional.conditi
on as PrefixExpression).operand); | 6614 EngineTestCase.assertInstanceOf(ArgumentDefinitionTest, ((conditional.condit
ion as PrefixExpression)).operand); |
| 6615 EngineTestCase.assertInstanceOf(PrefixExpression, conditional.thenExpression
); | 6615 EngineTestCase.assertInstanceOf(PrefixExpression, conditional.thenExpression
); |
| 6616 EngineTestCase.assertInstanceOf(ArgumentDefinitionTest, (conditional.thenExp
ression as PrefixExpression).operand); | 6616 EngineTestCase.assertInstanceOf(ArgumentDefinitionTest, ((conditional.thenEx
pression as PrefixExpression)).operand); |
| 6617 EngineTestCase.assertInstanceOf(PrefixExpression, conditional.elseExpression
); | 6617 EngineTestCase.assertInstanceOf(PrefixExpression, conditional.elseExpression
); |
| 6618 EngineTestCase.assertInstanceOf(ArgumentDefinitionTest, (conditional.elseExp
ression as PrefixExpression).operand); | 6618 EngineTestCase.assertInstanceOf(ArgumentDefinitionTest, ((conditional.elseEx
pression as PrefixExpression)).operand); |
| 6619 } | 6619 } |
| 6620 void test_conditionalExpression_precedence_logicalOrExpression() { | 6620 void test_conditionalExpression_precedence_logicalOrExpression() { |
| 6621 ConditionalExpression expression = ParserTestCase.parseExpression("a | b ? y
: z", []); | 6621 ConditionalExpression expression = ParserTestCase.parseExpression("a | b ? y
: z", []); |
| 6622 EngineTestCase.assertInstanceOf(BinaryExpression, expression.condition); | 6622 EngineTestCase.assertInstanceOf(BinaryExpression, expression.condition); |
| 6623 } | 6623 } |
| 6624 void test_constructor_initializer_withParenthesizedExpression() { | 6624 void test_constructor_initializer_withParenthesizedExpression() { |
| 6625 CompilationUnit unit = ParserTestCase.parseCompilationUnit(EngineTestCase.cr
eateSource(["class C {", " C() :", " this.a = (b == null ? c : d) {", " }",
"}"]), []); | 6625 CompilationUnit unit = ParserTestCase.parseCompilationUnit(EngineTestCase.cr
eateSource(["class C {", " C() :", " this.a = (b == null ? c : d) {", " }",
"}"]), []); |
| 6626 NodeList<CompilationUnitMember> declarations2 = unit.declarations; | 6626 NodeList<CompilationUnitMember> declarations2 = unit.declarations; |
| 6627 EngineTestCase.assertSize(1, declarations2); | 6627 EngineTestCase.assertSize(1, declarations2); |
| 6628 } | 6628 } |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6895 }); | 6895 }); |
| 6896 }); | 6896 }); |
| 6897 } | 6897 } |
| 6898 } | 6898 } |
| 6899 /** | 6899 /** |
| 6900 * The class {@code ErrorParserTest} defines parser tests that test the parsing
of code to ensure | 6900 * 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. | 6901 * that errors are correctly reported, and in some cases, not reported. |
| 6902 */ | 6902 */ |
| 6903 class ErrorParserTest extends ParserTestCase { | 6903 class ErrorParserTest extends ParserTestCase { |
| 6904 void fail_expectedListOrMapLiteral() { | 6904 void fail_expectedListOrMapLiteral() { |
| 6905 TypedLiteral literal = ParserTestCase.parse3("parseListOrMapLiteral", <Objec
t> [null], "1", [ParserErrorCode.EXPECTED_LIST_OR_MAP_LITERAL]); | 6905 TypedLiteral literal = ParserTestCase.parse4("parseListOrMapLiteral", <Objec
t> [null], "1", [ParserErrorCode.EXPECTED_LIST_OR_MAP_LITERAL]); |
| 6906 JUnitTestCase.assertTrue(literal.isSynthetic()); | 6906 JUnitTestCase.assertTrue(literal.isSynthetic()); |
| 6907 } | 6907 } |
| 6908 void fail_illegalAssignmentToNonAssignable_superAssigned() { | 6908 void fail_illegalAssignmentToNonAssignable_superAssigned() { |
| 6909 ParserTestCase.parse4("parseExpression", "super = x;", [ParserErrorCode.ILLE
GAL_ASSIGNMENT_TO_NON_ASSIGNABLE]); | 6909 ParserTestCase.parse5("parseExpression", "super = x;", [ParserErrorCode.ILLE
GAL_ASSIGNMENT_TO_NON_ASSIGNABLE]); |
| 6910 } | 6910 } |
| 6911 void fail_invalidCommentReference__new_nonIdentifier() { | 6911 void fail_invalidCommentReference__new_nonIdentifier() { |
| 6912 ParserTestCase.parse3("parseCommentReference", <Object> ["new 42", 0], "", [
ParserErrorCode.INVALID_COMMENT_REFERENCE]); | 6912 ParserTestCase.parse4("parseCommentReference", <Object> ["new 42", 0], "", [
ParserErrorCode.INVALID_COMMENT_REFERENCE]); |
| 6913 } | 6913 } |
| 6914 void fail_invalidCommentReference__new_tooMuch() { | 6914 void fail_invalidCommentReference__new_tooMuch() { |
| 6915 ParserTestCase.parse3("parseCommentReference", <Object> ["new a.b.c.d", 0],
"", [ParserErrorCode.INVALID_COMMENT_REFERENCE]); | 6915 ParserTestCase.parse4("parseCommentReference", <Object> ["new a.b.c.d", 0],
"", [ParserErrorCode.INVALID_COMMENT_REFERENCE]); |
| 6916 } | 6916 } |
| 6917 void fail_invalidCommentReference__nonNew_nonIdentifier() { | 6917 void fail_invalidCommentReference__nonNew_nonIdentifier() { |
| 6918 ParserTestCase.parse3("parseCommentReference", <Object> ["42", 0], "", [Pars
erErrorCode.INVALID_COMMENT_REFERENCE]); | 6918 ParserTestCase.parse4("parseCommentReference", <Object> ["42", 0], "", [Pars
erErrorCode.INVALID_COMMENT_REFERENCE]); |
| 6919 } | 6919 } |
| 6920 void fail_invalidCommentReference__nonNew_tooMuch() { | 6920 void fail_invalidCommentReference__nonNew_tooMuch() { |
| 6921 ParserTestCase.parse3("parseCommentReference", <Object> ["a.b.c.d", 0], "",
[ParserErrorCode.INVALID_COMMENT_REFERENCE]); | 6921 ParserTestCase.parse4("parseCommentReference", <Object> ["a.b.c.d", 0], "",
[ParserErrorCode.INVALID_COMMENT_REFERENCE]); |
| 6922 } | 6922 } |
| 6923 void fail_missingFunctionParameters_local_nonVoid_block() { | 6923 void fail_missingFunctionParameters_local_nonVoid_block() { |
| 6924 ParserTestCase.parse4("parseStatement", "int f { return x;}", [ParserErrorCo
de.MISSING_FUNCTION_PARAMETERS]); | 6924 ParserTestCase.parse5("parseStatement", "int f { return x;}", [ParserErrorCo
de.MISSING_FUNCTION_PARAMETERS]); |
| 6925 } | 6925 } |
| 6926 void fail_missingFunctionParameters_local_nonVoid_expression() { | 6926 void fail_missingFunctionParameters_local_nonVoid_expression() { |
| 6927 ParserTestCase.parse4("parseStatement", "int f => x;", [ParserErrorCode.MISS
ING_FUNCTION_PARAMETERS]); | 6927 ParserTestCase.parse5("parseStatement", "int f => x;", [ParserErrorCode.MISS
ING_FUNCTION_PARAMETERS]); |
| 6928 } | 6928 } |
| 6929 void fail_unexpectedToken_invalidPostfixExpression() { | 6929 void fail_unexpectedToken_invalidPostfixExpression() { |
| 6930 ParserTestCase.parse4("parseExpression", "f()++", [ParserErrorCode.UNEXPECTE
D_TOKEN]); | 6930 ParserTestCase.parse5("parseExpression", "f()++", [ParserErrorCode.UNEXPECTE
D_TOKEN]); |
| 6931 } | 6931 } |
| 6932 void fail_voidVariable_initializer() { | 6932 void fail_voidVariable_initializer() { |
| 6933 ParserTestCase.parse4("parseStatement", "void x = 0;", [ParserErrorCode.VOID
_VARIABLE]); | 6933 ParserTestCase.parse5("parseStatement", "void x = 0;", [ParserErrorCode.VOID
_VARIABLE]); |
| 6934 } | 6934 } |
| 6935 void fail_voidVariable_noInitializer() { | 6935 void fail_voidVariable_noInitializer() { |
| 6936 ParserTestCase.parse4("parseStatement", "void x;", [ParserErrorCode.VOID_VAR
IABLE]); | 6936 ParserTestCase.parse5("parseStatement", "void x;", [ParserErrorCode.VOID_VAR
IABLE]); |
| 6937 } | 6937 } |
| 6938 void test_abstractClassMember_constructor() { | 6938 void test_abstractClassMember_constructor() { |
| 6939 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "abstract C.c();",
[ParserErrorCode.ABSTRACT_CLASS_MEMBER]); | 6939 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "abstract C.c();",
[ParserErrorCode.ABSTRACT_CLASS_MEMBER]); |
| 6940 } | 6940 } |
| 6941 void test_abstractClassMember_field() { | 6941 void test_abstractClassMember_field() { |
| 6942 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "abstract C f;", [
ParserErrorCode.ABSTRACT_CLASS_MEMBER]); | 6942 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "abstract C f;", [
ParserErrorCode.ABSTRACT_CLASS_MEMBER]); |
| 6943 } | 6943 } |
| 6944 void test_abstractClassMember_getter() { | 6944 void test_abstractClassMember_getter() { |
| 6945 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "abstract get m;",
[ParserErrorCode.ABSTRACT_CLASS_MEMBER]); | 6945 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "abstract get m;",
[ParserErrorCode.ABSTRACT_CLASS_MEMBER]); |
| 6946 } | 6946 } |
| 6947 void test_abstractClassMember_method() { | 6947 void test_abstractClassMember_method() { |
| 6948 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "abstract m();", [
ParserErrorCode.ABSTRACT_CLASS_MEMBER]); | 6948 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "abstract m();", [
ParserErrorCode.ABSTRACT_CLASS_MEMBER]); |
| 6949 } | 6949 } |
| 6950 void test_abstractClassMember_setter() { | 6950 void test_abstractClassMember_setter() { |
| 6951 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "abstract set m(v)
;", [ParserErrorCode.ABSTRACT_CLASS_MEMBER]); | 6951 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "abstract set m(v)
;", [ParserErrorCode.ABSTRACT_CLASS_MEMBER]); |
| 6952 } | 6952 } |
| 6953 void test_abstractTopLevelFunction_function() { | 6953 void test_abstractTopLevelFunction_function() { |
| 6954 ParserTestCase.parse4("parseCompilationUnit", "abstract f(v) {}", [ParserErr
orCode.ABSTRACT_TOP_LEVEL_FUNCTION]); | 6954 ParserTestCase.parse5("parseCompilationUnit", "abstract f(v) {}", [ParserErr
orCode.ABSTRACT_TOP_LEVEL_FUNCTION]); |
| 6955 } | 6955 } |
| 6956 void test_abstractTopLevelFunction_getter() { | 6956 void test_abstractTopLevelFunction_getter() { |
| 6957 ParserTestCase.parse4("parseCompilationUnit", "abstract get m {}", [ParserEr
rorCode.ABSTRACT_TOP_LEVEL_FUNCTION]); | 6957 ParserTestCase.parse5("parseCompilationUnit", "abstract get m {}", [ParserEr
rorCode.ABSTRACT_TOP_LEVEL_FUNCTION]); |
| 6958 } | 6958 } |
| 6959 void test_abstractTopLevelFunction_setter() { | 6959 void test_abstractTopLevelFunction_setter() { |
| 6960 ParserTestCase.parse4("parseCompilationUnit", "abstract set m(v) {}", [Parse
rErrorCode.ABSTRACT_TOP_LEVEL_FUNCTION]); | 6960 ParserTestCase.parse5("parseCompilationUnit", "abstract set m(v) {}", [Parse
rErrorCode.ABSTRACT_TOP_LEVEL_FUNCTION]); |
| 6961 } | 6961 } |
| 6962 void test_abstractTopLevelVariable() { | 6962 void test_abstractTopLevelVariable() { |
| 6963 ParserTestCase.parse4("parseCompilationUnit", "abstract C f;", [ParserErrorC
ode.ABSTRACT_TOP_LEVEL_VARIABLE]); | 6963 ParserTestCase.parse5("parseCompilationUnit", "abstract C f;", [ParserErrorC
ode.ABSTRACT_TOP_LEVEL_VARIABLE]); |
| 6964 } | 6964 } |
| 6965 void test_abstractTypeDef() { | 6965 void test_abstractTypeDef() { |
| 6966 ParserTestCase.parse4("parseCompilationUnit", "abstract typedef F();", [Pars
erErrorCode.ABSTRACT_TYPEDEF]); | 6966 ParserTestCase.parse5("parseCompilationUnit", "abstract typedef F();", [Pars
erErrorCode.ABSTRACT_TYPEDEF]); |
| 6967 } | 6967 } |
| 6968 void test_breakOutsideOfLoop_breakInDoStatement() { | 6968 void test_breakOutsideOfLoop_breakInDoStatement() { |
| 6969 ParserTestCase.parse4("parseDoStatement", "do {break;} while (x);", []); | 6969 ParserTestCase.parse5("parseDoStatement", "do {break;} while (x);", []); |
| 6970 } | 6970 } |
| 6971 void test_breakOutsideOfLoop_breakInForStatement() { | 6971 void test_breakOutsideOfLoop_breakInForStatement() { |
| 6972 ParserTestCase.parse4("parseForStatement", "for (; x;) {break;}", []); | 6972 ParserTestCase.parse5("parseForStatement", "for (; x;) {break;}", []); |
| 6973 } | 6973 } |
| 6974 void test_breakOutsideOfLoop_breakInIfStatement() { | 6974 void test_breakOutsideOfLoop_breakInIfStatement() { |
| 6975 ParserTestCase.parse4("parseIfStatement", "if (x) {break;}", [ParserErrorCod
e.BREAK_OUTSIDE_OF_LOOP]); | 6975 ParserTestCase.parse5("parseIfStatement", "if (x) {break;}", [ParserErrorCod
e.BREAK_OUTSIDE_OF_LOOP]); |
| 6976 } | 6976 } |
| 6977 void test_breakOutsideOfLoop_breakInSwitchStatement() { | 6977 void test_breakOutsideOfLoop_breakInSwitchStatement() { |
| 6978 ParserTestCase.parse4("parseSwitchStatement", "switch (x) {case 1: break;}",
[]); | 6978 ParserTestCase.parse5("parseSwitchStatement", "switch (x) {case 1: break;}",
[]); |
| 6979 } | 6979 } |
| 6980 void test_breakOutsideOfLoop_breakInWhileStatement() { | 6980 void test_breakOutsideOfLoop_breakInWhileStatement() { |
| 6981 ParserTestCase.parse4("parseWhileStatement", "while (x) {break;}", []); | 6981 ParserTestCase.parse5("parseWhileStatement", "while (x) {break;}", []); |
| 6982 } | 6982 } |
| 6983 void test_breakOutsideOfLoop_functionExpression_inALoop() { | 6983 void test_breakOutsideOfLoop_functionExpression_inALoop() { |
| 6984 ParserTestCase.parse4("parseStatement", "for(; x;) {() {break;};}", [ParserE
rrorCode.BREAK_OUTSIDE_OF_LOOP]); | 6984 ParserTestCase.parse5("parseStatement", "for(; x;) {() {break;};}", [ParserE
rrorCode.BREAK_OUTSIDE_OF_LOOP]); |
| 6985 } | 6985 } |
| 6986 void test_breakOutsideOfLoop_functionExpression_withALoop() { | 6986 void test_breakOutsideOfLoop_functionExpression_withALoop() { |
| 6987 ParserTestCase.parse4("parseStatement", "() {for (; x;) {break;}};", []); | 6987 ParserTestCase.parse5("parseStatement", "() {for (; x;) {break;}};", []); |
| 6988 } | 6988 } |
| 6989 void test_builtInIdentifierAsTypeDefName() { | 6989 void test_builtInIdentifierAsTypeDefName() { |
| 6990 ParserTestCase.parse3("parseTypeAlias", <Object> [emptyCommentAndMetadata()]
, "typedef as();", [ParserErrorCode.BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME]); | 6990 ParserTestCase.parse4("parseTypeAlias", <Object> [emptyCommentAndMetadata()]
, "typedef as();", [ParserErrorCode.BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME]); |
| 6991 } | 6991 } |
| 6992 void test_builtInIdentifierAsTypeName() { | 6992 void test_builtInIdentifierAsTypeName() { |
| 6993 ParserTestCase.parse3("parseClassDeclaration", <Object> [emptyCommentAndMeta
data(), null], "class as {}", [ParserErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE_NAME]
); | 6993 ParserTestCase.parse4("parseClassDeclaration", <Object> [emptyCommentAndMeta
data(), null], "class as {}", [ParserErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE_NAME]
); |
| 6994 } | 6994 } |
| 6995 void test_builtInIdentifierAsTypeVariableName() { | 6995 void test_builtInIdentifierAsTypeVariableName() { |
| 6996 ParserTestCase.parse4("parseTypeParameter", "as", [ParserErrorCode.BUILT_IN_
IDENTIFIER_AS_TYPE_VARIABLE_NAME]); | 6996 ParserTestCase.parse5("parseTypeParameter", "as", [ParserErrorCode.BUILT_IN_
IDENTIFIER_AS_TYPE_VARIABLE_NAME]); |
| 6997 } | 6997 } |
| 6998 void test_constAndFinal() { | 6998 void test_constAndFinal() { |
| 6999 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "const final int x
;", [ParserErrorCode.CONST_AND_FINAL]); | 6999 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "const final int x
;", [ParserErrorCode.CONST_AND_FINAL]); |
| 7000 } | 7000 } |
| 7001 void test_constAndVar() { | 7001 void test_constAndVar() { |
| 7002 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "const var x;", [P
arserErrorCode.CONST_AND_VAR]); | 7002 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "const var x;", [P
arserErrorCode.CONST_AND_VAR]); |
| 7003 } | 7003 } |
| 7004 void test_constClass() { | 7004 void test_constClass() { |
| 7005 ParserTestCase.parse4("parseCompilationUnit", "const class C {}", [ParserErr
orCode.CONST_CLASS]); | 7005 ParserTestCase.parse5("parseCompilationUnit", "const class C {}", [ParserErr
orCode.CONST_CLASS]); |
| 7006 } | 7006 } |
| 7007 void test_constMethod() { | 7007 void test_constMethod() { |
| 7008 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "const int m() {}"
, [ParserErrorCode.CONST_METHOD]); | 7008 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "const int m() {}"
, [ParserErrorCode.CONST_METHOD]); |
| 7009 } | 7009 } |
| 7010 void test_constTypedef() { | 7010 void test_constTypedef() { |
| 7011 ParserTestCase.parse4("parseCompilationUnit", "const typedef F();", [ParserE
rrorCode.CONST_TYPEDEF]); | 7011 ParserTestCase.parse5("parseCompilationUnit", "const typedef F();", [ParserE
rrorCode.CONST_TYPEDEF]); |
| 7012 } | 7012 } |
| 7013 void test_continueOutsideOfLoop_continueInDoStatement() { | 7013 void test_continueOutsideOfLoop_continueInDoStatement() { |
| 7014 ParserTestCase.parse4("parseDoStatement", "do {continue;} while (x);", []); | 7014 ParserTestCase.parse5("parseDoStatement", "do {continue;} while (x);", []); |
| 7015 } | 7015 } |
| 7016 void test_continueOutsideOfLoop_continueInForStatement() { | 7016 void test_continueOutsideOfLoop_continueInForStatement() { |
| 7017 ParserTestCase.parse4("parseForStatement", "for (; x;) {continue;}", []); | 7017 ParserTestCase.parse5("parseForStatement", "for (; x;) {continue;}", []); |
| 7018 } | 7018 } |
| 7019 void test_continueOutsideOfLoop_continueInIfStatement() { | 7019 void test_continueOutsideOfLoop_continueInIfStatement() { |
| 7020 ParserTestCase.parse4("parseIfStatement", "if (x) {continue;}", [ParserError
Code.CONTINUE_OUTSIDE_OF_LOOP]); | 7020 ParserTestCase.parse5("parseIfStatement", "if (x) {continue;}", [ParserError
Code.CONTINUE_OUTSIDE_OF_LOOP]); |
| 7021 } | 7021 } |
| 7022 void test_continueOutsideOfLoop_continueInSwitchStatement() { | 7022 void test_continueOutsideOfLoop_continueInSwitchStatement() { |
| 7023 ParserTestCase.parse4("parseSwitchStatement", "switch (x) {case 1: continue
a;}", []); | 7023 ParserTestCase.parse5("parseSwitchStatement", "switch (x) {case 1: continue
a;}", []); |
| 7024 } | 7024 } |
| 7025 void test_continueOutsideOfLoop_continueInWhileStatement() { | 7025 void test_continueOutsideOfLoop_continueInWhileStatement() { |
| 7026 ParserTestCase.parse4("parseWhileStatement", "while (x) {continue;}", []); | 7026 ParserTestCase.parse5("parseWhileStatement", "while (x) {continue;}", []); |
| 7027 } | 7027 } |
| 7028 void test_continueOutsideOfLoop_functionExpression_inALoop() { | 7028 void test_continueOutsideOfLoop_functionExpression_inALoop() { |
| 7029 ParserTestCase.parse4("parseStatement", "for(; x;) {() {continue;};}", [Pars
erErrorCode.CONTINUE_OUTSIDE_OF_LOOP]); | 7029 ParserTestCase.parse5("parseStatement", "for(; x;) {() {continue;};}", [Pars
erErrorCode.CONTINUE_OUTSIDE_OF_LOOP]); |
| 7030 } | 7030 } |
| 7031 void test_continueOutsideOfLoop_functionExpression_withALoop() { | 7031 void test_continueOutsideOfLoop_functionExpression_withALoop() { |
| 7032 ParserTestCase.parse4("parseStatement", "() {for (; x;) {continue;}};", []); | 7032 ParserTestCase.parse5("parseStatement", "() {for (; x;) {continue;}};", []); |
| 7033 } | 7033 } |
| 7034 void test_continueWithoutLabelInCase_error() { | 7034 void test_continueWithoutLabelInCase_error() { |
| 7035 ParserTestCase.parse4("parseSwitchStatement", "switch (x) {case 1: continue;
}", [ParserErrorCode.CONTINUE_WITHOUT_LABEL_IN_CASE]); | 7035 ParserTestCase.parse5("parseSwitchStatement", "switch (x) {case 1: continue;
}", [ParserErrorCode.CONTINUE_WITHOUT_LABEL_IN_CASE]); |
| 7036 } | 7036 } |
| 7037 void test_continueWithoutLabelInCase_noError() { | 7037 void test_continueWithoutLabelInCase_noError() { |
| 7038 ParserTestCase.parse4("parseSwitchStatement", "switch (x) {case 1: continue
a;}", []); | 7038 ParserTestCase.parse5("parseSwitchStatement", "switch (x) {case 1: continue
a;}", []); |
| 7039 } | 7039 } |
| 7040 void test_continueWithoutLabelInCase_noError_switchInLoop() { | 7040 void test_continueWithoutLabelInCase_noError_switchInLoop() { |
| 7041 ParserTestCase.parse4("parseWhileStatement", "while (a) { switch (b) {defaul
t: continue;}}", []); | 7041 ParserTestCase.parse5("parseWhileStatement", "while (a) { switch (b) {defaul
t: continue;}}", []); |
| 7042 } | 7042 } |
| 7043 void test_directiveAfterDeclaration_classBeforeDirective() { | 7043 void test_directiveAfterDeclaration_classBeforeDirective() { |
| 7044 CompilationUnit unit = ParserTestCase.parse4("parseCompilationUnit", "class
Foo{} library l;", [ParserErrorCode.DIRECTIVE_AFTER_DECLARATION]); | 7044 CompilationUnit unit = ParserTestCase.parse5("parseCompilationUnit", "class
Foo{} library l;", [ParserErrorCode.DIRECTIVE_AFTER_DECLARATION]); |
| 7045 JUnitTestCase.assertNotNull(unit); | 7045 JUnitTestCase.assertNotNull(unit); |
| 7046 } | 7046 } |
| 7047 void test_directiveAfterDeclaration_classBetweenDirectives() { | 7047 void test_directiveAfterDeclaration_classBetweenDirectives() { |
| 7048 CompilationUnit unit = ParserTestCase.parse4("parseCompilationUnit", "librar
y l;\nclass Foo{}\npart 'a.dart';", [ParserErrorCode.DIRECTIVE_AFTER_DECLARATION
]); | 7048 CompilationUnit unit = ParserTestCase.parse5("parseCompilationUnit", "librar
y l;\nclass Foo{}\npart 'a.dart';", [ParserErrorCode.DIRECTIVE_AFTER_DECLARATION
]); |
| 7049 JUnitTestCase.assertNotNull(unit); | 7049 JUnitTestCase.assertNotNull(unit); |
| 7050 } | 7050 } |
| 7051 void test_duplicatedModifier_const() { | 7051 void test_duplicatedModifier_const() { |
| 7052 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "const const m;",
[ParserErrorCode.DUPLICATED_MODIFIER]); | 7052 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "const const m;",
[ParserErrorCode.DUPLICATED_MODIFIER]); |
| 7053 } | 7053 } |
| 7054 void test_duplicatedModifier_external() { | 7054 void test_duplicatedModifier_external() { |
| 7055 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "external external
f();", [ParserErrorCode.DUPLICATED_MODIFIER]); | 7055 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "external external
f();", [ParserErrorCode.DUPLICATED_MODIFIER]); |
| 7056 } | 7056 } |
| 7057 void test_duplicatedModifier_factory() { | 7057 void test_duplicatedModifier_factory() { |
| 7058 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "factory factory C
() {}", [ParserErrorCode.DUPLICATED_MODIFIER]); | 7058 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "factory factory C
() {}", [ParserErrorCode.DUPLICATED_MODIFIER]); |
| 7059 } | 7059 } |
| 7060 void test_duplicatedModifier_final() { | 7060 void test_duplicatedModifier_final() { |
| 7061 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "final final m;",
[ParserErrorCode.DUPLICATED_MODIFIER]); | 7061 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "final final m;",
[ParserErrorCode.DUPLICATED_MODIFIER]); |
| 7062 } | 7062 } |
| 7063 void test_duplicatedModifier_static() { | 7063 void test_duplicatedModifier_static() { |
| 7064 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "static static m;"
, [ParserErrorCode.DUPLICATED_MODIFIER]); | 7064 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "static static m;"
, [ParserErrorCode.DUPLICATED_MODIFIER]); |
| 7065 } | 7065 } |
| 7066 void test_duplicatedModifier_var() { | 7066 void test_duplicatedModifier_var() { |
| 7067 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "var var m;", [Par
serErrorCode.DUPLICATED_MODIFIER]); | 7067 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "var var m;", [Par
serErrorCode.DUPLICATED_MODIFIER]); |
| 7068 } | 7068 } |
| 7069 void test_duplicateLabelInSwitchStatement() { | 7069 void test_duplicateLabelInSwitchStatement() { |
| 7070 ParserTestCase.parse4("parseSwitchStatement", "switch (e) {l1: case 0: break
; l1: case 1: break;}", [ParserErrorCode.DUPLICATE_LABEL_IN_SWITCH_STATEMENT]); | 7070 ParserTestCase.parse5("parseSwitchStatement", "switch (e) {l1: case 0: break
; l1: case 1: break;}", [ParserErrorCode.DUPLICATE_LABEL_IN_SWITCH_STATEMENT]); |
| 7071 } | 7071 } |
| 7072 void test_expectedCaseOrDefault() { | 7072 void test_expectedCaseOrDefault() { |
| 7073 ParserTestCase.parse4("parseSwitchStatement", "switch (e) {break;}", [Parser
ErrorCode.EXPECTED_CASE_OR_DEFAULT]); | 7073 ParserTestCase.parse5("parseSwitchStatement", "switch (e) {break;}", [Parser
ErrorCode.EXPECTED_CASE_OR_DEFAULT]); |
| 7074 } | 7074 } |
| 7075 void test_expectedStringLiteral() { | 7075 void test_expectedStringLiteral() { |
| 7076 StringLiteral expression = ParserTestCase.parse4("parseStringLiteral", "1",
[ParserErrorCode.EXPECTED_STRING_LITERAL]); | 7076 StringLiteral expression = ParserTestCase.parse5("parseStringLiteral", "1",
[ParserErrorCode.EXPECTED_STRING_LITERAL]); |
| 7077 JUnitTestCase.assertTrue(expression.isSynthetic()); | 7077 JUnitTestCase.assertTrue(expression.isSynthetic()); |
| 7078 } | 7078 } |
| 7079 void test_expectedToken_commaMissingInArgumentList() { | 7079 void test_expectedToken_commaMissingInArgumentList() { |
| 7080 ParserTestCase.parse4("parseArgumentList", "(x, y z)", [ParserErrorCode.EXPE
CTED_TOKEN]); | 7080 ParserTestCase.parse5("parseArgumentList", "(x, y z)", [ParserErrorCode.EXPE
CTED_TOKEN]); |
| 7081 } | 7081 } |
| 7082 void test_expectedToken_semicolonMissingAfterExpression() { | 7082 void test_expectedToken_semicolonMissingAfterExpression() { |
| 7083 ParserTestCase.parse4("parseStatement", "x", [ParserErrorCode.EXPECTED_TOKEN
]); | 7083 ParserTestCase.parse5("parseStatement", "x", [ParserErrorCode.EXPECTED_TOKEN
]); |
| 7084 } | 7084 } |
| 7085 void test_expectedToken_whileMissingInDoStatement() { | 7085 void test_expectedToken_whileMissingInDoStatement() { |
| 7086 ParserTestCase.parse4("parseStatement", "do {} (x);", [ParserErrorCode.EXPEC
TED_TOKEN]); | 7086 ParserTestCase.parse5("parseStatement", "do {} (x);", [ParserErrorCode.EXPEC
TED_TOKEN]); |
| 7087 } | 7087 } |
| 7088 void test_exportDirectiveAfterPartDirective() { | 7088 void test_exportDirectiveAfterPartDirective() { |
| 7089 ParserTestCase.parse4("parseCompilationUnit", "part 'a.dart'; export 'b.dart
';", [ParserErrorCode.EXPORT_DIRECTIVE_AFTER_PART_DIRECTIVE]); | 7089 ParserTestCase.parse5("parseCompilationUnit", "part 'a.dart'; export 'b.dart
';", [ParserErrorCode.EXPORT_DIRECTIVE_AFTER_PART_DIRECTIVE]); |
| 7090 } | 7090 } |
| 7091 void test_externalAfterConst() { | 7091 void test_externalAfterConst() { |
| 7092 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "const external C(
);", [ParserErrorCode.EXTERNAL_AFTER_CONST]); | 7092 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "const external C(
);", [ParserErrorCode.EXTERNAL_AFTER_CONST]); |
| 7093 } | 7093 } |
| 7094 void test_externalAfterFactory() { | 7094 void test_externalAfterFactory() { |
| 7095 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "factory external
C();", [ParserErrorCode.EXTERNAL_AFTER_FACTORY]); | 7095 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "factory external
C();", [ParserErrorCode.EXTERNAL_AFTER_FACTORY]); |
| 7096 } | 7096 } |
| 7097 void test_externalAfterStatic() { | 7097 void test_externalAfterStatic() { |
| 7098 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "static external i
nt m();", [ParserErrorCode.EXTERNAL_AFTER_STATIC]); | 7098 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "static external i
nt m();", [ParserErrorCode.EXTERNAL_AFTER_STATIC]); |
| 7099 } | 7099 } |
| 7100 void test_externalClass() { | 7100 void test_externalClass() { |
| 7101 ParserTestCase.parse4("parseCompilationUnit", "external class C {}", [Parser
ErrorCode.EXTERNAL_CLASS]); | 7101 ParserTestCase.parse5("parseCompilationUnit", "external class C {}", [Parser
ErrorCode.EXTERNAL_CLASS]); |
| 7102 } | 7102 } |
| 7103 void test_externalConstructorWithBody_factory() { | 7103 void test_externalConstructorWithBody_factory() { |
| 7104 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "external factory
C() {}", [ParserErrorCode.EXTERNAL_CONSTRUCTOR_WITH_BODY]); | 7104 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "external factory
C() {}", [ParserErrorCode.EXTERNAL_CONSTRUCTOR_WITH_BODY]); |
| 7105 } | 7105 } |
| 7106 void test_externalConstructorWithBody_named() { | 7106 void test_externalConstructorWithBody_named() { |
| 7107 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "external C.c() {}
", [ParserErrorCode.EXTERNAL_CONSTRUCTOR_WITH_BODY]); | 7107 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "external C.c() {}
", [ParserErrorCode.EXTERNAL_CONSTRUCTOR_WITH_BODY]); |
| 7108 } | 7108 } |
| 7109 void test_externalField_const() { | 7109 void test_externalField_const() { |
| 7110 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "external const A
f;", [ParserErrorCode.EXTERNAL_FIELD]); | 7110 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "external const A
f;", [ParserErrorCode.EXTERNAL_FIELD]); |
| 7111 } | 7111 } |
| 7112 void test_externalField_final() { | 7112 void test_externalField_final() { |
| 7113 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "external final A
f;", [ParserErrorCode.EXTERNAL_FIELD]); | 7113 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "external final A
f;", [ParserErrorCode.EXTERNAL_FIELD]); |
| 7114 } | 7114 } |
| 7115 void test_externalField_static() { | 7115 void test_externalField_static() { |
| 7116 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "external static A
f;", [ParserErrorCode.EXTERNAL_FIELD]); | 7116 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "external static A
f;", [ParserErrorCode.EXTERNAL_FIELD]); |
| 7117 } | 7117 } |
| 7118 void test_externalField_typed() { | 7118 void test_externalField_typed() { |
| 7119 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "external A f;", [
ParserErrorCode.EXTERNAL_FIELD]); | 7119 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "external A f;", [
ParserErrorCode.EXTERNAL_FIELD]); |
| 7120 } | 7120 } |
| 7121 void test_externalField_untyped() { | 7121 void test_externalField_untyped() { |
| 7122 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "external var f;",
[ParserErrorCode.EXTERNAL_FIELD]); | 7122 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "external var f;",
[ParserErrorCode.EXTERNAL_FIELD]); |
| 7123 } | 7123 } |
| 7124 void test_externalGetterWithBody() { | 7124 void test_externalGetterWithBody() { |
| 7125 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "external int get
x {}", [ParserErrorCode.EXTERNAL_GETTER_WITH_BODY]); | 7125 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "external int get
x {}", [ParserErrorCode.EXTERNAL_GETTER_WITH_BODY]); |
| 7126 } | 7126 } |
| 7127 void test_externalMethodWithBody() { | 7127 void test_externalMethodWithBody() { |
| 7128 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "external m() {}",
[ParserErrorCode.EXTERNAL_METHOD_WITH_BODY]); | 7128 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "external m() {}",
[ParserErrorCode.EXTERNAL_METHOD_WITH_BODY]); |
| 7129 } | 7129 } |
| 7130 void test_externalOperatorWithBody() { | 7130 void test_externalOperatorWithBody() { |
| 7131 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "external operator
+(int value) {}", [ParserErrorCode.EXTERNAL_OPERATOR_WITH_BODY]); | 7131 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "external operator
+(int value) {}", [ParserErrorCode.EXTERNAL_OPERATOR_WITH_BODY]); |
| 7132 } | 7132 } |
| 7133 void test_externalSetterWithBody() { | 7133 void test_externalSetterWithBody() { |
| 7134 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "external set x(in
t value) {}", [ParserErrorCode.EXTERNAL_SETTER_WITH_BODY]); | 7134 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "external set x(in
t value) {}", [ParserErrorCode.EXTERNAL_SETTER_WITH_BODY]); |
| 7135 } | 7135 } |
| 7136 void test_externalTypedef() { | 7136 void test_externalTypedef() { |
| 7137 ParserTestCase.parse4("parseCompilationUnit", "external typedef F();", [Pars
erErrorCode.EXTERNAL_TYPEDEF]); | 7137 ParserTestCase.parse5("parseCompilationUnit", "external typedef F();", [Pars
erErrorCode.EXTERNAL_TYPEDEF]); |
| 7138 } | 7138 } |
| 7139 void test_factoryTopLevelDeclaration_class() { | 7139 void test_factoryTopLevelDeclaration_class() { |
| 7140 ParserTestCase.parse4("parseCompilationUnit", "factory class C {}", [ParserE
rrorCode.FACTORY_TOP_LEVEL_DECLARATION]); | 7140 ParserTestCase.parse5("parseCompilationUnit", "factory class C {}", [ParserE
rrorCode.FACTORY_TOP_LEVEL_DECLARATION]); |
| 7141 } | 7141 } |
| 7142 void test_factoryTopLevelDeclaration_typedef() { | 7142 void test_factoryTopLevelDeclaration_typedef() { |
| 7143 ParserTestCase.parse4("parseCompilationUnit", "factory typedef F();", [Parse
rErrorCode.FACTORY_TOP_LEVEL_DECLARATION]); | 7143 ParserTestCase.parse5("parseCompilationUnit", "factory typedef F();", [Parse
rErrorCode.FACTORY_TOP_LEVEL_DECLARATION]); |
| 7144 } | 7144 } |
| 7145 void test_fieldInitializerOutsideConstructor() { | 7145 void test_fieldInitializerOutsideConstructor() { |
| 7146 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "void m(this.x);",
[ParserErrorCode.FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR]); | 7146 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "void m(this.x);",
[ParserErrorCode.FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR]); |
| 7147 } | 7147 } |
| 7148 void test_finalAndVar() { | 7148 void test_finalAndVar() { |
| 7149 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "final var x;", [P
arserErrorCode.FINAL_AND_VAR]); | 7149 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "final var x;", [P
arserErrorCode.FINAL_AND_VAR]); |
| 7150 } | 7150 } |
| 7151 void test_finalClass() { | 7151 void test_finalClass() { |
| 7152 ParserTestCase.parse4("parseCompilationUnit", "final class C {}", [ParserErr
orCode.FINAL_CLASS]); | 7152 ParserTestCase.parse5("parseCompilationUnit", "final class C {}", [ParserErr
orCode.FINAL_CLASS]); |
| 7153 } | 7153 } |
| 7154 void test_finalConstructor() { | 7154 void test_finalConstructor() { |
| 7155 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "final C() {}", [P
arserErrorCode.FINAL_CONSTRUCTOR]); | 7155 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "final C() {}", [P
arserErrorCode.FINAL_CONSTRUCTOR]); |
| 7156 } | 7156 } |
| 7157 void test_finalMethod() { | 7157 void test_finalMethod() { |
| 7158 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "final int m() {}"
, [ParserErrorCode.FINAL_METHOD]); | 7158 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "final int m() {}"
, [ParserErrorCode.FINAL_METHOD]); |
| 7159 } | 7159 } |
| 7160 void test_finalTypedef() { | 7160 void test_finalTypedef() { |
| 7161 ParserTestCase.parse4("parseCompilationUnit", "final typedef F();", [ParserE
rrorCode.FINAL_TYPEDEF]); | 7161 ParserTestCase.parse5("parseCompilationUnit", "final typedef F();", [ParserE
rrorCode.FINAL_TYPEDEF]); |
| 7162 } | 7162 } |
| 7163 void test_getterWithParameters() { | 7163 void test_getterWithParameters() { |
| 7164 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "int get x() {}",
[ParserErrorCode.GETTER_WITH_PARAMETERS]); | 7164 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "int get x() {}",
[ParserErrorCode.GETTER_WITH_PARAMETERS]); |
| 7165 } | 7165 } |
| 7166 void test_illegalAssignmentToNonAssignable_superAssigned() { | 7166 void test_illegalAssignmentToNonAssignable_superAssigned() { |
| 7167 ParserTestCase.parse4("parseExpression", "super = x;", [ParserErrorCode.MISS
ING_ASSIGNABLE_SELECTOR, ParserErrorCode.ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE]); | 7167 ParserTestCase.parse5("parseExpression", "super = x;", [ParserErrorCode.MISS
ING_ASSIGNABLE_SELECTOR, ParserErrorCode.ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE]); |
| 7168 } | 7168 } |
| 7169 void test_implementsBeforeExtends() { | 7169 void test_implementsBeforeExtends() { |
| 7170 ParserTestCase.parse4("parseCompilationUnit", "class A implements B extends
C {}", [ParserErrorCode.IMPLEMENTS_BEFORE_EXTENDS]); | 7170 ParserTestCase.parse5("parseCompilationUnit", "class A implements B extends
C {}", [ParserErrorCode.IMPLEMENTS_BEFORE_EXTENDS]); |
| 7171 } | 7171 } |
| 7172 void test_implementsBeforeWith() { | 7172 void test_implementsBeforeWith() { |
| 7173 ParserTestCase.parse4("parseCompilationUnit", "class A extends B implements
C with D {}", [ParserErrorCode.IMPLEMENTS_BEFORE_WITH]); | 7173 ParserTestCase.parse5("parseCompilationUnit", "class A extends B implements
C with D {}", [ParserErrorCode.IMPLEMENTS_BEFORE_WITH]); |
| 7174 } | 7174 } |
| 7175 void test_importDirectiveAfterPartDirective() { | 7175 void test_importDirectiveAfterPartDirective() { |
| 7176 ParserTestCase.parse4("parseCompilationUnit", "part 'a.dart'; import 'b.dart
';", [ParserErrorCode.IMPORT_DIRECTIVE_AFTER_PART_DIRECTIVE]); | 7176 ParserTestCase.parse5("parseCompilationUnit", "part 'a.dart'; import 'b.dart
';", [ParserErrorCode.IMPORT_DIRECTIVE_AFTER_PART_DIRECTIVE]); |
| 7177 } | 7177 } |
| 7178 void test_initializedVariableInForEach() { | 7178 void test_initializedVariableInForEach() { |
| 7179 ParserTestCase.parse4("parseForStatement", "for (int a = 0 in foo) {}", [Par
serErrorCode.INITIALIZED_VARIABLE_IN_FOR_EACH]); | 7179 ParserTestCase.parse5("parseForStatement", "for (int a = 0 in foo) {}", [Par
serErrorCode.INITIALIZED_VARIABLE_IN_FOR_EACH]); |
| 7180 } | 7180 } |
| 7181 void test_invalidCodePoint() { | 7181 void test_invalidCodePoint() { |
| 7182 ParserTestCase.parse4("parseStringLiteral", "'\\uD900'", [ParserErrorCode.IN
VALID_CODE_POINT]); | 7182 ParserTestCase.parse5("parseStringLiteral", "'\\uD900'", [ParserErrorCode.IN
VALID_CODE_POINT]); |
| 7183 } | 7183 } |
| 7184 void test_invalidHexEscape_invalidDigit() { | 7184 void test_invalidHexEscape_invalidDigit() { |
| 7185 ParserTestCase.parse4("parseStringLiteral", "'\\x0 a'", [ParserErrorCode.INV
ALID_HEX_ESCAPE]); | 7185 ParserTestCase.parse5("parseStringLiteral", "'\\x0 a'", [ParserErrorCode.INV
ALID_HEX_ESCAPE]); |
| 7186 } | 7186 } |
| 7187 void test_invalidHexEscape_tooFewDigits() { | 7187 void test_invalidHexEscape_tooFewDigits() { |
| 7188 ParserTestCase.parse4("parseStringLiteral", "'\\x0'", [ParserErrorCode.INVAL
ID_HEX_ESCAPE]); | 7188 ParserTestCase.parse5("parseStringLiteral", "'\\x0'", [ParserErrorCode.INVAL
ID_HEX_ESCAPE]); |
| 7189 } | 7189 } |
| 7190 void test_invalidOperatorForSuper() { | 7190 void test_invalidOperatorForSuper() { |
| 7191 ParserTestCase.parse4("parseUnaryExpression", "++super", [ParserErrorCode.IN
VALID_OPERATOR_FOR_SUPER]); | 7191 ParserTestCase.parse5("parseUnaryExpression", "++super", [ParserErrorCode.IN
VALID_OPERATOR_FOR_SUPER]); |
| 7192 } | 7192 } |
| 7193 void test_invalidUnicodeEscape_incomplete_noDigits() { | 7193 void test_invalidUnicodeEscape_incomplete_noDigits() { |
| 7194 ParserTestCase.parse4("parseStringLiteral", "'\\u{'", [ParserErrorCode.INVAL
ID_UNICODE_ESCAPE]); | 7194 ParserTestCase.parse5("parseStringLiteral", "'\\u{'", [ParserErrorCode.INVAL
ID_UNICODE_ESCAPE]); |
| 7195 } | 7195 } |
| 7196 void test_invalidUnicodeEscape_incomplete_someDigits() { | 7196 void test_invalidUnicodeEscape_incomplete_someDigits() { |
| 7197 ParserTestCase.parse4("parseStringLiteral", "'\\u{0A'", [ParserErrorCode.INV
ALID_UNICODE_ESCAPE]); | 7197 ParserTestCase.parse5("parseStringLiteral", "'\\u{0A'", [ParserErrorCode.INV
ALID_UNICODE_ESCAPE]); |
| 7198 } | 7198 } |
| 7199 void test_invalidUnicodeEscape_invalidDigit() { | 7199 void test_invalidUnicodeEscape_invalidDigit() { |
| 7200 ParserTestCase.parse4("parseStringLiteral", "'\\u0 a'", [ParserErrorCode.INV
ALID_UNICODE_ESCAPE]); | 7200 ParserTestCase.parse5("parseStringLiteral", "'\\u0 a'", [ParserErrorCode.INV
ALID_UNICODE_ESCAPE]); |
| 7201 } | 7201 } |
| 7202 void test_invalidUnicodeEscape_tooFewDigits_fixed() { | 7202 void test_invalidUnicodeEscape_tooFewDigits_fixed() { |
| 7203 ParserTestCase.parse4("parseStringLiteral", "'\\u04'", [ParserErrorCode.INVA
LID_UNICODE_ESCAPE]); | 7203 ParserTestCase.parse5("parseStringLiteral", "'\\u04'", [ParserErrorCode.INVA
LID_UNICODE_ESCAPE]); |
| 7204 } | 7204 } |
| 7205 void test_invalidUnicodeEscape_tooFewDigits_variable() { | 7205 void test_invalidUnicodeEscape_tooFewDigits_variable() { |
| 7206 ParserTestCase.parse4("parseStringLiteral", "'\\u{}'", [ParserErrorCode.INVA
LID_UNICODE_ESCAPE]); | 7206 ParserTestCase.parse5("parseStringLiteral", "'\\u{}'", [ParserErrorCode.INVA
LID_UNICODE_ESCAPE]); |
| 7207 } | 7207 } |
| 7208 void test_invalidUnicodeEscape_tooManyDigits_variable() { | 7208 void test_invalidUnicodeEscape_tooManyDigits_variable() { |
| 7209 ParserTestCase.parse4("parseStringLiteral", "'\\u{12345678}'", [ParserErrorC
ode.INVALID_UNICODE_ESCAPE, ParserErrorCode.INVALID_CODE_POINT]); | 7209 ParserTestCase.parse5("parseStringLiteral", "'\\u{12345678}'", [ParserErrorC
ode.INVALID_UNICODE_ESCAPE, ParserErrorCode.INVALID_CODE_POINT]); |
| 7210 } | 7210 } |
| 7211 void test_libraryDirectiveNotFirst() { | 7211 void test_libraryDirectiveNotFirst() { |
| 7212 ParserTestCase.parse4("parseCompilationUnit", "import 'x.dart'; library l;",
[ParserErrorCode.LIBRARY_DIRECTIVE_NOT_FIRST]); | 7212 ParserTestCase.parse5("parseCompilationUnit", "import 'x.dart'; library l;",
[ParserErrorCode.LIBRARY_DIRECTIVE_NOT_FIRST]); |
| 7213 } | 7213 } |
| 7214 void test_libraryDirectiveNotFirst_afterPart() { | 7214 void test_libraryDirectiveNotFirst_afterPart() { |
| 7215 CompilationUnit unit = ParserTestCase.parse4("parseCompilationUnit", "part '
a.dart';\nlibrary l;", [ParserErrorCode.LIBRARY_DIRECTIVE_NOT_FIRST]); | 7215 CompilationUnit unit = ParserTestCase.parse5("parseCompilationUnit", "part '
a.dart';\nlibrary l;", [ParserErrorCode.LIBRARY_DIRECTIVE_NOT_FIRST]); |
| 7216 JUnitTestCase.assertNotNull(unit); | 7216 JUnitTestCase.assertNotNull(unit); |
| 7217 } | 7217 } |
| 7218 void test_missingAssignableSelector_identifiersAssigned() { | 7218 void test_missingAssignableSelector_identifiersAssigned() { |
| 7219 ParserTestCase.parse4("parseExpression", "x.y = y;", []); | 7219 ParserTestCase.parse5("parseExpression", "x.y = y;", []); |
| 7220 } | 7220 } |
| 7221 void test_missingAssignableSelector_primarySelectorPostfix() { | 7221 void test_missingAssignableSelector_primarySelectorPostfix() { |
| 7222 ParserTestCase.parse4("parseExpression", "x(y)(z)++", [ParserErrorCode.MISSI
NG_ASSIGNABLE_SELECTOR]); | 7222 ParserTestCase.parse5("parseExpression", "x(y)(z)++", [ParserErrorCode.MISSI
NG_ASSIGNABLE_SELECTOR]); |
| 7223 } | 7223 } |
| 7224 void test_missingAssignableSelector_selector() { | 7224 void test_missingAssignableSelector_selector() { |
| 7225 ParserTestCase.parse4("parseExpression", "x(y)(z).a++", []); | 7225 ParserTestCase.parse5("parseExpression", "x(y)(z).a++", []); |
| 7226 } | 7226 } |
| 7227 void test_missingAssignableSelector_superPrimaryExpression() { | 7227 void test_missingAssignableSelector_superPrimaryExpression() { |
| 7228 SuperExpression expression = ParserTestCase.parse4("parsePrimaryExpression",
"super", [ParserErrorCode.MISSING_ASSIGNABLE_SELECTOR]); | 7228 SuperExpression expression = ParserTestCase.parse5("parsePrimaryExpression",
"super", [ParserErrorCode.MISSING_ASSIGNABLE_SELECTOR]); |
| 7229 JUnitTestCase.assertNotNull(expression.keyword); | 7229 JUnitTestCase.assertNotNull(expression.keyword); |
| 7230 } | 7230 } |
| 7231 void test_missingAssignableSelector_superPropertyAccessAssigned() { | 7231 void test_missingAssignableSelector_superPropertyAccessAssigned() { |
| 7232 ParserTestCase.parse4("parseExpression", "super.x = x;", []); | 7232 ParserTestCase.parse5("parseExpression", "super.x = x;", []); |
| 7233 } | 7233 } |
| 7234 void test_missingCatchOrFinally() { | 7234 void test_missingCatchOrFinally() { |
| 7235 TryStatement statement = ParserTestCase.parse4("parseTryStatement", "try {}"
, [ParserErrorCode.MISSING_CATCH_OR_FINALLY]); | 7235 TryStatement statement = ParserTestCase.parse5("parseTryStatement", "try {}"
, [ParserErrorCode.MISSING_CATCH_OR_FINALLY]); |
| 7236 JUnitTestCase.assertNotNull(statement); | 7236 JUnitTestCase.assertNotNull(statement); |
| 7237 } | 7237 } |
| 7238 void test_missingClassBody() { | 7238 void test_missingClassBody() { |
| 7239 ParserTestCase.parse4("parseCompilationUnit", "class A class B {}", [ParserE
rrorCode.MISSING_CLASS_BODY]); | 7239 ParserTestCase.parse5("parseCompilationUnit", "class A class B {}", [ParserE
rrorCode.MISSING_CLASS_BODY]); |
| 7240 } | 7240 } |
| 7241 void test_missingConstFinalVarOrType() { | 7241 void test_missingConstFinalVarOrType() { |
| 7242 ParserTestCase.parse3("parseFinalConstVarOrType", <Object> [false], "a;", [P
arserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE]); | 7242 ParserTestCase.parse4("parseFinalConstVarOrType", <Object> [false], "a;", [P
arserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE]); |
| 7243 } | 7243 } |
| 7244 void test_missingFunctionBody_emptyNotAllowed() { | 7244 void test_missingFunctionBody_emptyNotAllowed() { |
| 7245 ParserTestCase.parse3("parseFunctionBody", <Object> [false, false], ";", [Pa
rserErrorCode.MISSING_FUNCTION_BODY]); | 7245 ParserTestCase.parse4("parseFunctionBody", <Object> [false, false], ";", [Pa
rserErrorCode.MISSING_FUNCTION_BODY]); |
| 7246 } | 7246 } |
| 7247 void test_missingFunctionBody_invalid() { | 7247 void test_missingFunctionBody_invalid() { |
| 7248 ParserTestCase.parse3("parseFunctionBody", <Object> [false, false], "return
0;", [ParserErrorCode.MISSING_FUNCTION_BODY]); | 7248 ParserTestCase.parse4("parseFunctionBody", <Object> [false, false], "return
0;", [ParserErrorCode.MISSING_FUNCTION_BODY]); |
| 7249 } | 7249 } |
| 7250 void test_missingFunctionParameters_local_void_block() { | 7250 void test_missingFunctionParameters_local_void_block() { |
| 7251 ParserTestCase.parse4("parseStatement", "void f { return x;}", [ParserErrorC
ode.MISSING_FUNCTION_PARAMETERS]); | 7251 ParserTestCase.parse5("parseStatement", "void f { return x;}", [ParserErrorC
ode.MISSING_FUNCTION_PARAMETERS]); |
| 7252 } | 7252 } |
| 7253 void test_missingFunctionParameters_local_void_expression() { | 7253 void test_missingFunctionParameters_local_void_expression() { |
| 7254 ParserTestCase.parse4("parseStatement", "void f => x;", [ParserErrorCode.MIS
SING_FUNCTION_PARAMETERS]); | 7254 ParserTestCase.parse5("parseStatement", "void f => x;", [ParserErrorCode.MIS
SING_FUNCTION_PARAMETERS]); |
| 7255 } | 7255 } |
| 7256 void test_missingFunctionParameters_topLevel_nonVoid_block() { | 7256 void test_missingFunctionParameters_topLevel_nonVoid_block() { |
| 7257 ParserTestCase.parse4("parseCompilationUnit", "int f { return x;}", [ParserE
rrorCode.MISSING_FUNCTION_PARAMETERS]); | 7257 ParserTestCase.parse5("parseCompilationUnit", "int f { return x;}", [ParserE
rrorCode.MISSING_FUNCTION_PARAMETERS]); |
| 7258 } | 7258 } |
| 7259 void test_missingFunctionParameters_topLevel_nonVoid_expression() { | 7259 void test_missingFunctionParameters_topLevel_nonVoid_expression() { |
| 7260 ParserTestCase.parse4("parseCompilationUnit", "int f => x;", [ParserErrorCod
e.MISSING_FUNCTION_PARAMETERS]); | 7260 ParserTestCase.parse5("parseCompilationUnit", "int f => x;", [ParserErrorCod
e.MISSING_FUNCTION_PARAMETERS]); |
| 7261 } | 7261 } |
| 7262 void test_missingFunctionParameters_topLevel_void_block() { | 7262 void test_missingFunctionParameters_topLevel_void_block() { |
| 7263 ParserTestCase.parse4("parseCompilationUnit", "void f { return x;}", [Parser
ErrorCode.MISSING_FUNCTION_PARAMETERS]); | 7263 ParserTestCase.parse5("parseCompilationUnit", "void f { return x;}", [Parser
ErrorCode.MISSING_FUNCTION_PARAMETERS]); |
| 7264 } | 7264 } |
| 7265 void test_missingFunctionParameters_topLevel_void_expression() { | 7265 void test_missingFunctionParameters_topLevel_void_expression() { |
| 7266 ParserTestCase.parse4("parseCompilationUnit", "void f => x;", [ParserErrorCo
de.MISSING_FUNCTION_PARAMETERS]); | 7266 ParserTestCase.parse5("parseCompilationUnit", "void f => x;", [ParserErrorCo
de.MISSING_FUNCTION_PARAMETERS]); |
| 7267 } | 7267 } |
| 7268 void test_missingIdentifier_functionDeclaration_returnTypeWithoutName() { | 7268 void test_missingIdentifier_functionDeclaration_returnTypeWithoutName() { |
| 7269 ParserTestCase.parse4("parseFunctionDeclarationStatement", "A<T> () {}", [Pa
rserErrorCode.MISSING_IDENTIFIER]); | 7269 ParserTestCase.parse5("parseFunctionDeclarationStatement", "A<T> () {}", [Pa
rserErrorCode.MISSING_IDENTIFIER]); |
| 7270 } | 7270 } |
| 7271 void test_missingIdentifier_number() { | 7271 void test_missingIdentifier_number() { |
| 7272 SimpleIdentifier expression = ParserTestCase.parse4("parseSimpleIdentifier",
"1", [ParserErrorCode.MISSING_IDENTIFIER]); | 7272 SimpleIdentifier expression = ParserTestCase.parse5("parseSimpleIdentifier",
"1", [ParserErrorCode.MISSING_IDENTIFIER]); |
| 7273 JUnitTestCase.assertTrue(expression.isSynthetic()); | 7273 JUnitTestCase.assertTrue(expression.isSynthetic()); |
| 7274 } | 7274 } |
| 7275 void test_missingNameInLibraryDirective() { | 7275 void test_missingNameInLibraryDirective() { |
| 7276 CompilationUnit unit = ParserTestCase.parse4("parseCompilationUnit", "librar
y;", [ParserErrorCode.MISSING_NAME_IN_LIBRARY_DIRECTIVE]); | 7276 CompilationUnit unit = ParserTestCase.parse5("parseCompilationUnit", "librar
y;", [ParserErrorCode.MISSING_NAME_IN_LIBRARY_DIRECTIVE]); |
| 7277 JUnitTestCase.assertNotNull(unit); | 7277 JUnitTestCase.assertNotNull(unit); |
| 7278 } | 7278 } |
| 7279 void test_missingNameInPartOfDirective() { | 7279 void test_missingNameInPartOfDirective() { |
| 7280 CompilationUnit unit = ParserTestCase.parse4("parseCompilationUnit", "part o
f;", [ParserErrorCode.MISSING_NAME_IN_PART_OF_DIRECTIVE]); | 7280 CompilationUnit unit = ParserTestCase.parse5("parseCompilationUnit", "part o
f;", [ParserErrorCode.MISSING_NAME_IN_PART_OF_DIRECTIVE]); |
| 7281 JUnitTestCase.assertNotNull(unit); | 7281 JUnitTestCase.assertNotNull(unit); |
| 7282 } | 7282 } |
| 7283 void test_missingTypedefParameters_nonVoid() { | 7283 void test_missingTypedefParameters_nonVoid() { |
| 7284 ParserTestCase.parse4("parseCompilationUnit", "typedef int F;", [ParserError
Code.MISSING_TYPEDEF_PARAMETERS]); | 7284 ParserTestCase.parse5("parseCompilationUnit", "typedef int F;", [ParserError
Code.MISSING_TYPEDEF_PARAMETERS]); |
| 7285 } | 7285 } |
| 7286 void test_missingTypedefParameters_typeParameters() { | 7286 void test_missingTypedefParameters_typeParameters() { |
| 7287 ParserTestCase.parse4("parseCompilationUnit", "typedef F<E>;", [ParserErrorC
ode.MISSING_TYPEDEF_PARAMETERS]); | 7287 ParserTestCase.parse5("parseCompilationUnit", "typedef F<E>;", [ParserErrorC
ode.MISSING_TYPEDEF_PARAMETERS]); |
| 7288 } | 7288 } |
| 7289 void test_missingTypedefParameters_void() { | 7289 void test_missingTypedefParameters_void() { |
| 7290 ParserTestCase.parse4("parseCompilationUnit", "typedef void F;", [ParserErro
rCode.MISSING_TYPEDEF_PARAMETERS]); | 7290 ParserTestCase.parse5("parseCompilationUnit", "typedef void F;", [ParserErro
rCode.MISSING_TYPEDEF_PARAMETERS]); |
| 7291 } | 7291 } |
| 7292 void test_missingVariableInForEach() { | 7292 void test_missingVariableInForEach() { |
| 7293 ParserTestCase.parse4("parseForStatement", "for (a < b in foo) {}", [ParserE
rrorCode.MISSING_VARIABLE_IN_FOR_EACH]); | 7293 ParserTestCase.parse5("parseForStatement", "for (a < b in foo) {}", [ParserE
rrorCode.MISSING_VARIABLE_IN_FOR_EACH]); |
| 7294 } | 7294 } |
| 7295 void test_mixedParameterGroups_namedPositional() { | 7295 void test_mixedParameterGroups_namedPositional() { |
| 7296 ParserTestCase.parse4("parseFormalParameterList", "(a, {b}, [c])", [ParserEr
rorCode.MIXED_PARAMETER_GROUPS]); | 7296 ParserTestCase.parse5("parseFormalParameterList", "(a, {b}, [c])", [ParserEr
rorCode.MIXED_PARAMETER_GROUPS]); |
| 7297 } | 7297 } |
| 7298 void test_mixedParameterGroups_positionalNamed() { | 7298 void test_mixedParameterGroups_positionalNamed() { |
| 7299 ParserTestCase.parse4("parseFormalParameterList", "(a, [b], {c})", [ParserEr
rorCode.MIXED_PARAMETER_GROUPS]); | 7299 ParserTestCase.parse5("parseFormalParameterList", "(a, [b], {c})", [ParserEr
rorCode.MIXED_PARAMETER_GROUPS]); |
| 7300 } | 7300 } |
| 7301 void test_multipleLibraryDirectives() { | 7301 void test_multipleLibraryDirectives() { |
| 7302 ParserTestCase.parse4("parseCompilationUnit", "library l; library m;", [Pars
erErrorCode.MULTIPLE_LIBRARY_DIRECTIVES]); | 7302 ParserTestCase.parse5("parseCompilationUnit", "library l; library m;", [Pars
erErrorCode.MULTIPLE_LIBRARY_DIRECTIVES]); |
| 7303 } | 7303 } |
| 7304 void test_multipleNamedParameterGroups() { | 7304 void test_multipleNamedParameterGroups() { |
| 7305 ParserTestCase.parse4("parseFormalParameterList", "(a, {b}, {c})", [ParserEr
rorCode.MULTIPLE_NAMED_PARAMETER_GROUPS]); | 7305 ParserTestCase.parse5("parseFormalParameterList", "(a, {b}, {c})", [ParserEr
rorCode.MULTIPLE_NAMED_PARAMETER_GROUPS]); |
| 7306 } | 7306 } |
| 7307 void test_multiplePartOfDirectives() { | 7307 void test_multiplePartOfDirectives() { |
| 7308 ParserTestCase.parse4("parseCompilationUnit", "part of l; part of m;", [Pars
erErrorCode.MULTIPLE_PART_OF_DIRECTIVES]); | 7308 ParserTestCase.parse5("parseCompilationUnit", "part of l; part of m;", [Pars
erErrorCode.MULTIPLE_PART_OF_DIRECTIVES]); |
| 7309 } | 7309 } |
| 7310 void test_multiplePositionalParameterGroups() { | 7310 void test_multiplePositionalParameterGroups() { |
| 7311 ParserTestCase.parse4("parseFormalParameterList", "(a, [b], [c])", [ParserEr
rorCode.MULTIPLE_POSITIONAL_PARAMETER_GROUPS]); | 7311 ParserTestCase.parse5("parseFormalParameterList", "(a, [b], [c])", [ParserEr
rorCode.MULTIPLE_POSITIONAL_PARAMETER_GROUPS]); |
| 7312 } | 7312 } |
| 7313 void test_multipleVariablesInForEach() { | 7313 void test_multipleVariablesInForEach() { |
| 7314 ParserTestCase.parse4("parseForStatement", "for (int a, b in foo) {}", [Pars
erErrorCode.MULTIPLE_VARIABLES_IN_FOR_EACH]); | 7314 ParserTestCase.parse5("parseForStatement", "for (int a, b in foo) {}", [Pars
erErrorCode.MULTIPLE_VARIABLES_IN_FOR_EACH]); |
| 7315 } | 7315 } |
| 7316 void test_namedParameterOutsideGroup() { | 7316 void test_namedParameterOutsideGroup() { |
| 7317 ParserTestCase.parse4("parseFormalParameterList", "(a, b : 0)", [ParserError
Code.NAMED_PARAMETER_OUTSIDE_GROUP]); | 7317 ParserTestCase.parse5("parseFormalParameterList", "(a, b : 0)", [ParserError
Code.NAMED_PARAMETER_OUTSIDE_GROUP]); |
| 7318 } | 7318 } |
| 7319 void test_nonConstructorFactory_field() { | 7319 void test_nonConstructorFactory_field() { |
| 7320 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "factory int x;",
[ParserErrorCode.NON_CONSTRUCTOR_FACTORY]); | 7320 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "factory int x;",
[ParserErrorCode.NON_CONSTRUCTOR_FACTORY]); |
| 7321 } | 7321 } |
| 7322 void test_nonConstructorFactory_method() { | 7322 void test_nonConstructorFactory_method() { |
| 7323 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "factory int m() {
}", [ParserErrorCode.NON_CONSTRUCTOR_FACTORY]); | 7323 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "factory int m() {
}", [ParserErrorCode.NON_CONSTRUCTOR_FACTORY]); |
| 7324 } | 7324 } |
| 7325 void test_nonIdentifierLibraryName_library() { | 7325 void test_nonIdentifierLibraryName_library() { |
| 7326 CompilationUnit unit = ParserTestCase.parse4("parseCompilationUnit", "librar
y 'lib';", [ParserErrorCode.NON_IDENTIFIER_LIBRARY_NAME]); | 7326 CompilationUnit unit = ParserTestCase.parse5("parseCompilationUnit", "librar
y 'lib';", [ParserErrorCode.NON_IDENTIFIER_LIBRARY_NAME]); |
| 7327 JUnitTestCase.assertNotNull(unit); | 7327 JUnitTestCase.assertNotNull(unit); |
| 7328 } | 7328 } |
| 7329 void test_nonIdentifierLibraryName_partOf() { | 7329 void test_nonIdentifierLibraryName_partOf() { |
| 7330 CompilationUnit unit = ParserTestCase.parse4("parseCompilationUnit", "part o
f 'lib';", [ParserErrorCode.NON_IDENTIFIER_LIBRARY_NAME]); | 7330 CompilationUnit unit = ParserTestCase.parse5("parseCompilationUnit", "part o
f 'lib';", [ParserErrorCode.NON_IDENTIFIER_LIBRARY_NAME]); |
| 7331 JUnitTestCase.assertNotNull(unit); | 7331 JUnitTestCase.assertNotNull(unit); |
| 7332 } | 7332 } |
| 7333 void test_nonPartOfDirectiveInPart_after() { | 7333 void test_nonPartOfDirectiveInPart_after() { |
| 7334 ParserTestCase.parse4("parseCompilationUnit", "part of l; part 'f.dart';", [
ParserErrorCode.NON_PART_OF_DIRECTIVE_IN_PART]); | 7334 ParserTestCase.parse5("parseCompilationUnit", "part of l; part 'f.dart';", [
ParserErrorCode.NON_PART_OF_DIRECTIVE_IN_PART]); |
| 7335 } | 7335 } |
| 7336 void test_nonPartOfDirectiveInPart_before() { | 7336 void test_nonPartOfDirectiveInPart_before() { |
| 7337 ParserTestCase.parse4("parseCompilationUnit", "part 'f.dart'; part of m;", [
ParserErrorCode.NON_PART_OF_DIRECTIVE_IN_PART]); | 7337 ParserTestCase.parse5("parseCompilationUnit", "part 'f.dart'; part of m;", [
ParserErrorCode.NON_PART_OF_DIRECTIVE_IN_PART]); |
| 7338 } | 7338 } |
| 7339 void test_nonUserDefinableOperator() { | 7339 void test_nonUserDefinableOperator() { |
| 7340 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "operator +=(int x
) => x + 1;", [ParserErrorCode.NON_USER_DEFINABLE_OPERATOR]); | 7340 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "operator +=(int x
) => x + 1;", [ParserErrorCode.NON_USER_DEFINABLE_OPERATOR]); |
| 7341 } | 7341 } |
| 7342 void test_positionalAfterNamedArgument() { | 7342 void test_positionalAfterNamedArgument() { |
| 7343 ParserTestCase.parse4("parseArgumentList", "(x: 1, 2)", [ParserErrorCode.POS
ITIONAL_AFTER_NAMED_ARGUMENT]); | 7343 ParserTestCase.parse5("parseArgumentList", "(x: 1, 2)", [ParserErrorCode.POS
ITIONAL_AFTER_NAMED_ARGUMENT]); |
| 7344 } | 7344 } |
| 7345 void test_positionalParameterOutsideGroup() { | 7345 void test_positionalParameterOutsideGroup() { |
| 7346 ParserTestCase.parse4("parseFormalParameterList", "(a, b = 0)", [ParserError
Code.POSITIONAL_PARAMETER_OUTSIDE_GROUP]); | 7346 ParserTestCase.parse5("parseFormalParameterList", "(a, b = 0)", [ParserError
Code.POSITIONAL_PARAMETER_OUTSIDE_GROUP]); |
| 7347 } | 7347 } |
| 7348 void test_staticAfterConst() { | 7348 void test_staticAfterConst() { |
| 7349 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "final static int
f;", [ParserErrorCode.STATIC_AFTER_FINAL]); | 7349 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "final static int
f;", [ParserErrorCode.STATIC_AFTER_FINAL]); |
| 7350 } | 7350 } |
| 7351 void test_staticAfterFinal() { | 7351 void test_staticAfterFinal() { |
| 7352 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "const static int
f;", [ParserErrorCode.STATIC_AFTER_CONST]); | 7352 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "const static int
f;", [ParserErrorCode.STATIC_AFTER_CONST]); |
| 7353 } | 7353 } |
| 7354 void test_staticAfterVar() { | 7354 void test_staticAfterVar() { |
| 7355 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "var static f;", [
ParserErrorCode.STATIC_AFTER_VAR]); | 7355 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "var static f;", [
ParserErrorCode.STATIC_AFTER_VAR]); |
| 7356 } | 7356 } |
| 7357 void test_staticConstructor() { | 7357 void test_staticConstructor() { |
| 7358 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "static C.m() {}",
[ParserErrorCode.STATIC_CONSTRUCTOR]); | 7358 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "static C.m() {}",
[ParserErrorCode.STATIC_CONSTRUCTOR]); |
| 7359 } | 7359 } |
| 7360 void test_staticOperator_noReturnType() { | 7360 void test_staticOperator_noReturnType() { |
| 7361 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "static operator +
(int x) => x + 1;", [ParserErrorCode.STATIC_OPERATOR]); | 7361 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "static operator +
(int x) => x + 1;", [ParserErrorCode.STATIC_OPERATOR]); |
| 7362 } | 7362 } |
| 7363 void test_staticOperator_returnType() { | 7363 void test_staticOperator_returnType() { |
| 7364 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "static int operat
or +(int x) => x + 1;", [ParserErrorCode.STATIC_OPERATOR]); | 7364 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "static int operat
or +(int x) => x + 1;", [ParserErrorCode.STATIC_OPERATOR]); |
| 7365 } | 7365 } |
| 7366 void test_staticTopLevelDeclaration_class() { | 7366 void test_staticTopLevelDeclaration_class() { |
| 7367 ParserTestCase.parse4("parseCompilationUnit", "static class C {}", [ParserEr
rorCode.STATIC_TOP_LEVEL_DECLARATION]); | 7367 ParserTestCase.parse5("parseCompilationUnit", "static class C {}", [ParserEr
rorCode.STATIC_TOP_LEVEL_DECLARATION]); |
| 7368 } | 7368 } |
| 7369 void test_staticTopLevelDeclaration_typedef() { | 7369 void test_staticTopLevelDeclaration_typedef() { |
| 7370 ParserTestCase.parse4("parseCompilationUnit", "static typedef F();", [Parser
ErrorCode.STATIC_TOP_LEVEL_DECLARATION]); | 7370 ParserTestCase.parse5("parseCompilationUnit", "static typedef F();", [Parser
ErrorCode.STATIC_TOP_LEVEL_DECLARATION]); |
| 7371 } | 7371 } |
| 7372 void test_staticTopLevelDeclaration_variable() { | 7372 void test_staticTopLevelDeclaration_variable() { |
| 7373 ParserTestCase.parse4("parseCompilationUnit", "static var x;", [ParserErrorC
ode.STATIC_TOP_LEVEL_DECLARATION]); | 7373 ParserTestCase.parse5("parseCompilationUnit", "static var x;", [ParserErrorC
ode.STATIC_TOP_LEVEL_DECLARATION]); |
| 7374 } | 7374 } |
| 7375 void test_unexpectedToken_semicolonBetweenClassMembers() { | 7375 void test_unexpectedToken_semicolonBetweenClassMembers() { |
| 7376 ParserTestCase.parse3("parseClassDeclaration", <Object> [emptyCommentAndMeta
data(), null], "class C { int x; ; int y;}", [ParserErrorCode.UNEXPECTED_TOKEN])
; | 7376 ParserTestCase.parse4("parseClassDeclaration", <Object> [emptyCommentAndMeta
data(), null], "class C { int x; ; int y;}", [ParserErrorCode.UNEXPECTED_TOKEN])
; |
| 7377 } | 7377 } |
| 7378 void test_unexpectedToken_semicolonBetweenCompilationUnitMembers() { | 7378 void test_unexpectedToken_semicolonBetweenCompilationUnitMembers() { |
| 7379 ParserTestCase.parse4("parseCompilationUnit", "int x; ; int y;", [ParserErro
rCode.UNEXPECTED_TOKEN]); | 7379 ParserTestCase.parse5("parseCompilationUnit", "int x; ; int y;", [ParserErro
rCode.UNEXPECTED_TOKEN]); |
| 7380 } | 7380 } |
| 7381 void test_useOfUnaryPlusOperator() { | 7381 void test_useOfUnaryPlusOperator() { |
| 7382 ParserTestCase.parse4("parseUnaryExpression", "+x", [ParserErrorCode.USE_OF_
UNARY_PLUS_OPERATOR]); | 7382 ParserTestCase.parse5("parseUnaryExpression", "+x", [ParserErrorCode.USE_OF_
UNARY_PLUS_OPERATOR]); |
| 7383 } | 7383 } |
| 7384 void test_varClass() { | 7384 void test_varClass() { |
| 7385 ParserTestCase.parse4("parseCompilationUnit", "var class C {}", [ParserError
Code.VAR_CLASS]); | 7385 ParserTestCase.parse5("parseCompilationUnit", "var class C {}", [ParserError
Code.VAR_CLASS]); |
| 7386 } | 7386 } |
| 7387 void test_varConstructor() { | 7387 void test_varConstructor() { |
| 7388 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "var C() {}", [Par
serErrorCode.CONSTRUCTOR_WITH_RETURN_TYPE]); | 7388 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "var C() {}", [Par
serErrorCode.CONSTRUCTOR_WITH_RETURN_TYPE]); |
| 7389 } | 7389 } |
| 7390 void test_varReturnType() { | 7390 void test_varReturnType() { |
| 7391 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "var m() {}", [Par
serErrorCode.VAR_RETURN_TYPE]); | 7391 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "var m() {}", [Par
serErrorCode.VAR_RETURN_TYPE]); |
| 7392 } | 7392 } |
| 7393 void test_varTypedef() { | 7393 void test_varTypedef() { |
| 7394 ParserTestCase.parse4("parseCompilationUnit", "var typedef F();", [ParserErr
orCode.VAR_TYPEDEF]); | 7394 ParserTestCase.parse5("parseCompilationUnit", "var typedef F();", [ParserErr
orCode.VAR_TYPEDEF]); |
| 7395 } | 7395 } |
| 7396 void test_voidField_initializer() { | 7396 void test_voidField_initializer() { |
| 7397 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "void x = 0;", [Pa
rserErrorCode.VOID_VARIABLE]); | 7397 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "void x = 0;", [Pa
rserErrorCode.VOID_VARIABLE]); |
| 7398 } | 7398 } |
| 7399 void test_voidField_noInitializer() { | 7399 void test_voidField_noInitializer() { |
| 7400 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "void x;", [Parser
ErrorCode.VOID_VARIABLE]); | 7400 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "void x;", [Parser
ErrorCode.VOID_VARIABLE]); |
| 7401 } | 7401 } |
| 7402 void test_voidParameter() { | 7402 void test_voidParameter() { |
| 7403 ParserTestCase.parse4("parseNormalFormalParameter", "void a)", [ParserErrorC
ode.VOID_PARAMETER]); | 7403 ParserTestCase.parse5("parseNormalFormalParameter", "void a)", [ParserErrorC
ode.VOID_PARAMETER]); |
| 7404 } | 7404 } |
| 7405 void test_withBeforeExtends() { | 7405 void test_withBeforeExtends() { |
| 7406 ParserTestCase.parse4("parseCompilationUnit", "class A with B extends C {}",
[ParserErrorCode.WITH_BEFORE_EXTENDS]); | 7406 ParserTestCase.parse5("parseCompilationUnit", "class A with B extends C {}",
[ParserErrorCode.WITH_BEFORE_EXTENDS]); |
| 7407 } | 7407 } |
| 7408 void test_withWithoutExtends() { | 7408 void test_withWithoutExtends() { |
| 7409 ParserTestCase.parse3("parseClassDeclaration", <Object> [emptyCommentAndMeta
data(), null], "class A with B, C {}", [ParserErrorCode.WITH_WITHOUT_EXTENDS]); | 7409 ParserTestCase.parse4("parseClassDeclaration", <Object> [emptyCommentAndMeta
data(), null], "class A with B, C {}", [ParserErrorCode.WITH_WITHOUT_EXTENDS]); |
| 7410 } | 7410 } |
| 7411 void test_wrongSeparatorForNamedParameter() { | 7411 void test_wrongSeparatorForNamedParameter() { |
| 7412 ParserTestCase.parse4("parseFormalParameterList", "(a, {b = 0})", [ParserErr
orCode.WRONG_SEPARATOR_FOR_NAMED_PARAMETER]); | 7412 ParserTestCase.parse5("parseFormalParameterList", "(a, {b = 0})", [ParserErr
orCode.WRONG_SEPARATOR_FOR_NAMED_PARAMETER]); |
| 7413 } | 7413 } |
| 7414 void test_wrongSeparatorForPositionalParameter() { | 7414 void test_wrongSeparatorForPositionalParameter() { |
| 7415 ParserTestCase.parse4("parseFormalParameterList", "(a, [b : 0])", [ParserErr
orCode.WRONG_SEPARATOR_FOR_POSITIONAL_PARAMETER]); | 7415 ParserTestCase.parse5("parseFormalParameterList", "(a, [b : 0])", [ParserErr
orCode.WRONG_SEPARATOR_FOR_POSITIONAL_PARAMETER]); |
| 7416 } | 7416 } |
| 7417 static dartSuite() { | 7417 static dartSuite() { |
| 7418 _ut.group('ErrorParserTest', () { | 7418 _ut.group('ErrorParserTest', () { |
| 7419 _ut.test('test_abstractClassMember_constructor', () { | 7419 _ut.test('test_abstractClassMember_constructor', () { |
| 7420 final __test = new ErrorParserTest(); | 7420 final __test = new ErrorParserTest(); |
| 7421 runJUnitTest(__test, __test.test_abstractClassMember_constructor); | 7421 runJUnitTest(__test, __test.test_abstractClassMember_constructor); |
| 7422 }); | 7422 }); |
| 7423 _ut.test('test_abstractClassMember_field', () { | 7423 _ut.test('test_abstractClassMember_field', () { |
| 7424 final __test = new ErrorParserTest(); | 7424 final __test = new ErrorParserTest(); |
| 7425 runJUnitTest(__test, __test.test_abstractClassMember_field); | 7425 runJUnitTest(__test, __test.test_abstractClassMember_field); |
| (...skipping 783 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8209 'validateModifiersForTopLevelFunction_1': new MethodTrampoline(1, (Parser targ
et, arg0) => target.validateModifiersForTopLevelFunction(arg0)), | 8209 '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)), | 8210 'validateModifiersForTopLevelVariable_1': new MethodTrampoline(1, (Parser targ
et, arg0) => target.validateModifiersForTopLevelVariable(arg0)), |
| 8211 'validateModifiersForTypedef_1': new MethodTrampoline(1, (Parser target, arg0)
=> target.validateModifiersForTypedef(arg0)),}; | 8211 'validateModifiersForTypedef_1': new MethodTrampoline(1, (Parser target, arg0)
=> target.validateModifiersForTypedef(arg0)),}; |
| 8212 | 8212 |
| 8213 | 8213 |
| 8214 Object invokeParserMethodImpl(Parser parser, String methodName, List<Object> obj
ects, Token tokenStream) { | 8214 Object invokeParserMethodImpl(Parser parser, String methodName, List<Object> obj
ects, Token tokenStream) { |
| 8215 parser.currentToken = tokenStream; | 8215 parser.currentToken = tokenStream; |
| 8216 MethodTrampoline method = _methodTable_Parser['${methodName}_${objects.length}
']; | 8216 MethodTrampoline method = _methodTable_Parser['${methodName}_${objects.length}
']; |
| 8217 return method.invoke(parser, objects); | 8217 return method.invoke(parser, objects); |
| 8218 } | 8218 } |
| OLD | NEW |