Skip to content

Commit 8241c51

Browse files
committed
Add tests for stripIndent
1 parent aafd3e9 commit 8241c51

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

dev/core/src/com/google/gwt/dev/javac/testing/impl/JavaResourceBase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ public class JavaResourceBase {
346346
" }",
347347
" private native boolean equals(String obj) /*-{ return false; }-*/;",
348348
" public boolean equalsIgnoreCase(String str) { return false; }",
349-
" public native boolean isEmpty() /*-{ return true; }-*/;",
349+
" public int length() { return 0; }",
350350
" public static String valueOf(int i) { return \"\" + i; }",
351351
" public static String valueOf(char c) { return \"\" + c; }",
352352
" public int hashCode() { return 0; }",

user/test-super/com/google/gwt/emultest/super/com/google/gwt/emultest/java17/lang/StringTest.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,16 @@ public void testStripIndent() {
5858
assertEquals("x", hideFromCompiler("x").stripIndent());
5959
assertEquals("x", hideFromCompiler(" x").stripIndent());
6060
assertEquals("x\n", hideFromCompiler("x\r\n").stripIndent());
61+
assertEquals("x\n", hideFromCompiler(" x\n ").stripIndent());
62+
assertEquals(" x\n", hideFromCompiler(" x\n ").stripIndent());
63+
assertEquals(" x\n", hideFromCompiler(" x\n").stripIndent());
6164
assertEquals("x\ny", hideFromCompiler(" x\n y").stripIndent());
6265
assertEquals("x\ny", hideFromCompiler(" x\r\n y").stripIndent());
6366
assertEquals(" x\ny", hideFromCompiler(" x\n y").stripIndent());
6467
assertEquals("x\n y", hideFromCompiler(" x\n y").stripIndent());
6568
assertEquals("x\n\ny", hideFromCompiler(" x\n \n y").stripIndent());
6669
assertEquals(" x\ny", hideFromCompiler("\t x\r\n y").stripIndent());
70+
assertEquals("x\n\ny", hideFromCompiler(" x\n\n y").stripIndent());
6771
}
6872

6973
public void testTranslateEscapes() {

0 commit comments

Comments
 (0)