Skip to content

Commit 87223db

Browse files
committed
- r prepare to replace tab
1 parent 0954b61 commit 87223db

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

approvaltests/src/main/java/org/approvaltests/inline/InlineJavaReporter.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ public String createReceived(String actual)
3939
}
4040
public static String createNewReceivedFileText(String text, String actual, String methodName)
4141
{
42+
String tab = "\t";
4243
text = text.replaceAll("\r\n", "\n");
4344
int start = text.indexOf("void " + methodName + "(");
4445
start = text.indexOf("{", start);
@@ -57,17 +58,17 @@ public static String createNewReceivedFileText(String text, String actual, Strin
5758
{
5859
part2 = text.substring(next + 1);
5960
}
60-
String fullText = String.format("%s\n\t\tvar expected = \"\"\"\n%s\t\t\"\"\";\n%s", part1, indent(actual),
61-
part2);
61+
String fullText = String.format("%s\n%s%svar expected = \"\"\"\n%s%s%s\"\"\";\n%s", part1, tab, tab,
62+
indent(actual, tab), tab, tab, part2);
6263
return fullText;
6364
}
64-
public static String indent(String actual)
65+
public static String indent(String actual, String tab)
6566
{
6667
String[] split = actual.split("\n");
6768
String output = "";
6869
for (String line : split)
6970
{
70-
output += "\t\t" + line + "\n";
71+
output += tab + tab + line + "\n";
7172
}
7273
return output;
7374
}

0 commit comments

Comments
 (0)