Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public void testFormatNonJavaFiles() throws Exception {

// should fail because the file does not exist
assertThat(main.format("Foo.java")).isNotEqualTo(0);
assertThat(err.toString()).contains("could not read file: " + "Foo.java");
assertThat(err.toString()).contains("Foo.java" + ": could not read file: ");
}

@Test
Expand Down Expand Up @@ -241,23 +241,23 @@ public void lineCommentTrailingBlank() throws FormatterException {
String expect = "class T {\n // asd\n\n int x;\n}\n";
assertThat(output).isEqualTo(expect);
}

@Test
public void noBlankAfterLineCommentWithInteriorBlankLine() throws FormatterException {
String input = "class T {\n// asd \n\n// dsa \nint x;\n}";
String output = new Formatter().formatSource(input);
String expect = "class T {\n // asd\n\n // dsa\n int x;\n}\n";
assertThat(output).isEqualTo(expect);
}

@Test
public void badConstructor() throws FormatterException {
String input = "class X { Y() {} }";
String output = new Formatter().formatSource(input);
String expect = "class X {\n Y() {}\n}\n";
assertThat(output).isEqualTo(expect);
}

@Test
public void voidMethod() throws FormatterException {
String input = "class X { void Y() {} }";
Expand Down