| 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.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 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 | 253 |
| 254 void test_getMethod() { | 254 void test_getMethod() { |
| 255 MethodDeclaration aMethod = AstFactory.methodDeclaration(null, null, null, n
ull, AstFactory.identifier3("a"), AstFactory.formalParameterList([])); | 255 MethodDeclaration aMethod = AstFactory.methodDeclaration(null, null, null, n
ull, AstFactory.identifier3("a"), AstFactory.formalParameterList([])); |
| 256 MethodDeclaration bMethod = AstFactory.methodDeclaration(null, null, null, n
ull, AstFactory.identifier3("b"), AstFactory.formalParameterList([])); | 256 MethodDeclaration bMethod = AstFactory.methodDeclaration(null, null, null, n
ull, AstFactory.identifier3("b"), AstFactory.formalParameterList([])); |
| 257 ClassDeclaration clazz = AstFactory.classDeclaration(null, "Test", null, nul
l, null, null, [aMethod, bMethod]); | 257 ClassDeclaration clazz = AstFactory.classDeclaration(null, "Test", null, nul
l, null, null, [aMethod, bMethod]); |
| 258 JUnitTestCase.assertSame(aMethod, clazz.getMethod("a")); | 258 JUnitTestCase.assertSame(aMethod, clazz.getMethod("a")); |
| 259 JUnitTestCase.assertSame(bMethod, clazz.getMethod("b")); | 259 JUnitTestCase.assertSame(bMethod, clazz.getMethod("b")); |
| 260 JUnitTestCase.assertSame(null, clazz.getMethod("noSuchMethod")); | 260 JUnitTestCase.assertSame(null, clazz.getMethod("noSuchMethod")); |
| 261 } | 261 } |
| 262 | 262 |
| 263 void test_isAbstract() { |
| 264 JUnitTestCase.assertFalse(AstFactory.classDeclaration(null, "A", null, null,
null, null, []).isAbstract); |
| 265 JUnitTestCase.assertTrue(AstFactory.classDeclaration(Keyword.ABSTRACT, "B",
null, null, null, null, []).isAbstract); |
| 266 } |
| 267 |
| 263 static dartSuite() { | 268 static dartSuite() { |
| 264 _ut.group('ClassDeclarationTest', () { | 269 _ut.group('ClassDeclarationTest', () { |
| 265 _ut.test('test_getConstructor', () { | 270 _ut.test('test_getConstructor', () { |
| 266 final __test = new ClassDeclarationTest(); | 271 final __test = new ClassDeclarationTest(); |
| 267 runJUnitTest(__test, __test.test_getConstructor); | 272 runJUnitTest(__test, __test.test_getConstructor); |
| 268 }); | 273 }); |
| 269 _ut.test('test_getField', () { | 274 _ut.test('test_getField', () { |
| 270 final __test = new ClassDeclarationTest(); | 275 final __test = new ClassDeclarationTest(); |
| 271 runJUnitTest(__test, __test.test_getField); | 276 runJUnitTest(__test, __test.test_getField); |
| 272 }); | 277 }); |
| 273 _ut.test('test_getMethod', () { | 278 _ut.test('test_getMethod', () { |
| 274 final __test = new ClassDeclarationTest(); | 279 final __test = new ClassDeclarationTest(); |
| 275 runJUnitTest(__test, __test.test_getMethod); | 280 runJUnitTest(__test, __test.test_getMethod); |
| 276 }); | 281 }); |
| 282 _ut.test('test_isAbstract', () { |
| 283 final __test = new ClassDeclarationTest(); |
| 284 runJUnitTest(__test, __test.test_isAbstract); |
| 285 }); |
| 277 }); | 286 }); |
| 278 } | 287 } |
| 279 } | 288 } |
| 280 | 289 |
| 281 class VariableDeclarationTest extends ParserTestCase { | 290 class VariableDeclarationTest extends ParserTestCase { |
| 282 void test_getDocumentationComment_onGrandParent() { | 291 void test_getDocumentationComment_onGrandParent() { |
| 283 VariableDeclaration varDecl = AstFactory.variableDeclaration("a"); | 292 VariableDeclaration varDecl = AstFactory.variableDeclaration("a"); |
| 284 TopLevelVariableDeclaration decl = AstFactory.topLevelVariableDeclaration2(K
eyword.VAR, [varDecl]); | 293 TopLevelVariableDeclaration decl = AstFactory.topLevelVariableDeclaration2(K
eyword.VAR, [varDecl]); |
| 285 Comment comment = Comment.createDocumentationComment(new List<Token>(0)); | 294 Comment comment = Comment.createDocumentationComment(new List<Token>(0)); |
| 286 JUnitTestCase.assertNull(varDecl.documentationComment); | 295 JUnitTestCase.assertNull(varDecl.documentationComment); |
| (...skipping 1123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1410 runJUnitTest(__test, __test.test_set_negative); | 1419 runJUnitTest(__test, __test.test_set_negative); |
| 1411 }); | 1420 }); |
| 1412 _ut.test('test_set_tooBig', () { | 1421 _ut.test('test_set_tooBig', () { |
| 1413 final __test = new NodeListTest(); | 1422 final __test = new NodeListTest(); |
| 1414 runJUnitTest(__test, __test.test_set_tooBig); | 1423 runJUnitTest(__test, __test.test_set_tooBig); |
| 1415 }); | 1424 }); |
| 1416 }); | 1425 }); |
| 1417 } | 1426 } |
| 1418 } | 1427 } |
| 1419 | 1428 |
| 1429 class ClassTypeAliasTest extends ParserTestCase { |
| 1430 void test_isAbstract() { |
| 1431 JUnitTestCase.assertFalse(AstFactory.classTypeAlias("A", null, null, null, n
ull, null).isAbstract); |
| 1432 JUnitTestCase.assertTrue(AstFactory.classTypeAlias("B", null, Keyword.ABSTRA
CT, null, null, null).isAbstract); |
| 1433 } |
| 1434 |
| 1435 static dartSuite() { |
| 1436 _ut.group('ClassTypeAliasTest', () { |
| 1437 _ut.test('test_isAbstract', () { |
| 1438 final __test = new ClassTypeAliasTest(); |
| 1439 runJUnitTest(__test, __test.test_isAbstract); |
| 1440 }); |
| 1441 }); |
| 1442 } |
| 1443 } |
| 1444 |
| 1420 class ConstantEvaluatorTest extends ParserTestCase { | 1445 class ConstantEvaluatorTest extends ParserTestCase { |
| 1421 void fail_constructor() { | 1446 void fail_constructor() { |
| 1422 Object value = _getConstantValue("?"); | 1447 Object value = _getConstantValue("?"); |
| 1423 JUnitTestCase.assertEquals(null, value); | 1448 JUnitTestCase.assertEquals(null, value); |
| 1424 } | 1449 } |
| 1425 | 1450 |
| 1426 void fail_identifier_class() { | 1451 void fail_identifier_class() { |
| 1427 Object value = _getConstantValue("?"); | 1452 Object value = _getConstantValue("?"); |
| 1428 JUnitTestCase.assertEquals(null, value); | 1453 JUnitTestCase.assertEquals(null, value); |
| 1429 } | 1454 } |
| (...skipping 2811 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4241 }); | 4266 }); |
| 4242 } | 4267 } |
| 4243 } | 4268 } |
| 4244 | 4269 |
| 4245 main() { | 4270 main() { |
| 4246 ConstantEvaluatorTest.dartSuite(); | 4271 ConstantEvaluatorTest.dartSuite(); |
| 4247 NodeLocatorTest.dartSuite(); | 4272 NodeLocatorTest.dartSuite(); |
| 4248 ToSourceVisitorTest.dartSuite(); | 4273 ToSourceVisitorTest.dartSuite(); |
| 4249 BreadthFirstVisitorTest.dartSuite(); | 4274 BreadthFirstVisitorTest.dartSuite(); |
| 4250 ClassDeclarationTest.dartSuite(); | 4275 ClassDeclarationTest.dartSuite(); |
| 4276 ClassTypeAliasTest.dartSuite(); |
| 4251 IndexExpressionTest.dartSuite(); | 4277 IndexExpressionTest.dartSuite(); |
| 4252 NodeListTest.dartSuite(); | 4278 NodeListTest.dartSuite(); |
| 4253 SimpleIdentifierTest.dartSuite(); | 4279 SimpleIdentifierTest.dartSuite(); |
| 4254 SimpleStringLiteralTest.dartSuite(); | 4280 SimpleStringLiteralTest.dartSuite(); |
| 4255 VariableDeclarationTest.dartSuite(); | 4281 VariableDeclarationTest.dartSuite(); |
| 4256 } | 4282 } |
| OLD | NEW |