Skip to content

Commit

Permalink
Whitespace tweaks.
Browse files Browse the repository at this point in the history
  • Loading branch information
samskivert committed Nov 19, 2023
1 parent 28d9025 commit a1f5a81
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions src/test/java/com/samskivert/mustache/specs/SpecTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@
public class SpecTest {

private static final Yaml yaml = new Yaml();

private final Spec spec;
private final String name;
public SpecTest(Spec spec, String name) {

public SpecTest (Spec spec, String name) {
super();
this.spec = spec;
this.name = name;
}

private static Mustache.Compiler compiler;
private static SpecAwareTemplateLoader loader;

Expand All @@ -40,9 +40,9 @@ public static void setUp () {
loader = new SpecAwareTemplateLoader();
compiler = Mustache.compiler().defaultValue("").withLoader(loader);
}

@Test
public void test() throws Exception {
public void test () throws Exception {
//System.out.println("Testing: " + name);
loader.setSpec(spec);
String tmpl = spec.getTemplate();
Expand Down Expand Up @@ -74,29 +74,29 @@ public void test() throws Exception {
}
}
}
private static String showWhitespace(String s) {

private static String showWhitespace (String s) {
s = s.replace("\r\n", "\u240D");
s = s.replace('\t', '\u21E5');
s = s.replace("\n", "\u21B5\n");
s = s.replace("\u240D", "\u240D\n");

return s;
}

private static String uncrlf (String text) {
return (text == null) ? null : text.replace("\r", "\\r").replace("\n", "\\n");
}

@Parameters(name = "{1}")
public static Collection<Object[]> data() {
String[] groups = new String[] { //
"comments", //
"delimiters", //
"interpolation", //
"inverted", //
"sections", //
"partials"
public static Collection<Object[]> data () {
String[] groups = new String[] {
"comments",
"delimiters",
"interpolation",
"inverted",
"sections",
"partials"
};
List<Object[]> tuples = new ArrayList<>();
int i = 0;
Expand All @@ -110,7 +110,7 @@ public static Collection<Object[]> data() {
return tuples;
}

private static Iterable<Spec> getTestsForGroup(String name) {
private static Iterable<Spec> getTestsForGroup (String name) {
String ymlPath = "/specs/specs/" + name + ".yml";
try {
@SuppressWarnings("unchecked")
Expand All @@ -129,4 +129,4 @@ private static Iterable<Spec> getTestsForGroup(String name) {
}
}

}
}

0 comments on commit a1f5a81

Please sign in to comment.