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

Unified Diff: pkg/analysis_server/test/edit/format_test.dart

Issue 1266923004: More fixes for failures on the Windows bot (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 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
Index: pkg/analysis_server/test/edit/format_test.dart
diff --git a/pkg/analysis_server/test/edit/format_test.dart b/pkg/analysis_server/test/edit/format_test.dart
index 20dbdb3a97a738d3434794fc82caede982bd28f9..b3a192b3e449d4addc9a71d80053806b08053901 100644
--- a/pkg/analysis_server/test/edit/format_test.dart
+++ b/pkg/analysis_server/test/edit/format_test.dart
@@ -14,9 +14,10 @@ import 'package:unittest/unittest.dart' hide ERROR;
import '../analysis_abstract.dart';
import '../mocks.dart';
+import '../utils.dart';
main() {
- groupSep = ' | ';
+ initializeTestEnvironment();
defineReflectiveTests(FormatTest);
}
@@ -31,6 +32,24 @@ class FormatTest extends AbstractAnalysisTest {
handler = new EditDomainHandler(server);
}
+ Future test_format_longLine() {
+ String content = '''
+fun(firstParam, secondParam, thirdParam, fourthParam) {
+ if (firstParam.noNull && secondParam.noNull && thirdParam.noNull && fourthParam.noNull) {}
+}
+''';
+ addTestFile(content);
+ return waitForTasksFinished().then((_) {
+ EditFormatResult formatResult = _formatAt(0, 3, lineLength: 100);
+
+ expect(formatResult.edits, isNotNull);
+ expect(formatResult.edits, hasLength(0));
+
+ expect(formatResult.selectionOffset, equals(0));
+ expect(formatResult.selectionLength, equals(3));
+ });
+ }
+
Future test_format_noOp() {
// Already formatted source
addTestFile('''
@@ -86,24 +105,6 @@ main() {
});
}
- Future test_format_longLine() {
- String content = '''
-fun(firstParam, secondParam, thirdParam, fourthParam) {
- if (firstParam.noNull && secondParam.noNull && thirdParam.noNull && fourthParam.noNull) {}
-}
-''';
- addTestFile(content);
- return waitForTasksFinished().then((_) {
- EditFormatResult formatResult = _formatAt(0, 3, lineLength: 100);
-
- expect(formatResult.edits, isNotNull);
- expect(formatResult.edits, hasLength(0));
-
- expect(formatResult.selectionOffset, equals(0));
- expect(formatResult.selectionLength, equals(3));
- });
- }
-
Future test_format_withErrors() {
addTestFile('''
main() { int x =
@@ -115,9 +116,11 @@ main() { int x =
});
}
- EditFormatResult _formatAt(int selectionOffset, int selectionLength, {int lineLength}) {
+ EditFormatResult _formatAt(int selectionOffset, int selectionLength,
+ {int lineLength}) {
Request request = new EditFormatParams(
- testFile, selectionOffset, selectionLength, lineLength: lineLength).toRequest('0');
+ testFile, selectionOffset, selectionLength,
+ lineLength: lineLength).toRequest('0');
Response response = handleSuccessfulRequest(request);
return new EditFormatResult.fromResponse(response);
}
« no previous file with comments | « pkg/analysis_server/test/edit/fixes_test.dart ('k') | pkg/analysis_server/test/edit/organize_directives_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698