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

Unified Diff: pkg/analysis_server/test/services/completion/postfix/postfix_completion_test.dart

Issue 2975253002: Format analyzer, analysis_server, analyzer_plugin, front_end and kernel with the latest dartfmt. (Closed)
Patch Set: Created 3 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 side-by-side diff with in-line comments
Download patch
Index: pkg/analysis_server/test/services/completion/postfix/postfix_completion_test.dart
diff --git a/pkg/analysis_server/test/services/completion/postfix/postfix_completion_test.dart b/pkg/analysis_server/test/services/completion/postfix/postfix_completion_test.dart
index e9c4fef9951d2481639ef47277c17b32272a83ec..244b2b270e531191c637a920412849093fce832d 100644
--- a/pkg/analysis_server/test/services/completion/postfix/postfix_completion_test.dart
+++ b/pkg/analysis_server/test/services/completion/postfix/postfix_completion_test.dart
@@ -88,16 +88,12 @@ class PostfixCompletionTest extends AbstractSingleUnitTest {
@reflectiveTest
class _AssertTest extends PostfixCompletionTest {
test_assert() async {
- await _prepareCompletion(
- '.assert',
- '''
+ await _prepareCompletion('.assert', '''
f(bool expr) {
expr.assert
}
''');
- _assertHasChange(
- 'Expand .assert',
- '''
+ _assertHasChange('Expand .assert', '''
f(bool expr) {
assert(expr);
}
@@ -105,16 +101,12 @@ f(bool expr) {
}
test_assertFunc() async {
- await _prepareCompletion(
- '.assert',
- '''
+ await _prepareCompletion('.assert', '''
f() {
() => true.assert
}
''');
- _assertHasChange(
- 'Expand .assert',
- '''
+ _assertHasChange('Expand .assert', '''
f() {
assert(() => true);
}
@@ -123,9 +115,7 @@ f() {
@failingTest
test_assertFunc_invalid() async {
- await _prepareCompletion(
- '.assert',
- '''
+ await _prepareCompletion('.assert', '''
f() {
() => null.assert
}
@@ -133,16 +123,12 @@ f() {
}
test_assertFuncCmp() async {
- await _prepareCompletion(
- '.assert',
- '''
+ await _prepareCompletion('.assert', '''
f(int x, int y) {
() => x + 3 > y + 4.assert
}
''');
- _assertHasChange(
- 'Expand .assert',
- '''
+ _assertHasChange('Expand .assert', '''
f(int x, int y) {
assert(() => x + 3 > y + 4);
}
@@ -154,9 +140,7 @@ f(int x, int y) {
class _ForTest extends PostfixCompletionTest {
@failingTest
test_for_invalid() async {
- await _prepareCompletion(
- '.for',
- '''
+ await _prepareCompletion('.for', '''
f() {
{}.for
}
@@ -164,16 +148,12 @@ f() {
}
test_forEmptyDynamic() async {
- await _prepareCompletion(
- '.for',
- '''
+ await _prepareCompletion('.for', '''
f() {
[].for
}
''');
- _assertHasChange(
- 'Expand .for',
- '''
+ _assertHasChange('Expand .for', '''
f() {
for (var value in []) {
/*caret*/
@@ -183,16 +163,12 @@ f() {
}
test_forEmptyString() async {
- await _prepareCompletion(
- '.for',
- '''
+ await _prepareCompletion('.for', '''
f() {
<String>[].for
}
''');
- _assertHasChange(
- 'Expand .for',
- '''
+ _assertHasChange('Expand .for', '''
f() {
for (var value in <String>[]) {
/*caret*/
@@ -202,16 +178,12 @@ f() {
}
test_fori() async {
- await _prepareCompletion(
- '.fori',
- '''
+ await _prepareCompletion('.fori', '''
f() {
100.fori
}
''');
- _assertHasChange(
- 'Expand .fori',
- '''
+ _assertHasChange('Expand .fori', '''
f() {
for (int i = 0; i < 100; i++) {
/*caret*/
@@ -222,9 +194,7 @@ f() {
@failingTest
test_fori_invalid() async {
- await _prepareCompletion(
- '.fori',
- '''
+ await _prepareCompletion('.fori', '''
f() {
[].fori
}
@@ -232,16 +202,12 @@ f() {
}
test_forIntList() async {
- await _prepareCompletion(
- '.for',
- '''
+ await _prepareCompletion('.for', '''
f() {
[1,2,3].for
}
''');
- _assertHasChange(
- 'Expand .for',
- '''
+ _assertHasChange('Expand .for', '''
f() {
for (var value in [1,2,3]) {
/*caret*/
@@ -251,17 +217,13 @@ f() {
}
test_foriVar() async {
- await _prepareCompletion(
- '.fori',
- '''
+ await _prepareCompletion('.fori', '''
f() {
var n = 100;
n.fori
}
''');
- _assertHasChange(
- 'Expand .fori',
- '''
+ _assertHasChange('Expand .fori', '''
f() {
var n = 100;
for (int i = 0; i < n; i++) {
@@ -272,16 +234,12 @@ f() {
}
test_iterList() async {
- await _prepareCompletion(
- '.iter',
- '''
+ await _prepareCompletion('.iter', '''
f() {
[1,2,3].iter
}
''');
- _assertHasChange(
- 'Expand .iter',
- '''
+ _assertHasChange('Expand .iter', '''
f() {
for (var value in [1,2,3]) {
/*caret*/
@@ -291,17 +249,13 @@ f() {
}
test_iterName() async {
- await _prepareCompletion(
- '.iter',
- '''
+ await _prepareCompletion('.iter', '''
f() {
var value = [1,2,3];
value.iter
}
''');
- _assertHasChange(
- 'Expand .iter',
- '''
+ _assertHasChange('Expand .iter', '''
f() {
var value = [1,2,3];
for (var value1 in value) {
@@ -315,16 +269,12 @@ f() {
@reflectiveTest
class _IfTest extends PostfixCompletionTest {
test_Else() async {
- await _prepareCompletion(
- '.else',
- '''
+ await _prepareCompletion('.else', '''
f(bool val) {
val.else
}
''');
- _assertHasChange(
- 'Expand .else',
- '''
+ _assertHasChange('Expand .else', '''
f(bool val) {
if (!val) {
/*caret*/
@@ -334,16 +284,12 @@ f(bool val) {
}
test_if() async {
- await _prepareCompletion(
- '.if',
- '''
+ await _prepareCompletion('.if', '''
f() {
3 < 4.if
}
''');
- _assertHasChange(
- 'Expand .if',
- '''
+ _assertHasChange('Expand .if', '''
f() {
if (3 < 4) {
/*caret*/
@@ -354,9 +300,7 @@ f() {
@failingTest
test_if_invalid() async {
- await _prepareCompletion(
- '.if',
- '''
+ await _prepareCompletion('.if', '''
f(List expr) {
expr.if
}
@@ -364,16 +308,12 @@ f(List expr) {
}
test_ifDynamic() async {
- await _prepareCompletion(
- '.if',
- '''
+ await _prepareCompletion('.if', '''
f(expr) {
expr.if
}
''');
- _assertHasChange(
- 'Expand .if',
- '''
+ _assertHasChange('Expand .if', '''
f(expr) {
if (expr) {
/*caret*/
@@ -386,16 +326,12 @@ f(expr) {
@reflectiveTest
class _NegateTest extends PostfixCompletionTest {
test_negate() async {
- await _prepareCompletion(
- '.not',
- '''
+ await _prepareCompletion('.not', '''
f(expr) {
if (expr.not)
}
''');
- _assertHasChange(
- 'Expand .not',
- '''
+ _assertHasChange('Expand .not', '''
f(expr) {
if (!expr)
}
@@ -404,9 +340,7 @@ f(expr) {
@failingTest
test_negate_invalid() async {
- await _prepareCompletion(
- '.not',
- '''
+ await _prepareCompletion('.not', '''
f(int expr) {
if (expr.not)
}
@@ -414,16 +348,12 @@ f(int expr) {
}
test_negateCascade() async {
- await _prepareCompletion(
- '.not',
- '''
+ await _prepareCompletion('.not', '''
f(expr) {
if (expr..a..b..c.not)
}
''');
- _assertHasChange(
- 'Expand .not',
- '''
+ _assertHasChange('Expand .not', '''
f(expr) {
if (!expr..a..b..c)
}
@@ -431,16 +361,12 @@ f(expr) {
}
test_negateExpr() async {
- await _prepareCompletion(
- '.not',
- '''
+ await _prepareCompletion('.not', '''
f(int i, int j) {
if (i + 3 < j - 4.not)
}
''');
- _assertHasChange(
- 'Expand .not',
- '''
+ _assertHasChange('Expand .not', '''
f(int i, int j) {
if (i + 3 >= j - 4)
}
@@ -448,16 +374,12 @@ f(int i, int j) {
}
test_negateProperty() async {
- await _prepareCompletion(
- '.not',
- '''
+ await _prepareCompletion('.not', '''
f(expr) {
if (expr.a.b.c.not)
}
''');
- _assertHasChange(
- 'Expand .not',
- '''
+ _assertHasChange('Expand .not', '''
f(expr) {
if (!expr.a.b.c)
}
@@ -465,16 +387,12 @@ f(expr) {
}
test_notFalse() async {
- await _prepareCompletion(
- '!',
- '''
+ await _prepareCompletion('!', '''
f() {
if (false!)
}
''');
- _assertHasChange(
- 'Expand !',
- '''
+ _assertHasChange('Expand !', '''
f() {
if (true)
}
@@ -482,16 +400,12 @@ f() {
}
test_notFunc() async {
- await _prepareCompletion(
- '.not',
- '''
+ await _prepareCompletion('.not', '''
bool f() {
if (f().not)
}
''');
- _assertHasChange(
- 'Expand .not',
- '''
+ _assertHasChange('Expand .not', '''
bool f() {
if (!f())
}
@@ -499,16 +413,12 @@ bool f() {
}
test_notTrue() async {
- await _prepareCompletion(
- '.not',
- '''
+ await _prepareCompletion('.not', '''
f() {
if (true.not)
}
''');
- _assertHasChange(
- 'Expand .not',
- '''
+ _assertHasChange('Expand .not', '''
f() {
if (false)
}
@@ -519,17 +429,13 @@ f() {
@reflectiveTest
class _NotNullTest extends PostfixCompletionTest {
test_nn() async {
- await _prepareCompletion(
- '.nn',
- '''
+ await _prepareCompletion('.nn', '''
f(expr) {
var list = [1,2,3];
list.nn
}
''');
- _assertHasChange(
- 'Expand .nn',
- '''
+ _assertHasChange('Expand .nn', '''
f(expr) {
var list = [1,2,3];
if (list != null) {
@@ -541,9 +447,7 @@ f(expr) {
@failingTest
test_nn_invalid() async {
- await _prepareCompletion(
- '.nn',
- '''
+ await _prepareCompletion('.nn', '''
f(expr) {
var list = [1,2,3];
}.nn
@@ -551,16 +455,12 @@ f(expr) {
}
test_nnDynamic() async {
- await _prepareCompletion(
- '.nn',
- '''
+ await _prepareCompletion('.nn', '''
f(expr) {
expr.nn
}
''');
- _assertHasChange(
- 'Expand .nn',
- '''
+ _assertHasChange('Expand .nn', '''
f(expr) {
if (expr != null) {
/*caret*/
@@ -570,17 +470,13 @@ f(expr) {
}
test_notnull() async {
- await _prepareCompletion(
- '.notnull',
- '''
+ await _prepareCompletion('.notnull', '''
f(expr) {
var list = [1,2,3];
list.notnull
}
''');
- _assertHasChange(
- 'Expand .notnull',
- '''
+ _assertHasChange('Expand .notnull', '''
f(expr) {
var list = [1,2,3];
if (list != null) {
@@ -591,17 +487,13 @@ f(expr) {
}
test_null() async {
- await _prepareCompletion(
- '.null',
- '''
+ await _prepareCompletion('.null', '''
f(expr) {
var list = [1,2,3];
list.null
}
''');
- _assertHasChange(
- 'Expand .null',
- '''
+ _assertHasChange('Expand .null', '''
f(expr) {
var list = [1,2,3];
if (list == null) {
@@ -612,16 +504,12 @@ f(expr) {
}
test_nullnn() async {
- await _prepareCompletion(
- '.nn',
- '''
+ await _prepareCompletion('.nn', '''
f() {
null.nn
}
''');
- _assertHasChange(
- 'Expand .nn',
- '''
+ _assertHasChange('Expand .nn', '''
f() {
if (false) {
/*caret*/
@@ -631,16 +519,12 @@ f() {
}
test_nullnull() async {
- await _prepareCompletion(
- '.null',
- '''
+ await _prepareCompletion('.null', '''
f() {
null.null
}
''');
- _assertHasChange(
- 'Expand .null',
- '''
+ _assertHasChange('Expand .null', '''
f() {
if (true) {
/*caret*/
@@ -653,16 +537,12 @@ f() {
@reflectiveTest
class _ParenTest extends PostfixCompletionTest {
test_paren() async {
- await _prepareCompletion(
- '.par',
- '''
+ await _prepareCompletion('.par', '''
f(expr) {
expr.par
}
''');
- _assertHasChange(
- 'Expand .par',
- '''
+ _assertHasChange('Expand .par', '''
f(expr) {
(expr)
}
@@ -673,16 +553,12 @@ f(expr) {
@reflectiveTest
class _ReturnTest extends PostfixCompletionTest {
test_return() async {
- await _prepareCompletion(
- '.return',
- '''
+ await _prepareCompletion('.return', '''
f(expr) {
expr.return
}
''');
- _assertHasChange(
- 'Expand .return',
- '''
+ _assertHasChange('Expand .return', '''
f(expr) {
return expr;
}
@@ -693,16 +569,12 @@ f(expr) {
@reflectiveTest
class _SwitchTest extends PostfixCompletionTest {
test_return() async {
- await _prepareCompletion(
- '.switch',
- '''
+ await _prepareCompletion('.switch', '''
f(expr) {
expr.switch
}
''');
- _assertHasChange(
- 'Expand .switch',
- '''
+ _assertHasChange('Expand .switch', '''
f(expr) {
switch (expr) {
/*caret*/
@@ -715,16 +587,12 @@ f(expr) {
@reflectiveTest
class _TryTest extends PostfixCompletionTest {
test_try() async {
- await _prepareCompletion(
- '.try',
- '''
+ await _prepareCompletion('.try', '''
f() {
var x = 1.try
}
''');
- _assertHasChange(
- 'Expand .try',
- '''
+ _assertHasChange('Expand .try', '''
f() {
try {
var x = 1/*caret*/
@@ -738,9 +606,7 @@ f() {
@failingTest
test_try_invalid() async {
// The semicolon is fine; this fails because of the do-statement.
- await _prepareCompletion(
- '.try',
- '''
+ await _prepareCompletion('.try', '''
f() {
do {} while (true);.try
}
@@ -748,9 +614,7 @@ f() {
}
test_tryMultiline() async {
- await _prepareCompletion(
- '.try',
- '''
+ await _prepareCompletion('.try', '''
f(arg) {
arg
..first
@@ -759,9 +623,7 @@ f(arg) {
..fourth.try
}
''');
- _assertHasChange(
- 'Expand .try',
- '''
+ _assertHasChange('Expand .try', '''
f(arg) {
try {
arg
@@ -777,16 +639,12 @@ f(arg) {
}
test_tryon() async {
- await _prepareCompletion(
- '.tryon',
- '''
+ await _prepareCompletion('.tryon', '''
f() {
var x = 1.tryon
}
''');
- _assertHasChange(
- 'Expand .tryon',
- '''
+ _assertHasChange('Expand .tryon', '''
f() {
try {
var x = 1/*caret*/
@@ -798,16 +656,12 @@ f() {
}
test_tryonThrowStatement() async {
- await _prepareCompletion(
- '.tryon',
- '''
+ await _prepareCompletion('.tryon', '''
f() {
throw 'error';.tryon
}
''');
- _assertHasChange(
- 'Expand .tryon',
- '''
+ _assertHasChange('Expand .tryon', '''
f() {
try {
throw 'error';/*caret*/
@@ -819,16 +673,12 @@ f() {
}
test_tryonThrowString() async {
- await _prepareCompletion(
- '.tryon',
- '''
+ await _prepareCompletion('.tryon', '''
f() {
throw 'error'.tryon
}
''');
- _assertHasChange(
- 'Expand .tryon',
- '''
+ _assertHasChange('Expand .tryon', '''
f() {
try {
throw 'error'/*caret*/
@@ -843,16 +693,12 @@ f() {
@reflectiveTest
class _WhileTest extends PostfixCompletionTest {
test_while() async {
- await _prepareCompletion(
- '.while',
- '''
+ await _prepareCompletion('.while', '''
f(expr) {
expr.while
}
''');
- _assertHasChange(
- 'Expand .while',
- '''
+ _assertHasChange('Expand .while', '''
f(expr) {
while (expr) {
/*caret*/

Powered by Google App Engine
This is Rietveld 408576698