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

Side by Side Diff: pkg/analysis_server/test/completion_test.dart

Issue 1303233008: improve keyword suggestions - fixes #24016 (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: merge Created 5 years, 3 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
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 library test.completion.support; 5 library test.completion.support;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:collection'; 8 import 'dart:collection';
9 9
10 import 'package:unittest/unittest.dart'; 10 import 'package:unittest/unittest.dart';
(...skipping 1583 matching lines...) Expand 10 before | Expand all | Expand 10 after
1594 var v2 = p is !3; 1594 var v2 = p is !3;
1595 var v2 = p is!4; 1595 var v2 = p is!4;
1596 }''', 1596 }''',
1597 <String>[ 1597 <String>[
1598 "1+MyClass", 1598 "1+MyClass",
1599 "2+MyClass", 1599 "2+MyClass",
1600 "3+MyClass", 1600 "3+MyClass",
1601 "3-v1", 1601 "3-v1",
1602 "4+is", 1602 "4+is",
1603 "4-isVariable" 1603 "4-isVariable"
1604 ], 1604 ]);
1605 failingTests: '4');
1606 1605
1607 buildTests( 1606 buildTests(
1608 'testCompletion_is_asIdentifierStart', 1607 'testCompletion_is_asIdentifierStart',
1609 ''' 1608 '''
1610 main(p) { 1609 main(p) {
1611 var isVisible; 1610 var isVisible;
1612 var v1 = is!1; 1611 var v1 = is!1;
1613 var v2 = is!2 1612 var v2 = is!2
1614 }''', 1613 }''',
1615 <String>["1+isVisible", "2+isVisible"]); 1614 <String>["1+isVisible", "2+isVisible"]);
(...skipping 22 matching lines...) Expand all
1638 <String>["1+MyClass", "1-justSomeVar"]); 1637 <String>["1+MyClass", "1-justSomeVar"]);
1639 1638
1640 buildTests( 1639 buildTests(
1641 'testCompletion_is_incompleteStatement2', 1640 'testCompletion_is_incompleteStatement2',
1642 ''' 1641 '''
1643 class MyClass {} 1642 class MyClass {}
1644 main(p) { 1643 main(p) {
1645 var isVariable; 1644 var isVariable;
1646 var v = p is!1 1645 var v = p is!1
1647 }''', 1646 }''',
1648 <String>["1+is", "1-isVariable"], 1647 <String>["1+is", "1-isVariable"]);
1649 failingTests: '1');
1650 1648
1651 buildTests( 1649 buildTests(
1652 'testCompletion_keyword_in', 1650 'testCompletion_keyword_in',
1653 ''' 1651 '''
1654 class Foo { int input = 7; mth() { if (in!1) {}}}''', 1652 class Foo { int input = 7; mth() { if (in!1) {}}}''',
1655 <String>["1+input"]); 1653 <String>["1+input"]);
1656 1654
1657 buildTests( 1655 buildTests(
1658 'testCompletion_keyword_syntheticIdentifier', 1656 'testCompletion_keyword_syntheticIdentifier',
1659 ''' 1657 '''
(...skipping 970 matching lines...) Expand 10 before | Expand all | Expand 10 after
2630 "C+catch", 2628 "C+catch",
2631 "D+var", 2629 "D+var",
2632 "E+void", 2630 "E+void",
2633 "F+assert", 2631 "F+assert",
2634 "G+continue", 2632 "G+continue",
2635 "H+break", 2633 "H+break",
2636 "J+if", 2634 "J+if",
2637 "K+else", 2635 "K+else",
2638 "L+return" 2636 "L+return"
2639 ], 2637 ],
2640 failingTests: '3BCHK'); 2638 failingTests: '3BCK');
2641 2639
2642 // operators in function 2640 // operators in function
2643 buildTests('test015', '''f(a,b,c) => a + b * c !1;''', <String>["1+=="], 2641 buildTests('test015', '''f(a,b,c) => a + b * c !1;''', <String>["1+=="],
2644 failingTests: '1'); 2642 failingTests: '1');
2645 2643
2646 // operators in return 2644 // operators in return
2647 buildTests( 2645 buildTests(
2648 'test016', 2646 'test016',
2649 '''class X {dynamic f(a,b,c) {return a + b * c !1;}}''', 2647 '''class X {dynamic f(a,b,c) {return a + b * c !1;}}''',
2650 <String>["1+=="], 2648 <String>["1+=="],
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
2994 } else { 2992 } else {
2995 ++expectedPassCount; 2993 ++expectedPassCount;
2996 tester(testName, () { 2994 tester(testName, () {
2997 CompletionTestCase test = new CompletionTestCase(); 2995 CompletionTestCase test = new CompletionTestCase();
2998 return test.runTest(spec, extraFiles); 2996 return test.runTest(spec, extraFiles);
2999 }); 2997 });
3000 } 2998 }
3001 } 2999 }
3002 } 3000 }
3003 } 3001 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698