Skip to content

Commit

Permalink
Catch a potential panic if evaluation errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
frenata committed Mar 31, 2018
1 parent 0bb1446 commit 33561a5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions context_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ func printsHello(t *testing.T, lang, code string) bool {
expected := "Hello"
stdouts, msg := box.Evaluate(lang, code, []string{stdin})

if len(stdouts) == 0 {
t.Log("Evaluation return no results: ")
t.Log(msg)
return false
}

log.Println(stdouts[0], msg)

if stdouts[0] == expected {
Expand Down

0 comments on commit 33561a5

Please sign in to comment.