Add generic test by nikxda

This commit is contained in:
Arne Keller 2020-03-11 11:01:03 +01:00
parent c058aeadde
commit e48233f10c
3 changed files with 263 additions and 0 deletions

103
generic_test_input.txt Normal file
View File

@ -0,0 +1,103 @@
start metal,wood,plastic,metal,metal,wood,wood,plastic,plastic,metal,wood,wood,spider,spider,metal,metal,spider,wood,metal,plastic,wood,wood,plastic,plastic,thunderstorm,metal,metal,wood,wood,snake,tiger,plastic,plastic,plastic,plastic,plastic,wood,metal,metal,wood,wood,wood,wood,wood,metal,metal,metal,plastic,plastic,plastic,plastic,plastic,metal,spider,snake,snake,snake,snake,spider,tiger,tiger,tiger,tiger,metal
draw
draw
draw
draw
draw
draw
draw
draw
draw
draw
draw
draw
build?
list-resources
build shack
build?
draw
rollD4 4
draw
rollD4 1
list-resources
draw
draw
build?
build axe
build?
draw
rollD6 1
rollD8 1
rollD4 1
draw
draw
draw
draw
draw
draw
draw
list-resources
build?
build fireplace
build?
list-buildings
list-resources
draw
list-resources
list-buildings
draw
draw
draw
draw
build?
build sailingraft
build?
rollD8 1
rollD4 1
list-resources
list-buildings
draw
rollD6 1
draw
rollD4 1
rollD8 1
rollD6 1
list-resources
build?
draw
rollD4 1
rollD6 1
rollD8 a
rollD8 9
rollD8 0
rollD8 3
draw
draw
draw
draw
draw
draw
build?
draw
draw
draw
draw
build?
build fireplace
build?
draw
build?
build ballon
draw
build?
build axe
rollD4 1
rollD8 1
rollD6 1
reset
list-resources
list-buildings
draw
draw
draw
quit

155
generic_test_output.txt Normal file
View File

@ -0,0 +1,155 @@
OK
metal
wood
plastic
metal
metal
wood
wood
plastic
plastic
metal
wood
wood
axe
club
fireplace
sailingraft
shack
metal
wood
plastic
metal
metal
wood
wood
plastic
plastic
metal
wood
wood
OK
axe
club
fireplace
spider
survived
spider
lose
plastic
metal
metal
wood
wood
metal
metal
axe
OK
EMPTY
spider
<e
<e
survived
wood
metal
plastic
wood
wood
plastic
plastic
plastic
metal
wood
wood
wood
metal
plastic
wood
wood
plastic
plastic
club
fireplace
hangglider
sailingraft
OK
EMPTY
fireplace
axe
shack
plastic
metal
wood
wood
plastic
plastic
plastic
thunderstorm
wood
wood
plastic
plastic
plastic
axe
shack
metal
metal
wood
wood
club
fireplace
sailingraft
OK
<e
<e
<e
plastic
sailingraft
axe
shack
<e
lose
snake
<e
<e
lose
plastic
EMPTY
tiger
<e
<e
<e
<e
<e
survived
plastic
plastic
plastic
plastic
plastic
wood
EMPTY
metal
metal
wood
wood
club
fireplace
hangglider
OK
EMPTY
wood
ballon
win
<e
<e
<e
<e
<e
<e
OK
EMPTY
EMPTY
metal
wood
plastic

View File

@ -33,6 +33,11 @@ class MainTest {
cmpInOut("game_over_no_actions_input.txt", "game_over_no_actions_output.txt");
}
@Test
void genericTest() throws IOException {
cmpInOut("generic_test_input.txt", "generic_test_output.txt");
}
private void cmpInOut(String in, String out) throws IOException {
System.setIn(new ByteArrayInputStream(readFile(in)));
ByteArrayOutputStream output = new ByteArrayOutputStream();