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

Unified Diff: pkg/analyzer/test/generated/ast_test.dart

Issue 492463004: New analyzer snapshot. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analyzer/pubspec.yaml ('k') | pkg/analyzer/test/generated/element_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/generated/ast_test.dart
diff --git a/pkg/analyzer/test/generated/ast_test.dart b/pkg/analyzer/test/generated/ast_test.dart
index 995324c32eeb8928ee94654a3fff118c7b613828..ce600895aa41a9c272dc281aa11f62aefd6e1d6f 100644
--- a/pkg/analyzer/test/generated/ast_test.dart
+++ b/pkg/analyzer/test/generated/ast_test.dart
@@ -2206,6 +2206,22 @@ class ToSourceVisitorTest extends EngineTestCase {
_assertSource("get f() {}", AstFactory.functionDeclaration(null, Keyword.GET, "f", AstFactory.functionExpression()));
}
+ void test_visitFunctionDeclaration_local_blockBody() {
+ FunctionDeclaration f = AstFactory.functionDeclaration(null, null, "f", AstFactory.functionExpression());
+ FunctionDeclarationStatement fStatement = new FunctionDeclarationStatement(f);
+ _assertSource("main() {f() {} 42;}", AstFactory.functionDeclaration(null, null, "main", AstFactory.functionExpression2(AstFactory.formalParameterList([]), AstFactory.blockFunctionBody2([
+ fStatement,
+ AstFactory.expressionStatement(AstFactory.integer(42))]))));
+ }
+
+ void test_visitFunctionDeclaration_local_expressionBody() {
+ FunctionDeclaration f = AstFactory.functionDeclaration(null, null, "f", AstFactory.functionExpression2(AstFactory.formalParameterList([]), AstFactory.expressionFunctionBody(AstFactory.integer(1))));
+ FunctionDeclarationStatement fStatement = new FunctionDeclarationStatement(f);
+ _assertSource("main() {f() => 1; 2;}", AstFactory.functionDeclaration(null, null, "main", AstFactory.functionExpression2(AstFactory.formalParameterList([]), AstFactory.blockFunctionBody2([
+ fStatement,
+ AstFactory.expressionStatement(AstFactory.integer(2))]))));
+ }
+
void test_visitFunctionDeclaration_normal() {
_assertSource("f() {}", AstFactory.functionDeclaration(null, null, "f", AstFactory.functionExpression()));
}
@@ -2221,7 +2237,7 @@ class ToSourceVisitorTest extends EngineTestCase {
}
void test_visitFunctionDeclarationStatement() {
- _assertSource("f() {};", AstFactory.functionDeclarationStatement(null, null, "f", AstFactory.functionExpression()));
+ _assertSource("f() {}", AstFactory.functionDeclarationStatement(null, null, "f", AstFactory.functionExpression()));
}
void test_visitFunctionExpression() {
@@ -3386,6 +3402,14 @@ class ToSourceVisitorTest extends EngineTestCase {
final __test = new ToSourceVisitorTest();
runJUnitTest(__test, __test.test_visitFunctionDeclaration_getter);
});
+ _ut.test('test_visitFunctionDeclaration_local_blockBody', () {
+ final __test = new ToSourceVisitorTest();
+ runJUnitTest(__test, __test.test_visitFunctionDeclaration_local_blockBody);
+ });
+ _ut.test('test_visitFunctionDeclaration_local_expressionBody', () {
+ final __test = new ToSourceVisitorTest();
+ runJUnitTest(__test, __test.test_visitFunctionDeclaration_local_expressionBody);
+ });
_ut.test('test_visitFunctionDeclaration_normal', () {
final __test = new ToSourceVisitorTest();
runJUnitTest(__test, __test.test_visitFunctionDeclaration_normal);
« 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