| 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 // 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 6319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6330 AstFactory.enumDeclaration2("E", [firstName, secondName, thirdName]); | 6330 AstFactory.enumDeclaration2("E", [firstName, secondName, thirdName]); |
| 6331 | 6331 |
| 6332 ClassElement enumElement = _buildElement(enumDeclaration); | 6332 ClassElement enumElement = _buildElement(enumDeclaration); |
| 6333 List<FieldElement> fields = enumElement.fields; | 6333 List<FieldElement> fields = enumElement.fields; |
| 6334 expect(fields, hasLength(5)); | 6334 expect(fields, hasLength(5)); |
| 6335 | 6335 |
| 6336 FieldElement constant = fields[2]; | 6336 FieldElement constant = fields[2]; |
| 6337 expect(constant, isNotNull); | 6337 expect(constant, isNotNull); |
| 6338 expect(constant.name, firstName); | 6338 expect(constant.name, firstName); |
| 6339 expect(constant.isStatic, isTrue); | 6339 expect(constant.isStatic, isTrue); |
| 6340 expect((constant as FieldElementImpl).evaluationResult, isNotNull); |
| 6340 _assertGetter(constant); | 6341 _assertGetter(constant); |
| 6341 | 6342 |
| 6342 constant = fields[3]; | 6343 constant = fields[3]; |
| 6343 expect(constant, isNotNull); | 6344 expect(constant, isNotNull); |
| 6344 expect(constant.name, secondName); | 6345 expect(constant.name, secondName); |
| 6345 expect(constant.isStatic, isTrue); | 6346 expect(constant.isStatic, isTrue); |
| 6347 expect((constant as FieldElementImpl).evaluationResult, isNotNull); |
| 6346 _assertGetter(constant); | 6348 _assertGetter(constant); |
| 6347 | 6349 |
| 6348 constant = fields[4]; | 6350 constant = fields[4]; |
| 6349 expect(constant, isNotNull); | 6351 expect(constant, isNotNull); |
| 6350 expect(constant.name, thirdName); | 6352 expect(constant.name, thirdName); |
| 6351 expect(constant.isStatic, isTrue); | 6353 expect(constant.isStatic, isTrue); |
| 6354 expect((constant as FieldElementImpl).evaluationResult, isNotNull); |
| 6352 _assertGetter(constant); | 6355 _assertGetter(constant); |
| 6353 } | 6356 } |
| 6354 | 6357 |
| 6355 void test_visitEnumDeclaration_single() { | 6358 void test_visitEnumDeclaration_single() { |
| 6356 String firstName = "ONE"; | 6359 String firstName = "ONE"; |
| 6357 EnumDeclaration enumDeclaration = | 6360 EnumDeclaration enumDeclaration = |
| 6358 AstFactory.enumDeclaration2("E", [firstName]); | 6361 AstFactory.enumDeclaration2("E", [firstName]); |
| 6359 | 6362 |
| 6360 ClassElement enumElement = _buildElement(enumDeclaration); | 6363 ClassElement enumElement = _buildElement(enumDeclaration); |
| 6361 List<FieldElement> fields = enumElement.fields; | 6364 List<FieldElement> fields = enumElement.fields; |
| 6362 expect(fields, hasLength(3)); | 6365 expect(fields, hasLength(3)); |
| 6363 | 6366 |
| 6364 FieldElement field = fields[0]; | 6367 FieldElement field = fields[0]; |
| 6365 expect(field, isNotNull); | 6368 expect(field, isNotNull); |
| 6366 expect(field.name, "index"); | 6369 expect(field.name, "index"); |
| 6367 expect(field.isStatic, isFalse); | 6370 expect(field.isStatic, isFalse); |
| 6368 expect(field.isSynthetic, isTrue); | 6371 expect(field.isSynthetic, isTrue); |
| 6369 _assertGetter(field); | 6372 _assertGetter(field); |
| 6370 | 6373 |
| 6371 field = fields[1]; | 6374 field = fields[1]; |
| 6372 expect(field, isNotNull); | 6375 expect(field, isNotNull); |
| 6373 expect(field.name, "values"); | 6376 expect(field.name, "values"); |
| 6374 expect(field.isStatic, isTrue); | 6377 expect(field.isStatic, isTrue); |
| 6375 expect(field.isSynthetic, isTrue); | 6378 expect(field.isSynthetic, isTrue); |
| 6379 expect((field as FieldElementImpl).evaluationResult, isNotNull); |
| 6376 _assertGetter(field); | 6380 _assertGetter(field); |
| 6377 | 6381 |
| 6378 FieldElement constant = fields[2]; | 6382 FieldElement constant = fields[2]; |
| 6379 expect(constant, isNotNull); | 6383 expect(constant, isNotNull); |
| 6380 expect(constant.name, firstName); | 6384 expect(constant.name, firstName); |
| 6381 expect(constant.isStatic, isTrue); | 6385 expect(constant.isStatic, isTrue); |
| 6386 expect((constant as FieldElementImpl).evaluationResult, isNotNull); |
| 6382 _assertGetter(constant); | 6387 _assertGetter(constant); |
| 6383 } | 6388 } |
| 6384 | 6389 |
| 6385 void _assertGetter(FieldElement field) { | 6390 void _assertGetter(FieldElement field) { |
| 6386 PropertyAccessorElement getter = field.getter; | 6391 PropertyAccessorElement getter = field.getter; |
| 6387 expect(getter, isNotNull); | 6392 expect(getter, isNotNull); |
| 6388 expect(getter.variable, same(field)); | 6393 expect(getter.variable, same(field)); |
| 6389 expect(getter.type, isNotNull); | 6394 expect(getter.type, isNotNull); |
| 6390 } | 6395 } |
| 6391 | 6396 |
| (...skipping 2189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8581 if (_expectedExternalScriptName == null) { | 8586 if (_expectedExternalScriptName == null) { |
| 8582 expect(scriptSource, isNull, reason: "script $scriptIndex"); | 8587 expect(scriptSource, isNull, reason: "script $scriptIndex"); |
| 8583 } else { | 8588 } else { |
| 8584 expect(scriptSource, isNotNull, reason: "script $scriptIndex"); | 8589 expect(scriptSource, isNotNull, reason: "script $scriptIndex"); |
| 8585 String actualExternalScriptName = scriptSource.shortName; | 8590 String actualExternalScriptName = scriptSource.shortName; |
| 8586 expect(actualExternalScriptName, _expectedExternalScriptName, | 8591 expect(actualExternalScriptName, _expectedExternalScriptName, |
| 8587 reason: "script $scriptIndex"); | 8592 reason: "script $scriptIndex"); |
| 8588 } | 8593 } |
| 8589 } | 8594 } |
| 8590 } | 8595 } |
| OLD | NEW |