| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 library analyzer.test.generated.all_the_rest_test; | 5 library analyzer.test.generated.all_the_rest_test; |
| 6 | 6 |
| 7 import 'package:analyzer/dart/ast/ast.dart'; | 7 import 'package:analyzer/dart/ast/ast.dart'; |
| 8 import 'package:analyzer/dart/ast/token.dart'; | 8 import 'package:analyzer/dart/ast/token.dart'; |
| 9 import 'package:analyzer/dart/element/element.dart'; | 9 import 'package:analyzer/dart/element/element.dart'; |
| 10 import 'package:analyzer/dart/element/type.dart'; | 10 import 'package:analyzer/dart/element/type.dart'; |
| (...skipping 3886 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3897 } | 3897 } |
| 3898 | 3898 |
| 3899 void test_whileStatement_true_return() { | 3899 void test_whileStatement_true_return() { |
| 3900 _assertTrue("{ while (true) { return null; } }"); | 3900 _assertTrue("{ while (true) { return null; } }"); |
| 3901 } | 3901 } |
| 3902 | 3902 |
| 3903 void test_whileStatement_true_throw() { | 3903 void test_whileStatement_true_throw() { |
| 3904 _assertTrue("{ while (true) { throw ''; } }"); | 3904 _assertTrue("{ while (true) { throw ''; } }"); |
| 3905 } | 3905 } |
| 3906 | 3906 |
| 3907 void test_whileStatement_true_break_and_throw() { |
| 3908 _assertFalse("{ while (true) { if (1==1) break; throw 'T'; } }"); |
| 3909 } |
| 3910 |
| 3907 void _assertFalse(String source) { | 3911 void _assertFalse(String source) { |
| 3908 _assertHasReturn(false, source); | 3912 _assertHasReturn(false, source); |
| 3909 } | 3913 } |
| 3910 | 3914 |
| 3911 void _assertHasReturn(bool expectedResult, String source) { | 3915 void _assertHasReturn(bool expectedResult, String source) { |
| 3912 Statement statement = ParserTestCase.parseStatement(source); | 3916 Statement statement = ParserTestCase.parseStatement(source); |
| 3913 expect(ExitDetector.exits(statement), expectedResult); | 3917 expect(ExitDetector.exits(statement), expectedResult); |
| 3914 } | 3918 } |
| 3915 | 3919 |
| 3916 void _assertTrue(String source) { | 3920 void _assertTrue(String source) { |
| (...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4456 expect(UriKind.fromEncoding(0x70), same(UriKind.PACKAGE_URI)); | 4460 expect(UriKind.fromEncoding(0x70), same(UriKind.PACKAGE_URI)); |
| 4457 expect(UriKind.fromEncoding(0x58), same(null)); | 4461 expect(UriKind.fromEncoding(0x58), same(null)); |
| 4458 } | 4462 } |
| 4459 | 4463 |
| 4460 void test_getEncoding() { | 4464 void test_getEncoding() { |
| 4461 expect(UriKind.DART_URI.encoding, 0x64); | 4465 expect(UriKind.DART_URI.encoding, 0x64); |
| 4462 expect(UriKind.FILE_URI.encoding, 0x66); | 4466 expect(UriKind.FILE_URI.encoding, 0x66); |
| 4463 expect(UriKind.PACKAGE_URI.encoding, 0x70); | 4467 expect(UriKind.PACKAGE_URI.encoding, 0x70); |
| 4464 } | 4468 } |
| 4465 } | 4469 } |
| OLD | NEW |