Add integer parsing test

This commit is contained in:
Arne Keller 2020-03-13 08:52:09 +01:00
parent ae79b31f3d
commit 4232c7b14e
3 changed files with 12 additions and 0 deletions

4
integer_format_input.txt Normal file
View File

@ -0,0 +1,4 @@
start spider,spider,spider,spider,spider,snake,snake,snake,snake,snake,tiger,tiger,tiger,tiger,tiger,thunderstorm,wood,wood,wood,wood,wood,wood,wood,wood,wood,wood,wood,wood,wood,wood,wood,wood,plastic,plastic,plastic,plastic,plastic,plastic,plastic,plastic,plastic,plastic,plastic,plastic,plastic,plastic,plastic,plastic,metal,metal,metal,metal,metal,metal,metal,metal,metal,metal,metal,metal,metal,metal,metal,metal
draw
rollD+04 +000004
quit

View File

@ -0,0 +1,3 @@
OK
spider
survived

View File

@ -59,6 +59,11 @@ class MainTest {
cmpInOut("testcoverage_input.txt", "testcoverage_output.txt"); cmpInOut("testcoverage_input.txt", "testcoverage_output.txt");
} }
@Test
void integerFormat() throws IOException {
cmpInOut("integer_format_input.txt", "integer_format_output.txt");
}
private void cmpInOut(String in, String out) throws IOException { private void cmpInOut(String in, String out) throws IOException {
System.setIn(new ByteArrayInputStream(readFile(in))); System.setIn(new ByteArrayInputStream(readFile(in)));
ByteArrayOutputStream output = new ByteArrayOutputStream(); ByteArrayOutputStream output = new ByteArrayOutputStream();