terminal: do not crash when process exits during next

Fixes #1090
This commit is contained in:
aarzilli
2018-01-26 15:48:47 +01:00
committed by Derek Parker
parent 74d330a013
commit 045763ef04
2 changed files with 26 additions and 4 deletions

View File

@ -717,3 +717,18 @@ func TestDisassembleAutogenerated(t *testing.T) {
}
})
}
func TestIssue1090(t *testing.T) {
// Exit while executing 'next' should report the "Process exited" error
// message instead of crashing.
withTestTerminal("math", t, func(term *FakeTerminal) {
term.MustExec("break main.main")
term.MustExec("continue")
for {
_, err := term.Exec("next")
if err != nil && strings.Contains(err.Error(), " has exited with status ") {
break
}
}
})
}