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

Side by Side Diff: pkg/analysis_server/test/integration/edit/is_postfix_completion_applicable_test.dart

Issue 2961683002: Add integration tests for postfix server api (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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
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.
4
5 import 'package:analysis_server/protocol/protocol_generated.dart';
6 import 'package:analyzer_plugin/protocol/protocol_common.dart';
7 import 'package:test/test.dart';
8 import 'package:test_reflective_loader/test_reflective_loader.dart';
9
10 import '../support/integration_tests.dart';
11
12 main() {
13 defineReflectiveSuite(() {
14 defineReflectiveTests(IsPostfixCompletionApplicableTest);
15 });
16 }
17
18 @reflectiveTest
19 class IsPostfixCompletionApplicableTest
20 extends AbstractAnalysisServerIntegrationTest {
21 test_is_postfix_completion_applicable() async {
22 String pathname = sourcePath('test.dart');
23 String text = r'''
24 void bar() {
25 foo();.tryon
26 }
27 void foo() { }
28 ''';
29 int loc = text.indexOf('.tryon');
30 text = text.replaceAll('.tryon', '');
31 writeFile(pathname, text);
32 standardAnalysisSetup();
33
34 await analysisFinished;
35 expect(currentAnalysisErrors[pathname], isEmpty);
36
37 // expect a postfix completion applicable result
38 EditIsPostfixCompletionApplicableResult result =
39 await sendEditIsPostfixCompletionApplicable(pathname, '.tryon', loc);
40 expect(result.value, isTrue);
41 }
42 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698