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

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

Issue 360393003: New analyzer snapshot. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « pkg/analyzer/pubspec.yaml ('k') | pkg/analyzer/test/generated/element_test.dart » ('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 // 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/java_core.dart'; 10 import 'package:analyzer/src/generated/java_core.dart';
(...skipping 1326 matching lines...) Expand 10 before | Expand all | Expand 10 after
1337 } 1337 }
1338 } else { 1338 } else {
1339 if (!identifier.inSetterContext()) { 1339 if (!identifier.inSetterContext()) {
1340 JUnitTestCase.fail("Expected ${_topMostNode(identifier).toSource()} to be true"); 1340 JUnitTestCase.fail("Expected ${_topMostNode(identifier).toSource()} to be true");
1341 } 1341 }
1342 } 1342 }
1343 } 1343 }
1344 } 1344 }
1345 } 1345 }
1346 1346
1347 void test_isQualified_inMethodInvocation_noTarget() {
1348 MethodInvocation invocation = AstFactory.methodInvocation2("test", [AstFacto ry.identifier3("arg0")]);
1349 SimpleIdentifier identifier = invocation.methodName;
1350 JUnitTestCase.assertFalse(identifier.isQualified);
1351 }
1352
1353 void test_isQualified_inMethodInvocation_withTarget() {
1354 MethodInvocation invocation = AstFactory.methodInvocation(AstFactory.identif ier3("target"), "test", [AstFactory.identifier3("arg0")]);
1355 SimpleIdentifier identifier = invocation.methodName;
1356 JUnitTestCase.assertTrue(identifier.isQualified);
1357 }
1358
1359 void test_isQualified_inPrefixedIdentifier_name() {
1360 SimpleIdentifier identifier = AstFactory.identifier3("test");
1361 AstFactory.identifier4("prefix", identifier);
1362 JUnitTestCase.assertTrue(identifier.isQualified);
1363 }
1364
1365 void test_isQualified_inPrefixedIdentifier_prefix() {
1366 SimpleIdentifier identifier = AstFactory.identifier3("test");
1367 AstFactory.identifier(identifier, AstFactory.identifier3("name"));
1368 JUnitTestCase.assertFalse(identifier.isQualified);
1369 }
1370
1371 void test_isQualified_inPropertyAccess_name() {
1372 SimpleIdentifier identifier = AstFactory.identifier3("test");
1373 AstFactory.propertyAccess(AstFactory.identifier3("target"), identifier);
1374 JUnitTestCase.assertTrue(identifier.isQualified);
1375 }
1376
1377 void test_isQualified_inPropertyAccess_target() {
1378 SimpleIdentifier identifier = AstFactory.identifier3("test");
1379 AstFactory.propertyAccess(identifier, AstFactory.identifier3("name"));
1380 JUnitTestCase.assertFalse(identifier.isQualified);
1381 }
1382
1383 void test_isQualified_inReturnStatement() {
1384 SimpleIdentifier identifier = AstFactory.identifier3("test");
1385 AstFactory.returnStatement2(identifier);
1386 JUnitTestCase.assertFalse(identifier.isQualified);
1387 }
1388
1347 SimpleIdentifier _createIdentifier(WrapperKind wrapper, AssignmentKind assignm ent) { 1389 SimpleIdentifier _createIdentifier(WrapperKind wrapper, AssignmentKind assignm ent) {
1348 SimpleIdentifier identifier = AstFactory.identifier3("a"); 1390 SimpleIdentifier identifier = AstFactory.identifier3("a");
1349 Expression expression = identifier; 1391 Expression expression = identifier;
1350 while (true) { 1392 while (true) {
1351 if (wrapper == WrapperKind.PREFIXED_LEFT) { 1393 if (wrapper == WrapperKind.PREFIXED_LEFT) {
1352 expression = AstFactory.identifier(identifier, AstFactory.identifier3("_ ")); 1394 expression = AstFactory.identifier(identifier, AstFactory.identifier3("_ "));
1353 } else if (wrapper == WrapperKind.PREFIXED_RIGHT) { 1395 } else if (wrapper == WrapperKind.PREFIXED_RIGHT) {
1354 expression = AstFactory.identifier(AstFactory.identifier3("_"), identifi er); 1396 expression = AstFactory.identifier(AstFactory.identifier3("_"), identifi er);
1355 } else if (wrapper == WrapperKind.PROPERTY_LEFT) { 1397 } else if (wrapper == WrapperKind.PROPERTY_LEFT) {
1356 expression = AstFactory.propertyAccess2(expression, "_"); 1398 expression = AstFactory.propertyAccess2(expression, "_");
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
1473 runJUnitTest(__test, __test.test_inGetterContext); 1515 runJUnitTest(__test, __test.test_inGetterContext);
1474 }); 1516 });
1475 _ut.test('test_inReferenceContext', () { 1517 _ut.test('test_inReferenceContext', () {
1476 final __test = new SimpleIdentifierTest(); 1518 final __test = new SimpleIdentifierTest();
1477 runJUnitTest(__test, __test.test_inReferenceContext); 1519 runJUnitTest(__test, __test.test_inReferenceContext);
1478 }); 1520 });
1479 _ut.test('test_inSetterContext', () { 1521 _ut.test('test_inSetterContext', () {
1480 final __test = new SimpleIdentifierTest(); 1522 final __test = new SimpleIdentifierTest();
1481 runJUnitTest(__test, __test.test_inSetterContext); 1523 runJUnitTest(__test, __test.test_inSetterContext);
1482 }); 1524 });
1525 _ut.test('test_isQualified_inMethodInvocation_noTarget', () {
1526 final __test = new SimpleIdentifierTest();
1527 runJUnitTest(__test, __test.test_isQualified_inMethodInvocation_noTarget );
1528 });
1529 _ut.test('test_isQualified_inMethodInvocation_withTarget', () {
1530 final __test = new SimpleIdentifierTest();
1531 runJUnitTest(__test, __test.test_isQualified_inMethodInvocation_withTarg et);
1532 });
1533 _ut.test('test_isQualified_inPrefixedIdentifier_name', () {
1534 final __test = new SimpleIdentifierTest();
1535 runJUnitTest(__test, __test.test_isQualified_inPrefixedIdentifier_name);
1536 });
1537 _ut.test('test_isQualified_inPrefixedIdentifier_prefix', () {
1538 final __test = new SimpleIdentifierTest();
1539 runJUnitTest(__test, __test.test_isQualified_inPrefixedIdentifier_prefix );
1540 });
1541 _ut.test('test_isQualified_inPropertyAccess_name', () {
1542 final __test = new SimpleIdentifierTest();
1543 runJUnitTest(__test, __test.test_isQualified_inPropertyAccess_name);
1544 });
1545 _ut.test('test_isQualified_inPropertyAccess_target', () {
1546 final __test = new SimpleIdentifierTest();
1547 runJUnitTest(__test, __test.test_isQualified_inPropertyAccess_target);
1548 });
1549 _ut.test('test_isQualified_inReturnStatement', () {
1550 final __test = new SimpleIdentifierTest();
1551 runJUnitTest(__test, __test.test_isQualified_inReturnStatement);
1552 });
1483 }); 1553 });
1484 } 1554 }
1485 } 1555 }
1486 1556
1487 class SimpleStringLiteralTest extends ParserTestCase { 1557 class SimpleStringLiteralTest extends ParserTestCase {
1488 void test_getValueOffset() { 1558 void test_getValueOffset() {
1489 JUnitTestCase.assertEquals(1, new SimpleStringLiteral(TokenFactory.tokenFrom String("'X'"), "X").valueOffset); 1559 JUnitTestCase.assertEquals(1, new SimpleStringLiteral(TokenFactory.tokenFrom String("'X'"), "X").valueOffset);
1490 JUnitTestCase.assertEquals(1, new SimpleStringLiteral(TokenFactory.tokenFrom String("\"X\""), "X").valueOffset); 1560 JUnitTestCase.assertEquals(1, new SimpleStringLiteral(TokenFactory.tokenFrom String("\"X\""), "X").valueOffset);
1491 JUnitTestCase.assertEquals(3, new SimpleStringLiteral(TokenFactory.tokenFrom String("\"\"\"X\"\"\""), "X").valueOffset); 1561 JUnitTestCase.assertEquals(3, new SimpleStringLiteral(TokenFactory.tokenFrom String("\"\"\"X\"\"\""), "X").valueOffset);
1492 JUnitTestCase.assertEquals(3, new SimpleStringLiteral(TokenFactory.tokenFrom String("'''X'''"), "X").valueOffset); 1562 JUnitTestCase.assertEquals(3, new SimpleStringLiteral(TokenFactory.tokenFrom String("'''X'''"), "X").valueOffset);
(...skipping 2358 matching lines...) Expand 10 before | Expand all | Expand 10 after
3851 ToSourceVisitorTest.dartSuite(); 3921 ToSourceVisitorTest.dartSuite();
3852 BreadthFirstVisitorTest.dartSuite(); 3922 BreadthFirstVisitorTest.dartSuite();
3853 ClassDeclarationTest.dartSuite(); 3923 ClassDeclarationTest.dartSuite();
3854 ClassTypeAliasTest.dartSuite(); 3924 ClassTypeAliasTest.dartSuite();
3855 IndexExpressionTest.dartSuite(); 3925 IndexExpressionTest.dartSuite();
3856 NodeListTest.dartSuite(); 3926 NodeListTest.dartSuite();
3857 SimpleIdentifierTest.dartSuite(); 3927 SimpleIdentifierTest.dartSuite();
3858 SimpleStringLiteralTest.dartSuite(); 3928 SimpleStringLiteralTest.dartSuite();
3859 VariableDeclarationTest.dartSuite(); 3929 VariableDeclarationTest.dartSuite();
3860 } 3930 }
OLDNEW
« no previous file with comments | « pkg/analyzer/pubspec.yaml ('k') | pkg/analyzer/test/generated/element_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698