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

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

Issue 680063003: Port enum getter types fix to Dart. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 1 month 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
« no previous file with comments | « pkg/analyzer/lib/src/generated/resolver.dart ('k') | no next file » | 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 // 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.all_the_rest_test; 8 library engine.all_the_rest_test;
9 9
10 import 'dart:collection'; 10 import 'dart:collection';
(...skipping 8909 matching lines...) Expand 10 before | Expand all | Expand 10 after
8920 } 8920 }
8921 8921
8922 8922
8923 class EnumMemberBuilderTest extends EngineTestCase { 8923 class EnumMemberBuilderTest extends EngineTestCase {
8924 void test_visitEnumDeclaration_multiple() { 8924 void test_visitEnumDeclaration_multiple() {
8925 String firstName = "ONE"; 8925 String firstName = "ONE";
8926 String secondName = "TWO"; 8926 String secondName = "TWO";
8927 String thirdName = "THREE"; 8927 String thirdName = "THREE";
8928 EnumDeclaration enumDeclaration = 8928 EnumDeclaration enumDeclaration =
8929 AstFactory.enumDeclaration2("E", [firstName, secondName, thirdName]); 8929 AstFactory.enumDeclaration2("E", [firstName, secondName, thirdName]);
8930
8930 ClassElement enumElement = _buildElement(enumDeclaration); 8931 ClassElement enumElement = _buildElement(enumDeclaration);
8931 List<FieldElement> fields = enumElement.fields; 8932 List<FieldElement> fields = enumElement.fields;
8932 EngineTestCase.assertLength(5, fields); 8933 EngineTestCase.assertLength(5, fields);
8934
8933 FieldElement constant = fields[2]; 8935 FieldElement constant = fields[2];
8934 JUnitTestCase.assertNotNull(constant); 8936 JUnitTestCase.assertNotNull(constant);
8935 JUnitTestCase.assertEquals(firstName, constant.name); 8937 JUnitTestCase.assertEquals(firstName, constant.name);
8936 JUnitTestCase.assertTrue(constant.isStatic); 8938 JUnitTestCase.assertTrue(constant.isStatic);
8939 _assertGetter(constant);
8940
8937 constant = fields[3]; 8941 constant = fields[3];
8938 JUnitTestCase.assertNotNull(constant); 8942 JUnitTestCase.assertNotNull(constant);
8939 JUnitTestCase.assertEquals(secondName, constant.name); 8943 JUnitTestCase.assertEquals(secondName, constant.name);
8940 JUnitTestCase.assertTrue(constant.isStatic); 8944 JUnitTestCase.assertTrue(constant.isStatic);
8945 _assertGetter(constant);
8946
8941 constant = fields[4]; 8947 constant = fields[4];
8942 JUnitTestCase.assertNotNull(constant); 8948 JUnitTestCase.assertNotNull(constant);
8943 JUnitTestCase.assertEquals(thirdName, constant.name); 8949 JUnitTestCase.assertEquals(thirdName, constant.name);
8944 JUnitTestCase.assertTrue(constant.isStatic); 8950 JUnitTestCase.assertTrue(constant.isStatic);
8951 _assertGetter(constant);
8945 } 8952 }
8946 8953
8947 void test_visitEnumDeclaration_single() { 8954 void test_visitEnumDeclaration_single() {
8948 String firstName = "ONE"; 8955 String firstName = "ONE";
8949 EnumDeclaration enumDeclaration = 8956 EnumDeclaration enumDeclaration =
8950 AstFactory.enumDeclaration2("E", [firstName]); 8957 AstFactory.enumDeclaration2("E", [firstName]);
8958
8951 ClassElement enumElement = _buildElement(enumDeclaration); 8959 ClassElement enumElement = _buildElement(enumDeclaration);
8952 List<FieldElement> fields = enumElement.fields; 8960 List<FieldElement> fields = enumElement.fields;
8953 EngineTestCase.assertLength(3, fields); 8961 EngineTestCase.assertLength(3, fields);
8962
8954 FieldElement field = fields[0]; 8963 FieldElement field = fields[0];
8955 JUnitTestCase.assertNotNull(field); 8964 JUnitTestCase.assertNotNull(field);
8956 JUnitTestCase.assertEquals("index", field.name); 8965 JUnitTestCase.assertEquals("index", field.name);
8957 JUnitTestCase.assertFalse(field.isStatic); 8966 JUnitTestCase.assertFalse(field.isStatic);
8958 JUnitTestCase.assertTrue(field.isSynthetic); 8967 JUnitTestCase.assertTrue(field.isSynthetic);
8968 _assertGetter(field);
8969
8959 field = fields[1]; 8970 field = fields[1];
8960 JUnitTestCase.assertNotNull(field); 8971 JUnitTestCase.assertNotNull(field);
8961 JUnitTestCase.assertEquals("values", field.name); 8972 JUnitTestCase.assertEquals("values", field.name);
8962 JUnitTestCase.assertTrue(field.isStatic); 8973 JUnitTestCase.assertTrue(field.isStatic);
8963 JUnitTestCase.assertTrue(field.isSynthetic); 8974 JUnitTestCase.assertTrue(field.isSynthetic);
8975 _assertGetter(field);
8976
8964 FieldElement constant = fields[2]; 8977 FieldElement constant = fields[2];
8965 JUnitTestCase.assertNotNull(constant); 8978 JUnitTestCase.assertNotNull(constant);
8966 JUnitTestCase.assertEquals(firstName, constant.name); 8979 JUnitTestCase.assertEquals(firstName, constant.name);
8967 JUnitTestCase.assertTrue(constant.isStatic); 8980 JUnitTestCase.assertTrue(constant.isStatic);
8981 _assertGetter(constant);
8982 }
8983
8984 void _assertGetter(FieldElement field) {
8985 PropertyAccessorElement getter = field.getter;
8986 JUnitTestCase.assertNotNull(getter);
8987 JUnitTestCase.assertSame(field, getter.variable);
8988 JUnitTestCase.assertNotNull(getter.type);
8968 } 8989 }
8969 8990
8970 ClassElement _buildElement(EnumDeclaration enumDeclaration) { 8991 ClassElement _buildElement(EnumDeclaration enumDeclaration) {
8971 ElementHolder holder = new ElementHolder(); 8992 ElementHolder holder = new ElementHolder();
8972 ElementBuilder elementBuilder = new ElementBuilder(holder); 8993 ElementBuilder elementBuilder = new ElementBuilder(holder);
8973 enumDeclaration.accept(elementBuilder); 8994 enumDeclaration.accept(elementBuilder);
8974 EnumMemberBuilder memberBuilder = 8995 EnumMemberBuilder memberBuilder =
8975 new EnumMemberBuilder(new TestTypeProvider()); 8996 new EnumMemberBuilder(new TestTypeProvider());
8976 enumDeclaration.accept(memberBuilder); 8997 enumDeclaration.accept(memberBuilder);
8977 List<ClassElement> enums = holder.enums; 8998 List<ClassElement> enums = holder.enums;
(...skipping 2128 matching lines...) Expand 10 before | Expand all | Expand 10 after
11106 } else { 11127 } else {
11107 JUnitTestCase.assertNotNullMsg("script $scriptIndex", scriptSource); 11128 JUnitTestCase.assertNotNullMsg("script $scriptIndex", scriptSource);
11108 String actualExternalScriptName = scriptSource.shortName; 11129 String actualExternalScriptName = scriptSource.shortName;
11109 JUnitTestCase.assertEqualsMsg( 11130 JUnitTestCase.assertEqualsMsg(
11110 "script $scriptIndex", 11131 "script $scriptIndex",
11111 _expectedExternalScriptName, 11132 _expectedExternalScriptName,
11112 actualExternalScriptName); 11133 actualExternalScriptName);
11113 } 11134 }
11114 } 11135 }
11115 } 11136 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/generated/resolver.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698