Skip to content

Commit 00ffc96

Browse files
author
Sam Pullara
committed
move these to the main repository
1 parent 06c2e04 commit 00ffc96

File tree

9 files changed

+5
-6
lines changed

9 files changed

+5
-6
lines changed

builder/src/test/java/com/sampullara/mustache/UnexecuteTest.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import java.io.BufferedReader;
1111
import java.io.File;
1212
import java.io.FileInputStream;
13+
import java.io.FileReader;
1314
import java.io.IOException;
1415
import java.io.InputStreamReader;
1516
import java.io.Reader;
@@ -274,7 +275,7 @@ public BufferedReader getReader(String name) throws MustacheException {
274275
path = "modules/" + name.split(":")[1];
275276
}
276277
try {
277-
return new BufferedReader(new InputStreamReader(ClassLoader.getSystemResource("ibis2/" + path).openStream()));
278+
return new BufferedReader(new FileReader(new File(root, "ibis2/" + path)));
278279
} catch (Exception e) {
279280
throw new MustacheException("Failed to open: " + path, e);
280281
}
@@ -305,7 +306,7 @@ protected String getContents(File root, String file) throws IOException {
305306
@BeforeClass
306307
public static void setUp() throws Exception {
307308
File file = new File("src/test/resources");
308-
root = new File(file, "super.html").exists() ? file : new File("builder/src/test/resources");
309+
root = new File(file, "simple.html").exists() ? file : new File("../src/test/resources");
309310
}
310311

311312
}

core/src/main/java/com/sampullara/mustache/Mustache.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,8 @@ protected Scope unexecute(String text, AtomicInteger position) throws MustacheEx
7474

7575
public static Code[] truncate(Code[] codes, int start, Code[] next) {
7676
if (codes.length <= 1) return next;
77-
int length = codes.length - start;
78-
Code[] truncate = new Code[length + (next == null ? 0 : next.length)];
79-
System.arraycopy(codes, start, truncate, 0, length);
80-
if (next != null) System.arraycopy(next, 0, truncate, length, next.length);
77+
Code[] truncate = new Code[codes.length - start];
78+
System.arraycopy(codes, start, truncate, 0, truncate.length);
8179
return truncate;
8280
}
8381

File renamed without changes.
File renamed without changes.

builder/src/test/resources/ibis2/network_digest_v1/content.html.mustache renamed to src/test/resources/ibis2/network_digest_v1/content.html.mustache

File renamed without changes.

builder/src/test/resources/ibis2/network_digest_v1/content.txt.mustache renamed to src/test/resources/ibis2/network_digest_v1/content.txt.mustache

File renamed without changes.

builder/src/test/resources/ibis2/network_digest_v1/footer.mustache renamed to src/test/resources/ibis2/network_digest_v1/footer.mustache

File renamed without changes.

builder/src/test/resources/ibis2/network_digest_v1/subject.txt.mustache renamed to src/test/resources/ibis2/network_digest_v1/subject.txt.mustache

File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)