mirror of
https://github.com/Noratrieb/GRSBPL.git
synced 2026-01-14 19:55:03 +01:00
Update InterpreterTest.java
This commit is contained in:
parent
5414ef5e36
commit
67a9161f06
1 changed files with 15 additions and 0 deletions
|
|
@ -161,6 +161,14 @@ class InterpreterTest {
|
|||
assertEquals(0, run(program));
|
||||
assertEquals("hello world!\n", out.getOut());
|
||||
}
|
||||
|
||||
@Test
|
||||
void strings() {
|
||||
String program = "\"hallo\" out 't' out";
|
||||
System.setOut(out);
|
||||
assertEquals(0, run(program));
|
||||
assertEquals("hallot", out.getOut());
|
||||
}
|
||||
|
||||
static class OutStream extends PrintStream {
|
||||
private final StringBuilder builder = new StringBuilder();
|
||||
|
|
@ -177,6 +185,13 @@ class InterpreterTest {
|
|||
public void print(char c) {
|
||||
builder.append(c);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void print(String s) {
|
||||
builder.append(s);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void print(int i) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue