Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(346)

Side by Side Diff: pkg/analyzer/test/generated/parser_test.dart

Issue 2140673004: Generalize the first argument in an assert to be an expression (issue 26865) (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « pkg/analyzer/lib/src/generated/parser.dart ('k') | tests/corelib/corelib.status » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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.parser_test; 5 library analyzer.test.generated.parser_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/ast/visitor.dart'; 9 import 'package:analyzer/dart/ast/visitor.dart';
10 import 'package:analyzer/src/dart/ast/token.dart'; 10 import 'package:analyzer/src/dart/ast/token.dart';
(...skipping 699 matching lines...) Expand 10 before | Expand all | Expand 10 after
710 void test_annotationOnEnumConstant_first() { 710 void test_annotationOnEnumConstant_first() {
711 ParserTestCase.parseCompilationUnit("enum E { @override C }", 711 ParserTestCase.parseCompilationUnit("enum E { @override C }",
712 [ParserErrorCode.ANNOTATION_ON_ENUM_CONSTANT]); 712 [ParserErrorCode.ANNOTATION_ON_ENUM_CONSTANT]);
713 } 713 }
714 714
715 void test_annotationOnEnumConstant_middle() { 715 void test_annotationOnEnumConstant_middle() {
716 ParserTestCase.parseCompilationUnit("enum E { C, @override D, E }", 716 ParserTestCase.parseCompilationUnit("enum E { C, @override D, E }",
717 [ParserErrorCode.ANNOTATION_ON_ENUM_CONSTANT]); 717 [ParserErrorCode.ANNOTATION_ON_ENUM_CONSTANT]);
718 } 718 }
719 719
720 void test_assertDoesNotTakeAssignment() {
721 parse4("parseAssertStatement", "assert(b = true);",
722 [ParserErrorCode.ASSERT_DOES_NOT_TAKE_ASSIGNMENT]);
723 }
724
725 void test_assertDoesNotTakeCascades() {
726 parse4("parseAssertStatement", "assert(new A()..m());",
727 [ParserErrorCode.ASSERT_DOES_NOT_TAKE_CASCADE]);
728 }
729
730 void test_assertDoesNotTakeRethrow() {
731 parse4("parseAssertStatement", "assert(rethrow);",
732 [ParserErrorCode.ASSERT_DOES_NOT_TAKE_RETHROW]);
733 }
734
735 void test_assertDoesNotTakeThrow() {
736 parse4("parseAssertStatement", "assert(throw x);",
737 [ParserErrorCode.ASSERT_DOES_NOT_TAKE_THROW]);
738 }
739
740 void test_breakOutsideOfLoop_breakInDoStatement() { 720 void test_breakOutsideOfLoop_breakInDoStatement() {
741 parse4("parseDoStatement", "do {break;} while (x);"); 721 parse4("parseDoStatement", "do {break;} while (x);");
742 } 722 }
743 723
744 void test_breakOutsideOfLoop_breakInForStatement() { 724 void test_breakOutsideOfLoop_breakInForStatement() {
745 parse4("parseForStatement", "for (; x;) {break;}"); 725 parse4("parseForStatement", "for (; x;) {break;}");
746 } 726 }
747 727
748 void test_breakOutsideOfLoop_breakInIfStatement() { 728 void test_breakOutsideOfLoop_breakInIfStatement() {
749 parse4("parseIfStatement", "if (x) {break;}", 729 parse4("parseIfStatement", "if (x) {break;}",
(...skipping 10556 matching lines...) Expand 10 before | Expand all | Expand 10 after
11306 new Scanner(null, new CharSequenceReader(source), listener); 11286 new Scanner(null, new CharSequenceReader(source), listener);
11307 Token tokenStream = scanner.tokenize(); 11287 Token tokenStream = scanner.tokenize();
11308 // 11288 //
11309 // Parse the source. 11289 // Parse the source.
11310 // 11290 //
11311 Parser parser = new Parser(null, listener); 11291 Parser parser = new Parser(null, listener);
11312 return invokeParserMethodImpl( 11292 return invokeParserMethodImpl(
11313 parser, methodName, <Object>[tokenStream], tokenStream) as Token; 11293 parser, methodName, <Object>[tokenStream], tokenStream) as Token;
11314 } 11294 }
11315 } 11295 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/generated/parser.dart ('k') | tests/corelib/corelib.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698