Add generic waf2 test 1 by usosx

This commit is contained in:
Arne Keller 2020-03-11 11:11:30 +01:00
parent 627f0f96ab
commit 1e95394391
3 changed files with 310 additions and 0 deletions

124
generic_waf2_test_input.txt Normal file
View File

@ -0,0 +1,124 @@
draw
list-resources
build axe
build
list-buildings
build?
rollD4 4
rollD6 4
rollD8 4
reset
start wod,spider,snake,tiger,wood,wood,wood,wood,wood,wood,wood,wood,wood,wood,wood,wood,wood,wood,wood,metal,metal,metal,metal,metal,metal,metal,metal,metal,metal,metal,metal,metal,metal,metal,metal,plastic,plastic,plastic,plastic,plastic,plastic,plastic,plastic,plastic,plastic,plastic,plastic,plastic,plastic,plastic,plastic,spider,spider,spider,spider,snake,snake,snake,snake,tiger,tiger,tiger,tiger,thunderstorm
start wood,spider,snake,tiger,wood,wood,wood,wood,wood,wood,wood,wood,wood,wood,wood,wood,wood,wood,wood,metal,metal,metal,metal,metal,metal,metal,metal,metal,metal,metal,metal,metal,metal,metal,metal,plastic,plastic,plastic,plastic,plastic,plastic,plastic,plastic,plastic,plastic,plastic,plastic,plastic,plastic,plastic,plastic,spider,spider,spider,spider,snake,snake,snake,snake,tiger,tiger,tiger,tiger,thunderstorm
list-resources
draw
list-resources
build axe
build
list-buildings
build?
rollD4 4
rollD6 4
rollD8 4
start wood,spider,snake,tiger,wood,wood,wood,wood,wood,wood,wood,wood,wood,wood,wood,wood,wood,wood,wood,metal,metal,metal,metal,metal,metal,metal,metal,metal,metal,metal,metal,metal,metal,metal,metal,plastic,plastic,plastic,plastic,plastic,plastic,plastic,plastic,plastic,plastic,plastic,plastic,plastic,plastic,plastic,plastic,spider,spider,spider,spider,snake,snake,snake,snake,tiger,tiger,tiger,tiger,thunderstorm
reset
list-resources
draw
list-resources
draw
draw
list-resources
build axe
build
list-buildings
build?
rollD6 4
rollD8 8
rollD4 4
draw
draw
list-resources
build axe
build
list-buildings
build?
rollD4 4
rollD8 8
rollD6 6
draw
draw
list-resources
build axe
build
list-buildings
build?
rollD4 4
rollD6 6
rollD8 8
draw
draw
draw
draw
draw
draw
draw
draw
draw
draw
draw
draw
draw
draw
draw
draw
draw
draw
draw
draw
draw
draw
draw
draw
draw
draw
draw
draw
draw
draw
draw
draw
draw
draw
draw
draw
draw
draw
draw
draw
draw
draw
draw
draw
draw
draw
draw
list-resources
list-buildings
build?
build fireplace
build?
draw
build club
build?
rollD4 3
build club
draw
build axe
build?
rollD4 2
build axe
draw
build axe
build?
rollD4 1
quit

View File

@ -0,0 +1,181 @@
Error, no card to draw exists
Error, can not get resources: game not started
Error, could not build item
Error, unknown command
Error, can not get buildings: game not started
Error, can not get buildable items: game not started
Error, not expecting dice roll
Error, not expecting dice roll
Error, not expecting dice roll
Error, can not reset a game that is not started!
Error, invalid start argument value(s)
OK
EMPTY
wood
wood
Error, could not build item
Error, unknown command
EMPTY
EMPTY
Error, not expecting dice roll
Error, not expecting dice roll
Error, not expecting dice roll
Error, could not start game
OK
EMPTY
wood
wood
spider
Error, roll dice, please
wood
Error, could not build item
Error, unknown command
EMPTY
Error, can not get buildable items: awaiting dice roll
Error, unexpected dice size
Error, unexpected dice size
survived
snake
Error, roll dice, please
wood
Error, could not build item
Error, unknown command
EMPTY
Error, can not get buildable items: awaiting dice roll
Error, unexpected dice size
Error, unexpected dice size
survived
tiger
Error, roll dice, please
wood
Error, could not build item
Error, unknown command
EMPTY
Error, can not get buildable items: awaiting dice roll
Error, unexpected dice size
Error, unexpected dice size
survived
wood
wood
wood
wood
wood
wood
wood
wood
wood
wood
wood
wood
wood
wood
wood
metal
metal
metal
metal
metal
metal
metal
metal
metal
metal
metal
metal
metal
metal
metal
metal
plastic
plastic
plastic
plastic
plastic
plastic
plastic
plastic
plastic
plastic
plastic
plastic
plastic
plastic
plastic
plastic
wood
wood
wood
wood
wood
wood
wood
wood
wood
wood
wood
wood
wood
wood
wood
wood
metal
metal
metal
metal
metal
metal
metal
metal
metal
metal
metal
metal
metal
metal
metal
metal
plastic
plastic
plastic
plastic
plastic
plastic
plastic
plastic
plastic
plastic
plastic
plastic
plastic
plastic
plastic
plastic
EMPTY
axe
club
fireplace
hangglider
sailingraft
shack
OK
axe
ballon
club
hangglider
sailingraft
shack
steamboat
spider
<e
<e
survived
OK
spider
<e
<e
survived
OK
spider
<e
<e
survived

View File

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