diff --git a/tests/edu/caltech/cs2/lab02/GameTraceTests.java b/tests/edu/caltech/cs2/lab02/GameTraceTests.java index 6a12b48f49ced16b7526ec6b1e8580ce0a912a18..e1b02112fa40ab1c6f0e06b1df0da57c69d8baef 100644 --- a/tests/edu/caltech/cs2/lab02/GameTraceTests.java +++ b/tests/edu/caltech/cs2/lab02/GameTraceTests.java @@ -11,6 +11,7 @@ import java.io.FileNotFoundException; import java.lang.reflect.Constructor; import java.lang.reflect.Field; import java.util.Map; +import java.util.NoSuchElementException; import java.util.Random; import java.util.Scanner; @@ -37,7 +38,10 @@ public class GameTraceTests { ) public void testAdventureGame(Map<String, String> arguments, String expectedOutput, CaptureSystemOutput.OutputCapture capture) throws FileNotFoundException { - runTestGame(arguments.get("stdin")); + try { + runTestGame(arguments.get("stdin")); + } catch (NoSuchElementException e) { + } assertEquals(expectedOutput.replace("\r\n", "\n").strip(), capture.toString().replace("\r\n", "\n").strip()); }