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

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

Issue 137863002: Issue 8742. Preserve leading line comments during java2dart translation. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Test for block-style comment translation. Created 6 years, 11 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 e908418f0b554f9fce4adb0c649ef6ef04df94ed..182d0358052710af37ec66c3f9aa471c64e5f620 100644
--- a/pkg/analyzer/test/generated/ast_test.dart
+++ b/pkg/analyzer/test/generated/ast_test.dart
@@ -91,42 +91,49 @@ class NodeLocatorTest extends ParserTestCase {
class IndexExpressionTest extends EngineTestCase {
void test_inGetterContext_assignment_compound_left() {
IndexExpression expression = ASTFactory.indexExpression(ASTFactory.identifier3("a"), ASTFactory.identifier3("b"));
+ // a[i] += ?
ASTFactory.assignmentExpression(expression, TokenType.PLUS_EQ, null);
JUnitTestCase.assertTrue(expression.inGetterContext());
}
void test_inGetterContext_assignment_simple_left() {
IndexExpression expression = ASTFactory.indexExpression(ASTFactory.identifier3("a"), ASTFactory.identifier3("b"));
+ // a[i] = ?
ASTFactory.assignmentExpression(expression, TokenType.EQ, null);
JUnitTestCase.assertFalse(expression.inGetterContext());
}
void test_inGetterContext_nonAssignment() {
IndexExpression expression = ASTFactory.indexExpression(ASTFactory.identifier3("a"), ASTFactory.identifier3("b"));
+ // a[i] + ?
ASTFactory.binaryExpression(expression, TokenType.PLUS, null);
JUnitTestCase.assertTrue(expression.inGetterContext());
}
void test_inSetterContext_assignment_compound_left() {
IndexExpression expression = ASTFactory.indexExpression(ASTFactory.identifier3("a"), ASTFactory.identifier3("b"));
+ // a[i] += ?
ASTFactory.assignmentExpression(expression, TokenType.PLUS_EQ, null);
JUnitTestCase.assertTrue(expression.inSetterContext());
}
void test_inSetterContext_assignment_compound_right() {
IndexExpression expression = ASTFactory.indexExpression(ASTFactory.identifier3("a"), ASTFactory.identifier3("b"));
+ // ? += a[i]
ASTFactory.assignmentExpression(null, TokenType.PLUS_EQ, expression);
JUnitTestCase.assertFalse(expression.inSetterContext());
}
void test_inSetterContext_assignment_simple_left() {
IndexExpression expression = ASTFactory.indexExpression(ASTFactory.identifier3("a"), ASTFactory.identifier3("b"));
+ // a[i] = ?
ASTFactory.assignmentExpression(expression, TokenType.EQ, null);
JUnitTestCase.assertTrue(expression.inSetterContext());
}
void test_inSetterContext_assignment_simple_right() {
IndexExpression expression = ASTFactory.indexExpression(ASTFactory.identifier3("a"), ASTFactory.identifier3("b"));
+ // ? = a[i]
ASTFactory.assignmentExpression(null, TokenType.EQ, expression);
JUnitTestCase.assertFalse(expression.inSetterContext());
}
@@ -134,29 +141,34 @@ class IndexExpressionTest extends EngineTestCase {
void test_inSetterContext_nonAssignment() {
IndexExpression expression = ASTFactory.indexExpression(ASTFactory.identifier3("a"), ASTFactory.identifier3("b"));
ASTFactory.binaryExpression(expression, TokenType.PLUS, null);
+ // a[i] + ?
JUnitTestCase.assertFalse(expression.inSetterContext());
}
void test_inSetterContext_postfix() {
IndexExpression expression = ASTFactory.indexExpression(ASTFactory.identifier3("a"), ASTFactory.identifier3("b"));
ASTFactory.postfixExpression(expression, TokenType.PLUS_PLUS);
+ // a[i]++
JUnitTestCase.assertTrue(expression.inSetterContext());
}
void test_inSetterContext_prefix_bang() {
IndexExpression expression = ASTFactory.indexExpression(ASTFactory.identifier3("a"), ASTFactory.identifier3("b"));
+ // !a[i]
ASTFactory.prefixExpression(TokenType.BANG, expression);
JUnitTestCase.assertFalse(expression.inSetterContext());
}
void test_inSetterContext_prefix_minusMinus() {
IndexExpression expression = ASTFactory.indexExpression(ASTFactory.identifier3("a"), ASTFactory.identifier3("b"));
+ // --a[i]
ASTFactory.prefixExpression(TokenType.MINUS_MINUS, expression);
JUnitTestCase.assertTrue(expression.inSetterContext());
}
void test_inSetterContext_prefix_plusPlus() {
IndexExpression expression = ASTFactory.indexExpression(ASTFactory.identifier3("a"), ASTFactory.identifier3("b"));
+ // ++a[i]
ASTFactory.prefixExpression(TokenType.PLUS_PLUS, expression);
JUnitTestCase.assertTrue(expression.inSetterContext());
}
« 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