| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 import "package:expect/expect.dart"; | 5 import "package:expect/expect.dart"; |
| 6 import 'parser_helper.dart'; | 6 import 'parser_helper.dart'; |
| 7 import '../../../sdk/lib/_internal/compiler/implementation/tree/tree.dart'; | 7 import '../../../sdk/lib/_internal/compiler/implementation/tree/tree.dart'; |
| 8 | 8 |
| 9 void testStatement(String statement) { | 9 void testStatement(String statement) { |
| 10 Node node = parseStatement(statement); | 10 Node node = parseStatement(statement); |
| (...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 parse() { | 299 parse() { |
| 300 fullParseUnit(source, diagnosticHandler: new Collector()); | 300 fullParseUnit(source, diagnosticHandler: new Collector()); |
| 301 } | 301 } |
| 302 check(Collector c) { | 302 check(Collector c) { |
| 303 Expect.equals(EOF_TOKEN, c.token); | 303 Expect.equals(EOF_TOKEN, c.token); |
| 304 return true; | 304 return true; |
| 305 } | 305 } |
| 306 Expect.throws(parse, check); | 306 Expect.throws(parse, check); |
| 307 } | 307 } |
| 308 | 308 |
| 309 void testUnmatchedAngleBracket() { |
| 310 final String source = 'A<'; // unmatched '<' |
| 311 parse() { |
| 312 fullParseUnit(source, diagnosticHandler: new Collector()); |
| 313 } |
| 314 check(Collector c) { |
| 315 Expect.equals(LT_TOKEN, c.token); |
| 316 return true; |
| 317 } |
| 318 Expect.throws(parse, check); |
| 319 } |
| 320 |
| 309 void main() { | 321 void main() { |
| 310 testGenericTypes(); | 322 testGenericTypes(); |
| 311 // TODO(ahe): Enable this test when we handle library prefixes. | 323 // TODO(ahe): Enable this test when we handle library prefixes. |
| 312 // testPrefixedGenericTypes(); | 324 // testPrefixedGenericTypes(); |
| 313 testUnaryExpression(); | 325 testUnaryExpression(); |
| 314 testChainedMethodCalls(); | 326 testChainedMethodCalls(); |
| 315 testFunctionStatement(); | 327 testFunctionStatement(); |
| 316 testDoStatement(); | 328 testDoStatement(); |
| 317 testWhileStatement(); | 329 testWhileStatement(); |
| 318 testConditionalExpression(); | 330 testConditionalExpression(); |
| 319 testAssignment(); | 331 testAssignment(); |
| 320 testIndex(); | 332 testIndex(); |
| 321 testPostfix(); | 333 testPostfix(); |
| 322 testOperatorParse(); | 334 testOperatorParse(); |
| 323 testMissingCloseParen(); | 335 testMissingCloseParen(); |
| 324 testMissingCloseBraceInClass(); | 336 testMissingCloseBraceInClass(); |
| 337 testUnmatchedAngleBracket(); |
| 325 } | 338 } |
| OLD | NEW |