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

Unified Diff: editor/tools/plugins/com.google.dart.tools.core_test/src/com/google/dart/tools/core/formatter/FormatterTests.java

Issue 8966004: Fix the Dart formatter (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 years 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: editor/tools/plugins/com.google.dart.tools.core_test/src/com/google/dart/tools/core/formatter/FormatterTests.java
===================================================================
--- editor/tools/plugins/com.google.dart.tools.core_test/src/com/google/dart/tools/core/formatter/FormatterTests.java (revision 2471)
+++ editor/tools/plugins/com.google.dart.tools.core_test/src/com/google/dart/tools/core/formatter/FormatterTests.java (working copy)
@@ -1,11 +1,11 @@
/*
* Copyright (c) 2011, the Dart project authors.
- *
+ *
* Licensed under the Eclipse Public License v1.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
- *
+ *
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
@@ -99,6 +99,11 @@
runTest("test002", "A.dart");//$NON-NLS-1$ //$NON-NLS-2$
}
+ /*
+ public void test007() {
+ runTest("test007", "A.dart");//$NON-NLS-1$ //$NON-NLS-2$
+ }
+
public void test003() {
runTest("test003", "A.dart");//$NON-NLS-1$ //$NON-NLS-2$
}
@@ -137,6 +142,7 @@
assertTrue("Failed " + failures + " of " + units.length + " tests (see console for specifics)",
failures == 0);
}
+ */
protected void assertLineEquals(String actualContents, String originalSource,
String expectedContents) {
@@ -169,7 +175,9 @@
}
if (!actual.equals(expected)) {
System.out.println("Expected source in " + getName() + " should be:");
- System.out.print(actual);
+ System.out.println("|" + actual + "|");
+ System.out.println(" but it is:");
+ System.out.println("|" + expected + "|");
}
assertEquals(message, expected, actual);
}
@@ -361,6 +369,8 @@
DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(
DefaultCodeFormatterConstants.getDartConventionsSettings());
preferences.number_of_empty_lines_to_preserve = 0;
+ preferences.blank_lines_before_imports = 0;
+ preferences.blank_lines_after_imports = 0;
DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
runTest(codeFormatter, testName, compilationUnitName, CodeFormatter.K_COMPILATION_UNIT, 0);
}

Powered by Google App Engine
This is Rietveld 408576698