octicon-rss(16/)
You've already forked delve
mirror of
https://github.com/go-delve/delve.git
synced 2025-11-10 01:49:24 +08:00
service/dap: fix continueOnEntryTest (#2489)
Accept the empty response in case the threads request arrived after the program terminated
This commit is contained in:
octicon-git-branch(16/)
octicon-tag(16/)
committed by
GitHub
gitea-unlock(16/)
parent
5fa4a3527c
commit
252bcc4ebc
octicon-diff(16/tw-mr-1) 1 changed files with 3 additions and 3 deletions
@@ -437,9 +437,9 @@ func TestContinueOnEntry(t *testing.T) {
|
|||||||
}
|
}
|
||||||
// Single current thread is sent when the program is running
|
// Single current thread is sent when the program is running
|
||||||
// because DAP spec expects at least one thread.
|
// because DAP spec expects at least one thread.
|
||||||
// TODO(polina): accept empty already-terminated response here as well?
|
// Also accept empty already-terminated response.
|
||||||
if len(m.Body.Threads) != 1 || m.Body.Threads[0].Id != -1 || m.Body.Threads[0].Name != "Current" {
|
if len(m.Body.Threads) != 0 && (len(m.Body.Threads) != 1 || m.Body.Threads[0].Id != -1 || m.Body.Threads[0].Name != "Current") {
|
||||||
t.Errorf("\ngot %#v\nwant Id=-1, Name=\"Current\"", m.Body.Threads)
|
t.Errorf("\ngot %#v\nwant Id=-1, Name=\"Current\" or empty", m.Body.Threads)
|
||||||
}
|
}
|
||||||
case *dap.TerminatedEvent:
|
case *dap.TerminatedEvent:
|
||||||
default:
|
default:
|
||||||
|
|||||||
Reference in New Issue
Block a user