From 4232c7b14edd8662007b05f533f1519171b6e09f Mon Sep 17 00:00:00 2001 From: Arne Keller Date: Fri, 13 Mar 2020 08:52:09 +0100 Subject: [PATCH] Add integer parsing test --- integer_format_input.txt | 4 ++++ integer_format_output.txt | 3 +++ src/edu/kit/informatik/cardgame/MainTest.java | 5 +++++ 3 files changed, 12 insertions(+) create mode 100644 integer_format_input.txt create mode 100644 integer_format_output.txt diff --git a/integer_format_input.txt b/integer_format_input.txt new file mode 100644 index 0000000..7eaeac6 --- /dev/null +++ b/integer_format_input.txt @@ -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 diff --git a/integer_format_output.txt b/integer_format_output.txt new file mode 100644 index 0000000..534ee5f --- /dev/null +++ b/integer_format_output.txt @@ -0,0 +1,3 @@ +OK +spider +survived diff --git a/src/edu/kit/informatik/cardgame/MainTest.java b/src/edu/kit/informatik/cardgame/MainTest.java index 3bb06bc..4a139cc 100644 --- a/src/edu/kit/informatik/cardgame/MainTest.java +++ b/src/edu/kit/informatik/cardgame/MainTest.java @@ -59,6 +59,11 @@ class MainTest { 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 { System.setIn(new ByteArrayInputStream(readFile(in))); ByteArrayOutputStream output = new ByteArrayOutputStream();