Skip to content

Commit d236653

Browse files
committed
Fixed tests
1 parent 3f661f4 commit d236653

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/test/java/il/ac/bgu/cs/bp/bpjs/BrokenCodeTest.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,13 @@ public void brokenSyntaxRunTest() throws IOException {
9191

9292
@Test(expected=BPjsCodeEvaluationException.class)
9393
public void brokenSyntaxDfsTest() throws Exception {
94-
BProgram bp = new ResourceBProgram("broken/syntaxError.js");
95-
DfsBProgramVerifier vfr = new DfsBProgramVerifier();
96-
vfr.verify(bp);
94+
try (InputStream resource = Thread.currentThread().getContextClassLoader().getResourceAsStream("broken/syntaxError.js")) {
95+
String raw = new String(resource.readAllBytes(), StandardCharsets.UTF_8);
96+
String post = Arrays.asList( raw.split("\n") ).stream().filter(s->!s.contains("REMOVE")).collect(joining("\n"));
97+
BProgram bp = new StringBProgram(post);
98+
DfsBProgramVerifier vfr = new DfsBProgramVerifier();
99+
vfr.verify(bp);
100+
}
97101
}
98102

99103
@Test()

0 commit comments

Comments
 (0)