Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
cs2-23wi
lab02
Commits
ee35c510
Commit
ee35c510
authored
2 years ago
by
James C Bowden
Browse files
Options
Download
Email Patches
Plain Diff
re add try catch
parent
e96b305d
master
No related merge requests found
Pipeline
#76296
failed with stage
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/edu/caltech/cs2/lab02/GameTraceTests.java
+5
-1
tests/edu/caltech/cs2/lab02/GameTraceTests.java
with
5 additions
and
1 deletion
+5
-1
tests/edu/caltech/cs2/lab02/GameTraceTests.java
View file @
ee35c510
...
...
@@ -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
());
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help