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

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

Issue 1026093002: Fix hints in the analyzer package. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 9 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 | Annotate | Revision Log
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 // This code was auto-generated, is not intended to be edited, and is subject to 5 // This code was auto-generated, is not intended to be edited, and is subject to
6 // significant change. Please see the README file for more information. 6 // significant change. Please see the README file for more information.
7 7
8 library engine.ast_test; 8 library engine.ast_test;
9 9
10 import 'package:analyzer/src/generated/ast.dart'; 10 import 'package:analyzer/src/generated/ast.dart';
(...skipping 710 matching lines...) Expand 10 before | Expand all | Expand 10 after
721 expect(firstNode.parent, same(parent)); 721 expect(firstNode.parent, same(parent));
722 expect(secondNode.parent, same(parent)); 722 expect(secondNode.parent, same(parent));
723 expect(thirdNode.parent, same(parent)); 723 expect(thirdNode.parent, same(parent));
724 } 724 }
725 725
726 void test_add_negative() { 726 void test_add_negative() {
727 NodeList<AstNode> list = new NodeList<AstNode>(AstFactory.argumentList()); 727 NodeList<AstNode> list = new NodeList<AstNode>(AstFactory.argumentList());
728 try { 728 try {
729 list.insert(-1, AstFactory.booleanLiteral(true)); 729 list.insert(-1, AstFactory.booleanLiteral(true));
730 fail("Expected IndexOutOfBoundsException"); 730 fail("Expected IndexOutOfBoundsException");
731 } on RangeError catch (exception) { 731 } on RangeError {
732 // Expected 732 // Expected
733 } 733 }
734 } 734 }
735 735
736 void test_add_tooBig() { 736 void test_add_tooBig() {
737 NodeList<AstNode> list = new NodeList<AstNode>(AstFactory.argumentList()); 737 NodeList<AstNode> list = new NodeList<AstNode>(AstFactory.argumentList());
738 try { 738 try {
739 list.insert(1, AstFactory.booleanLiteral(true)); 739 list.insert(1, AstFactory.booleanLiteral(true));
740 fail("Expected IndexOutOfBoundsException"); 740 fail("Expected IndexOutOfBoundsException");
741 } on RangeError catch (exception) { 741 } on RangeError {
742 // Expected 742 // Expected
743 } 743 }
744 } 744 }
745 745
746 void test_addAll() { 746 void test_addAll() {
747 AstNode parent = AstFactory.argumentList(); 747 AstNode parent = AstFactory.argumentList();
748 List<AstNode> firstNodes = new List<AstNode>(); 748 List<AstNode> firstNodes = new List<AstNode>();
749 AstNode firstNode = AstFactory.booleanLiteral(true); 749 AstNode firstNode = AstFactory.booleanLiteral(true);
750 AstNode secondNode = AstFactory.booleanLiteral(false); 750 AstNode secondNode = AstFactory.booleanLiteral(false);
751 firstNodes.add(firstNode); 751 firstNodes.add(firstNode);
(...skipping 28 matching lines...) Expand all
780 expect(list, isNotNull); 780 expect(list, isNotNull);
781 expect(list, hasLength(0)); 781 expect(list, hasLength(0));
782 expect(list.owner, same(owner)); 782 expect(list.owner, same(owner));
783 } 783 }
784 784
785 void test_get_negative() { 785 void test_get_negative() {
786 NodeList<AstNode> list = new NodeList<AstNode>(AstFactory.argumentList()); 786 NodeList<AstNode> list = new NodeList<AstNode>(AstFactory.argumentList());
787 try { 787 try {
788 list[-1]; 788 list[-1];
789 fail("Expected IndexOutOfBoundsException"); 789 fail("Expected IndexOutOfBoundsException");
790 } on RangeError catch (exception) { 790 } on RangeError {
791 // Expected 791 // Expected
792 } 792 }
793 } 793 }
794 794
795 void test_get_tooBig() { 795 void test_get_tooBig() {
796 NodeList<AstNode> list = new NodeList<AstNode>(AstFactory.argumentList()); 796 NodeList<AstNode> list = new NodeList<AstNode>(AstFactory.argumentList());
797 try { 797 try {
798 list[1]; 798 list[1];
799 fail("Expected IndexOutOfBoundsException"); 799 fail("Expected IndexOutOfBoundsException");
800 } on RangeError catch (exception) { 800 } on RangeError {
801 // Expected 801 // Expected
802 } 802 }
803 } 803 }
804 804
805 void test_getBeginToken_empty() { 805 void test_getBeginToken_empty() {
806 NodeList<AstNode> list = new NodeList<AstNode>(AstFactory.argumentList()); 806 NodeList<AstNode> list = new NodeList<AstNode>(AstFactory.argumentList());
807 expect(list.beginToken, isNull); 807 expect(list.beginToken, isNull);
808 } 808 }
809 809
810 void test_getBeginToken_nonEmpty() { 810 void test_getBeginToken_nonEmpty() {
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
862 expect(list, hasLength(2)); 862 expect(list, hasLength(2));
863 expect(list[0], same(firstNode)); 863 expect(list[0], same(firstNode));
864 expect(list[1], same(thirdNode)); 864 expect(list[1], same(thirdNode));
865 } 865 }
866 866
867 void test_remove_negative() { 867 void test_remove_negative() {
868 NodeList<AstNode> list = new NodeList<AstNode>(AstFactory.argumentList()); 868 NodeList<AstNode> list = new NodeList<AstNode>(AstFactory.argumentList());
869 try { 869 try {
870 list.removeAt(-1); 870 list.removeAt(-1);
871 fail("Expected IndexOutOfBoundsException"); 871 fail("Expected IndexOutOfBoundsException");
872 } on RangeError catch (exception) { 872 } on RangeError {
873 // Expected 873 // Expected
874 } 874 }
875 } 875 }
876 876
877 void test_remove_tooBig() { 877 void test_remove_tooBig() {
878 NodeList<AstNode> list = new NodeList<AstNode>(AstFactory.argumentList()); 878 NodeList<AstNode> list = new NodeList<AstNode>(AstFactory.argumentList());
879 try { 879 try {
880 list.removeAt(1); 880 list.removeAt(1);
881 fail("Expected IndexOutOfBoundsException"); 881 fail("Expected IndexOutOfBoundsException");
882 } on RangeError catch (exception) { 882 } on RangeError {
883 // Expected 883 // Expected
884 } 884 }
885 } 885 }
886 886
887 void test_set() { 887 void test_set() {
888 List<AstNode> nodes = new List<AstNode>(); 888 List<AstNode> nodes = new List<AstNode>();
889 AstNode firstNode = AstFactory.booleanLiteral(true); 889 AstNode firstNode = AstFactory.booleanLiteral(true);
890 AstNode secondNode = AstFactory.booleanLiteral(false); 890 AstNode secondNode = AstFactory.booleanLiteral(false);
891 AstNode thirdNode = AstFactory.booleanLiteral(true); 891 AstNode thirdNode = AstFactory.booleanLiteral(true);
892 nodes.add(firstNode); 892 nodes.add(firstNode);
893 nodes.add(secondNode); 893 nodes.add(secondNode);
894 nodes.add(thirdNode); 894 nodes.add(thirdNode);
895 NodeList<AstNode> list = new NodeList<AstNode>(AstFactory.argumentList()); 895 NodeList<AstNode> list = new NodeList<AstNode>(AstFactory.argumentList());
896 list.addAll(nodes); 896 list.addAll(nodes);
897 expect(list, hasLength(3)); 897 expect(list, hasLength(3));
898 AstNode fourthNode = AstFactory.integer(0); 898 AstNode fourthNode = AstFactory.integer(0);
899 expect(javaListSet(list, 1, fourthNode), same(secondNode)); 899 expect(javaListSet(list, 1, fourthNode), same(secondNode));
900 expect(list, hasLength(3)); 900 expect(list, hasLength(3));
901 expect(list[0], same(firstNode)); 901 expect(list[0], same(firstNode));
902 expect(list[1], same(fourthNode)); 902 expect(list[1], same(fourthNode));
903 expect(list[2], same(thirdNode)); 903 expect(list[2], same(thirdNode));
904 } 904 }
905 905
906 void test_set_negative() { 906 void test_set_negative() {
907 AstNode node = AstFactory.booleanLiteral(true); 907 AstNode node = AstFactory.booleanLiteral(true);
908 NodeList<AstNode> list = new NodeList<AstNode>(AstFactory.argumentList()); 908 NodeList<AstNode> list = new NodeList<AstNode>(AstFactory.argumentList());
909 try { 909 try {
910 javaListSet(list, -1, node); 910 javaListSet(list, -1, node);
911 fail("Expected IndexOutOfBoundsException"); 911 fail("Expected IndexOutOfBoundsException");
912 } on RangeError catch (exception) { 912 } on RangeError {
913 // Expected 913 // Expected
914 } 914 }
915 } 915 }
916 916
917 void test_set_tooBig() { 917 void test_set_tooBig() {
918 AstNode node = AstFactory.booleanLiteral(true); 918 AstNode node = AstFactory.booleanLiteral(true);
919 NodeList<AstNode> list = new NodeList<AstNode>(AstFactory.argumentList()); 919 NodeList<AstNode> list = new NodeList<AstNode>(AstFactory.argumentList());
920 try { 920 try {
921 javaListSet(list, 1, node); 921 javaListSet(list, 1, node);
922 fail("Expected IndexOutOfBoundsException"); 922 fail("Expected IndexOutOfBoundsException");
923 } on RangeError catch (exception) { 923 } on RangeError {
924 // Expected 924 // Expected
925 } 925 }
926 } 926 }
927 } 927 }
928 928
929 @reflectiveTest 929 @reflectiveTest
930 class NodeLocatorTest extends ParserTestCase { 930 class NodeLocatorTest extends ParserTestCase {
931 void test_range() { 931 void test_range() {
932 CompilationUnit unit = 932 CompilationUnit unit =
933 ParserTestCase.parseCompilationUnit("library myLib;"); 933 ParserTestCase.parseCompilationUnit("library myLib;");
(...skipping 2305 matching lines...) Expand 10 before | Expand all | Expand 10 after
3239 static const List<WrapperKind> values = const [ 3239 static const List<WrapperKind> values = const [
3240 PREFIXED_LEFT, 3240 PREFIXED_LEFT,
3241 PREFIXED_RIGHT, 3241 PREFIXED_RIGHT,
3242 PROPERTY_LEFT, 3242 PROPERTY_LEFT,
3243 PROPERTY_RIGHT, 3243 PROPERTY_RIGHT,
3244 NONE 3244 NONE
3245 ]; 3245 ];
3246 3246
3247 const WrapperKind(String name, int ordinal) : super(name, ordinal); 3247 const WrapperKind(String name, int ordinal) : super(name, ordinal);
3248 } 3248 }
OLDNEW
« no previous file with comments | « pkg/analyzer/test/generated/all_the_rest_test.dart ('k') | pkg/analyzer/test/generated/element_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698