Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
HugeYuan
delve
提交
79e6f7fa
D
delve
项目概览
HugeYuan
/
delve
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
delve
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
未验证
提交
79e6f7fa
编写于
4月 08, 2021
作者:
P
polinasok
提交者:
GitHub
4月 08, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
service/dap: minor test refactoring (#2421)
上级
c4b9c858
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
47 addition
and
52 deletion
+47
-52
service/dap/daptest/client.go
service/dap/daptest/client.go
+46
-46
service/dap/server_test.go
service/dap/server_test.go
+1
-6
未找到文件。
service/dap/daptest/client.go
浏览文件 @
79e6f7fa
...
@@ -50,18 +50,18 @@ func (c *Client) ReadMessage() (dap.Message, error) {
...
@@ -50,18 +50,18 @@ func (c *Client) ReadMessage() (dap.Message, error) {
return
dap
.
ReadProtocolMessage
(
c
.
reader
)
return
dap
.
ReadProtocolMessage
(
c
.
reader
)
}
}
func
(
c
*
Client
)
expectReadProtocol
Message
(
t
*
testing
.
T
)
dap
.
Message
{
func
(
c
*
Client
)
Expect
Message
(
t
*
testing
.
T
)
dap
.
Message
{
t
.
Helper
()
t
.
Helper
()
m
,
err
:=
dap
.
ReadProtocolMessage
(
c
.
reader
)
m
,
err
:=
dap
.
ReadProtocolMessage
(
c
.
reader
)
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Error
(
err
)
t
.
Fatal
(
err
)
}
}
return
m
return
m
}
}
func
(
c
*
Client
)
ExpectErrorResponse
(
t
*
testing
.
T
)
*
dap
.
ErrorResponse
{
func
(
c
*
Client
)
ExpectErrorResponse
(
t
*
testing
.
T
)
*
dap
.
ErrorResponse
{
t
.
Helper
()
t
.
Helper
()
er
:=
c
.
expectReadProtocol
Message
(
t
)
.
(
*
dap
.
ErrorResponse
)
er
:=
c
.
Expect
Message
(
t
)
.
(
*
dap
.
ErrorResponse
)
if
er
.
Body
.
Error
.
ShowUser
{
if
er
.
Body
.
Error
.
ShowUser
{
t
.
Errorf
(
"
\n
got %#v
\n
want ShowUser=false"
,
er
)
t
.
Errorf
(
"
\n
got %#v
\n
want ShowUser=false"
,
er
)
}
}
...
@@ -70,7 +70,7 @@ func (c *Client) ExpectErrorResponse(t *testing.T) *dap.ErrorResponse {
...
@@ -70,7 +70,7 @@ func (c *Client) ExpectErrorResponse(t *testing.T) *dap.ErrorResponse {
func
(
c
*
Client
)
ExpectVisibleErrorResponse
(
t
*
testing
.
T
)
*
dap
.
ErrorResponse
{
func
(
c
*
Client
)
ExpectVisibleErrorResponse
(
t
*
testing
.
T
)
*
dap
.
ErrorResponse
{
t
.
Helper
()
t
.
Helper
()
er
:=
c
.
expectReadProtocol
Message
(
t
)
.
(
*
dap
.
ErrorResponse
)
er
:=
c
.
Expect
Message
(
t
)
.
(
*
dap
.
ErrorResponse
)
if
!
er
.
Body
.
Error
.
ShowUser
{
if
!
er
.
Body
.
Error
.
ShowUser
{
t
.
Errorf
(
"
\n
got %#v
\n
want ShowUser=true"
,
er
)
t
.
Errorf
(
"
\n
got %#v
\n
want ShowUser=true"
,
er
)
}
}
...
@@ -79,7 +79,7 @@ func (c *Client) ExpectVisibleErrorResponse(t *testing.T) *dap.ErrorResponse {
...
@@ -79,7 +79,7 @@ func (c *Client) ExpectVisibleErrorResponse(t *testing.T) *dap.ErrorResponse {
func
(
c
*
Client
)
expectErrorResponse
(
t
*
testing
.
T
,
id
int
,
message
string
)
*
dap
.
ErrorResponse
{
func
(
c
*
Client
)
expectErrorResponse
(
t
*
testing
.
T
,
id
int
,
message
string
)
*
dap
.
ErrorResponse
{
t
.
Helper
()
t
.
Helper
()
er
:=
c
.
expectReadProtocol
Message
(
t
)
.
(
*
dap
.
ErrorResponse
)
er
:=
c
.
Expect
Message
(
t
)
.
(
*
dap
.
ErrorResponse
)
if
er
.
Body
.
Error
.
Id
!=
id
||
er
.
Message
!=
message
{
if
er
.
Body
.
Error
.
Id
!=
id
||
er
.
Message
!=
message
{
t
.
Errorf
(
"
\n
got %#v
\n
want Id=%d Message=%q"
,
er
,
id
,
message
)
t
.
Errorf
(
"
\n
got %#v
\n
want Id=%d Message=%q"
,
er
,
id
,
message
)
}
}
...
@@ -98,37 +98,37 @@ func (c *Client) ExpectUnsupportedCommandErrorResponse(t *testing.T) *dap.ErrorR
...
@@ -98,37 +98,37 @@ func (c *Client) ExpectUnsupportedCommandErrorResponse(t *testing.T) *dap.ErrorR
func
(
c
*
Client
)
ExpectDisconnectResponse
(
t
*
testing
.
T
)
*
dap
.
DisconnectResponse
{
func
(
c
*
Client
)
ExpectDisconnectResponse
(
t
*
testing
.
T
)
*
dap
.
DisconnectResponse
{
t
.
Helper
()
t
.
Helper
()
return
c
.
expectReadProtocol
Message
(
t
)
.
(
*
dap
.
DisconnectResponse
)
return
c
.
Expect
Message
(
t
)
.
(
*
dap
.
DisconnectResponse
)
}
}
func
(
c
*
Client
)
ExpectContinueResponse
(
t
*
testing
.
T
)
*
dap
.
ContinueResponse
{
func
(
c
*
Client
)
ExpectContinueResponse
(
t
*
testing
.
T
)
*
dap
.
ContinueResponse
{
t
.
Helper
()
t
.
Helper
()
return
c
.
expectReadProtocol
Message
(
t
)
.
(
*
dap
.
ContinueResponse
)
return
c
.
Expect
Message
(
t
)
.
(
*
dap
.
ContinueResponse
)
}
}
func
(
c
*
Client
)
ExpectNextResponse
(
t
*
testing
.
T
)
*
dap
.
NextResponse
{
func
(
c
*
Client
)
ExpectNextResponse
(
t
*
testing
.
T
)
*
dap
.
NextResponse
{
t
.
Helper
()
t
.
Helper
()
return
c
.
expectReadProtocol
Message
(
t
)
.
(
*
dap
.
NextResponse
)
return
c
.
Expect
Message
(
t
)
.
(
*
dap
.
NextResponse
)
}
}
func
(
c
*
Client
)
ExpectStepInResponse
(
t
*
testing
.
T
)
*
dap
.
StepInResponse
{
func
(
c
*
Client
)
ExpectStepInResponse
(
t
*
testing
.
T
)
*
dap
.
StepInResponse
{
t
.
Helper
()
t
.
Helper
()
return
c
.
expectReadProtocol
Message
(
t
)
.
(
*
dap
.
StepInResponse
)
return
c
.
Expect
Message
(
t
)
.
(
*
dap
.
StepInResponse
)
}
}
func
(
c
*
Client
)
ExpectStepOutResponse
(
t
*
testing
.
T
)
*
dap
.
StepOutResponse
{
func
(
c
*
Client
)
ExpectStepOutResponse
(
t
*
testing
.
T
)
*
dap
.
StepOutResponse
{
t
.
Helper
()
t
.
Helper
()
return
c
.
expectReadProtocol
Message
(
t
)
.
(
*
dap
.
StepOutResponse
)
return
c
.
Expect
Message
(
t
)
.
(
*
dap
.
StepOutResponse
)
}
}
func
(
c
*
Client
)
ExpectTerminatedEvent
(
t
*
testing
.
T
)
*
dap
.
TerminatedEvent
{
func
(
c
*
Client
)
ExpectTerminatedEvent
(
t
*
testing
.
T
)
*
dap
.
TerminatedEvent
{
t
.
Helper
()
t
.
Helper
()
return
c
.
expectReadProtocol
Message
(
t
)
.
(
*
dap
.
TerminatedEvent
)
return
c
.
Expect
Message
(
t
)
.
(
*
dap
.
TerminatedEvent
)
}
}
func
(
c
*
Client
)
ExpectInitializeResponse
(
t
*
testing
.
T
)
*
dap
.
InitializeResponse
{
func
(
c
*
Client
)
ExpectInitializeResponse
(
t
*
testing
.
T
)
*
dap
.
InitializeResponse
{
t
.
Helper
()
t
.
Helper
()
initResp
:=
c
.
expectReadProtocol
Message
(
t
)
.
(
*
dap
.
InitializeResponse
)
initResp
:=
c
.
Expect
Message
(
t
)
.
(
*
dap
.
InitializeResponse
)
if
!
initResp
.
Body
.
SupportsConfigurationDoneRequest
{
if
!
initResp
.
Body
.
SupportsConfigurationDoneRequest
{
t
.
Errorf
(
"got %#v, want SupportsConfigurationDoneRequest=true"
,
initResp
)
t
.
Errorf
(
"got %#v, want SupportsConfigurationDoneRequest=true"
,
initResp
)
}
}
...
@@ -137,167 +137,167 @@ func (c *Client) ExpectInitializeResponse(t *testing.T) *dap.InitializeResponse
...
@@ -137,167 +137,167 @@ func (c *Client) ExpectInitializeResponse(t *testing.T) *dap.InitializeResponse
func
(
c
*
Client
)
ExpectInitializedEvent
(
t
*
testing
.
T
)
*
dap
.
InitializedEvent
{
func
(
c
*
Client
)
ExpectInitializedEvent
(
t
*
testing
.
T
)
*
dap
.
InitializedEvent
{
t
.
Helper
()
t
.
Helper
()
return
c
.
expectReadProtocol
Message
(
t
)
.
(
*
dap
.
InitializedEvent
)
return
c
.
Expect
Message
(
t
)
.
(
*
dap
.
InitializedEvent
)
}
}
func
(
c
*
Client
)
ExpectLaunchResponse
(
t
*
testing
.
T
)
*
dap
.
LaunchResponse
{
func
(
c
*
Client
)
ExpectLaunchResponse
(
t
*
testing
.
T
)
*
dap
.
LaunchResponse
{
t
.
Helper
()
t
.
Helper
()
return
c
.
expectReadProtocol
Message
(
t
)
.
(
*
dap
.
LaunchResponse
)
return
c
.
Expect
Message
(
t
)
.
(
*
dap
.
LaunchResponse
)
}
}
func
(
c
*
Client
)
ExpectAttachResponse
(
t
*
testing
.
T
)
*
dap
.
AttachResponse
{
func
(
c
*
Client
)
ExpectAttachResponse
(
t
*
testing
.
T
)
*
dap
.
AttachResponse
{
t
.
Helper
()
t
.
Helper
()
return
c
.
expectReadProtocol
Message
(
t
)
.
(
*
dap
.
AttachResponse
)
return
c
.
Expect
Message
(
t
)
.
(
*
dap
.
AttachResponse
)
}
}
func
(
c
*
Client
)
ExpectSetExceptionBreakpointsResponse
(
t
*
testing
.
T
)
*
dap
.
SetExceptionBreakpointsResponse
{
func
(
c
*
Client
)
ExpectSetExceptionBreakpointsResponse
(
t
*
testing
.
T
)
*
dap
.
SetExceptionBreakpointsResponse
{
t
.
Helper
()
t
.
Helper
()
return
c
.
expectReadProtocol
Message
(
t
)
.
(
*
dap
.
SetExceptionBreakpointsResponse
)
return
c
.
Expect
Message
(
t
)
.
(
*
dap
.
SetExceptionBreakpointsResponse
)
}
}
func
(
c
*
Client
)
ExpectSetBreakpointsResponse
(
t
*
testing
.
T
)
*
dap
.
SetBreakpointsResponse
{
func
(
c
*
Client
)
ExpectSetBreakpointsResponse
(
t
*
testing
.
T
)
*
dap
.
SetBreakpointsResponse
{
t
.
Helper
()
t
.
Helper
()
return
c
.
expectReadProtocol
Message
(
t
)
.
(
*
dap
.
SetBreakpointsResponse
)
return
c
.
Expect
Message
(
t
)
.
(
*
dap
.
SetBreakpointsResponse
)
}
}
func
(
c
*
Client
)
ExpectStoppedEvent
(
t
*
testing
.
T
)
*
dap
.
StoppedEvent
{
func
(
c
*
Client
)
ExpectStoppedEvent
(
t
*
testing
.
T
)
*
dap
.
StoppedEvent
{
t
.
Helper
()
t
.
Helper
()
return
c
.
expectReadProtocol
Message
(
t
)
.
(
*
dap
.
StoppedEvent
)
return
c
.
Expect
Message
(
t
)
.
(
*
dap
.
StoppedEvent
)
}
}
func
(
c
*
Client
)
ExpectOutputEvent
(
t
*
testing
.
T
)
*
dap
.
OutputEvent
{
func
(
c
*
Client
)
ExpectOutputEvent
(
t
*
testing
.
T
)
*
dap
.
OutputEvent
{
t
.
Helper
()
t
.
Helper
()
return
c
.
expectReadProtocol
Message
(
t
)
.
(
*
dap
.
OutputEvent
)
return
c
.
Expect
Message
(
t
)
.
(
*
dap
.
OutputEvent
)
}
}
func
(
c
*
Client
)
ExpectConfigurationDoneResponse
(
t
*
testing
.
T
)
*
dap
.
ConfigurationDoneResponse
{
func
(
c
*
Client
)
ExpectConfigurationDoneResponse
(
t
*
testing
.
T
)
*
dap
.
ConfigurationDoneResponse
{
t
.
Helper
()
t
.
Helper
()
return
c
.
expectReadProtocol
Message
(
t
)
.
(
*
dap
.
ConfigurationDoneResponse
)
return
c
.
Expect
Message
(
t
)
.
(
*
dap
.
ConfigurationDoneResponse
)
}
}
func
(
c
*
Client
)
ExpectThreadsResponse
(
t
*
testing
.
T
)
*
dap
.
ThreadsResponse
{
func
(
c
*
Client
)
ExpectThreadsResponse
(
t
*
testing
.
T
)
*
dap
.
ThreadsResponse
{
t
.
Helper
()
t
.
Helper
()
return
c
.
expectReadProtocol
Message
(
t
)
.
(
*
dap
.
ThreadsResponse
)
return
c
.
Expect
Message
(
t
)
.
(
*
dap
.
ThreadsResponse
)
}
}
func
(
c
*
Client
)
ExpectStackTraceResponse
(
t
*
testing
.
T
)
*
dap
.
StackTraceResponse
{
func
(
c
*
Client
)
ExpectStackTraceResponse
(
t
*
testing
.
T
)
*
dap
.
StackTraceResponse
{
t
.
Helper
()
t
.
Helper
()
return
c
.
expectReadProtocol
Message
(
t
)
.
(
*
dap
.
StackTraceResponse
)
return
c
.
Expect
Message
(
t
)
.
(
*
dap
.
StackTraceResponse
)
}
}
func
(
c
*
Client
)
ExpectScopesResponse
(
t
*
testing
.
T
)
*
dap
.
ScopesResponse
{
func
(
c
*
Client
)
ExpectScopesResponse
(
t
*
testing
.
T
)
*
dap
.
ScopesResponse
{
t
.
Helper
()
t
.
Helper
()
return
c
.
expectReadProtocol
Message
(
t
)
.
(
*
dap
.
ScopesResponse
)
return
c
.
Expect
Message
(
t
)
.
(
*
dap
.
ScopesResponse
)
}
}
func
(
c
*
Client
)
ExpectVariablesResponse
(
t
*
testing
.
T
)
*
dap
.
VariablesResponse
{
func
(
c
*
Client
)
ExpectVariablesResponse
(
t
*
testing
.
T
)
*
dap
.
VariablesResponse
{
t
.
Helper
()
t
.
Helper
()
return
c
.
expectReadProtocol
Message
(
t
)
.
(
*
dap
.
VariablesResponse
)
return
c
.
Expect
Message
(
t
)
.
(
*
dap
.
VariablesResponse
)
}
}
func
(
c
*
Client
)
ExpectEvaluateResponse
(
t
*
testing
.
T
)
*
dap
.
EvaluateResponse
{
func
(
c
*
Client
)
ExpectEvaluateResponse
(
t
*
testing
.
T
)
*
dap
.
EvaluateResponse
{
t
.
Helper
()
t
.
Helper
()
return
c
.
expectReadProtocol
Message
(
t
)
.
(
*
dap
.
EvaluateResponse
)
return
c
.
Expect
Message
(
t
)
.
(
*
dap
.
EvaluateResponse
)
}
}
func
(
c
*
Client
)
ExpectTerminateResponse
(
t
*
testing
.
T
)
*
dap
.
TerminateResponse
{
func
(
c
*
Client
)
ExpectTerminateResponse
(
t
*
testing
.
T
)
*
dap
.
TerminateResponse
{
t
.
Helper
()
t
.
Helper
()
return
c
.
expectReadProtocol
Message
(
t
)
.
(
*
dap
.
TerminateResponse
)
return
c
.
Expect
Message
(
t
)
.
(
*
dap
.
TerminateResponse
)
}
}
func
(
c
*
Client
)
ExpectRestartResponse
(
t
*
testing
.
T
)
*
dap
.
RestartResponse
{
func
(
c
*
Client
)
ExpectRestartResponse
(
t
*
testing
.
T
)
*
dap
.
RestartResponse
{
t
.
Helper
()
t
.
Helper
()
return
c
.
expectReadProtocol
Message
(
t
)
.
(
*
dap
.
RestartResponse
)
return
c
.
Expect
Message
(
t
)
.
(
*
dap
.
RestartResponse
)
}
}
func
(
c
*
Client
)
ExpectSetFunctionBreakpointsResponse
(
t
*
testing
.
T
)
*
dap
.
SetFunctionBreakpointsResponse
{
func
(
c
*
Client
)
ExpectSetFunctionBreakpointsResponse
(
t
*
testing
.
T
)
*
dap
.
SetFunctionBreakpointsResponse
{
t
.
Helper
()
t
.
Helper
()
return
c
.
expectReadProtocol
Message
(
t
)
.
(
*
dap
.
SetFunctionBreakpointsResponse
)
return
c
.
Expect
Message
(
t
)
.
(
*
dap
.
SetFunctionBreakpointsResponse
)
}
}
func
(
c
*
Client
)
ExpectStepBackResponse
(
t
*
testing
.
T
)
*
dap
.
StepBackResponse
{
func
(
c
*
Client
)
ExpectStepBackResponse
(
t
*
testing
.
T
)
*
dap
.
StepBackResponse
{
t
.
Helper
()
t
.
Helper
()
return
c
.
expectReadProtocol
Message
(
t
)
.
(
*
dap
.
StepBackResponse
)
return
c
.
Expect
Message
(
t
)
.
(
*
dap
.
StepBackResponse
)
}
}
func
(
c
*
Client
)
ExpectReverseContinueResponse
(
t
*
testing
.
T
)
*
dap
.
ReverseContinueResponse
{
func
(
c
*
Client
)
ExpectReverseContinueResponse
(
t
*
testing
.
T
)
*
dap
.
ReverseContinueResponse
{
t
.
Helper
()
t
.
Helper
()
return
c
.
expectReadProtocol
Message
(
t
)
.
(
*
dap
.
ReverseContinueResponse
)
return
c
.
Expect
Message
(
t
)
.
(
*
dap
.
ReverseContinueResponse
)
}
}
func
(
c
*
Client
)
ExpectRestartFrameResponse
(
t
*
testing
.
T
)
*
dap
.
RestartFrameResponse
{
func
(
c
*
Client
)
ExpectRestartFrameResponse
(
t
*
testing
.
T
)
*
dap
.
RestartFrameResponse
{
t
.
Helper
()
t
.
Helper
()
return
c
.
expectReadProtocol
Message
(
t
)
.
(
*
dap
.
RestartFrameResponse
)
return
c
.
Expect
Message
(
t
)
.
(
*
dap
.
RestartFrameResponse
)
}
}
func
(
c
*
Client
)
ExpectSetExpressionResponse
(
t
*
testing
.
T
)
*
dap
.
SetExpressionResponse
{
func
(
c
*
Client
)
ExpectSetExpressionResponse
(
t
*
testing
.
T
)
*
dap
.
SetExpressionResponse
{
t
.
Helper
()
t
.
Helper
()
return
c
.
expectReadProtocol
Message
(
t
)
.
(
*
dap
.
SetExpressionResponse
)
return
c
.
Expect
Message
(
t
)
.
(
*
dap
.
SetExpressionResponse
)
}
}
func
(
c
*
Client
)
ExpectTerminateThreadsResponse
(
t
*
testing
.
T
)
*
dap
.
TerminateThreadsResponse
{
func
(
c
*
Client
)
ExpectTerminateThreadsResponse
(
t
*
testing
.
T
)
*
dap
.
TerminateThreadsResponse
{
t
.
Helper
()
t
.
Helper
()
return
c
.
expectReadProtocol
Message
(
t
)
.
(
*
dap
.
TerminateThreadsResponse
)
return
c
.
Expect
Message
(
t
)
.
(
*
dap
.
TerminateThreadsResponse
)
}
}
func
(
c
*
Client
)
ExpectStepInTargetsResponse
(
t
*
testing
.
T
)
*
dap
.
StepInTargetsResponse
{
func
(
c
*
Client
)
ExpectStepInTargetsResponse
(
t
*
testing
.
T
)
*
dap
.
StepInTargetsResponse
{
t
.
Helper
()
t
.
Helper
()
return
c
.
expectReadProtocol
Message
(
t
)
.
(
*
dap
.
StepInTargetsResponse
)
return
c
.
Expect
Message
(
t
)
.
(
*
dap
.
StepInTargetsResponse
)
}
}
func
(
c
*
Client
)
ExpectGotoTargetsResponse
(
t
*
testing
.
T
)
*
dap
.
GotoTargetsResponse
{
func
(
c
*
Client
)
ExpectGotoTargetsResponse
(
t
*
testing
.
T
)
*
dap
.
GotoTargetsResponse
{
t
.
Helper
()
t
.
Helper
()
return
c
.
expectReadProtocol
Message
(
t
)
.
(
*
dap
.
GotoTargetsResponse
)
return
c
.
Expect
Message
(
t
)
.
(
*
dap
.
GotoTargetsResponse
)
}
}
func
(
c
*
Client
)
ExpectCompletionsResponse
(
t
*
testing
.
T
)
*
dap
.
CompletionsResponse
{
func
(
c
*
Client
)
ExpectCompletionsResponse
(
t
*
testing
.
T
)
*
dap
.
CompletionsResponse
{
t
.
Helper
()
t
.
Helper
()
return
c
.
expectReadProtocol
Message
(
t
)
.
(
*
dap
.
CompletionsResponse
)
return
c
.
Expect
Message
(
t
)
.
(
*
dap
.
CompletionsResponse
)
}
}
func
(
c
*
Client
)
ExpectExceptionInfoResponse
(
t
*
testing
.
T
)
*
dap
.
ExceptionInfoResponse
{
func
(
c
*
Client
)
ExpectExceptionInfoResponse
(
t
*
testing
.
T
)
*
dap
.
ExceptionInfoResponse
{
t
.
Helper
()
t
.
Helper
()
return
c
.
expectReadProtocol
Message
(
t
)
.
(
*
dap
.
ExceptionInfoResponse
)
return
c
.
Expect
Message
(
t
)
.
(
*
dap
.
ExceptionInfoResponse
)
}
}
func
(
c
*
Client
)
ExpectLoadedSourcesResponse
(
t
*
testing
.
T
)
*
dap
.
LoadedSourcesResponse
{
func
(
c
*
Client
)
ExpectLoadedSourcesResponse
(
t
*
testing
.
T
)
*
dap
.
LoadedSourcesResponse
{
t
.
Helper
()
t
.
Helper
()
return
c
.
expectReadProtocol
Message
(
t
)
.
(
*
dap
.
LoadedSourcesResponse
)
return
c
.
Expect
Message
(
t
)
.
(
*
dap
.
LoadedSourcesResponse
)
}
}
func
(
c
*
Client
)
ExpectDataBreakpointInfoResponse
(
t
*
testing
.
T
)
*
dap
.
DataBreakpointInfoResponse
{
func
(
c
*
Client
)
ExpectDataBreakpointInfoResponse
(
t
*
testing
.
T
)
*
dap
.
DataBreakpointInfoResponse
{
t
.
Helper
()
t
.
Helper
()
return
c
.
expectReadProtocol
Message
(
t
)
.
(
*
dap
.
DataBreakpointInfoResponse
)
return
c
.
Expect
Message
(
t
)
.
(
*
dap
.
DataBreakpointInfoResponse
)
}
}
func
(
c
*
Client
)
ExpectSetDataBreakpointsResponse
(
t
*
testing
.
T
)
*
dap
.
SetDataBreakpointsResponse
{
func
(
c
*
Client
)
ExpectSetDataBreakpointsResponse
(
t
*
testing
.
T
)
*
dap
.
SetDataBreakpointsResponse
{
t
.
Helper
()
t
.
Helper
()
return
c
.
expectReadProtocol
Message
(
t
)
.
(
*
dap
.
SetDataBreakpointsResponse
)
return
c
.
Expect
Message
(
t
)
.
(
*
dap
.
SetDataBreakpointsResponse
)
}
}
func
(
c
*
Client
)
ExpectReadMemoryResponse
(
t
*
testing
.
T
)
*
dap
.
ReadMemoryResponse
{
func
(
c
*
Client
)
ExpectReadMemoryResponse
(
t
*
testing
.
T
)
*
dap
.
ReadMemoryResponse
{
t
.
Helper
()
t
.
Helper
()
return
c
.
expectReadProtocol
Message
(
t
)
.
(
*
dap
.
ReadMemoryResponse
)
return
c
.
Expect
Message
(
t
)
.
(
*
dap
.
ReadMemoryResponse
)
}
}
func
(
c
*
Client
)
ExpectDisassembleResponse
(
t
*
testing
.
T
)
*
dap
.
DisassembleResponse
{
func
(
c
*
Client
)
ExpectDisassembleResponse
(
t
*
testing
.
T
)
*
dap
.
DisassembleResponse
{
t
.
Helper
()
t
.
Helper
()
return
c
.
expectReadProtocol
Message
(
t
)
.
(
*
dap
.
DisassembleResponse
)
return
c
.
Expect
Message
(
t
)
.
(
*
dap
.
DisassembleResponse
)
}
}
func
(
c
*
Client
)
ExpectCancelResponse
(
t
*
testing
.
T
)
*
dap
.
CancelResponse
{
func
(
c
*
Client
)
ExpectCancelResponse
(
t
*
testing
.
T
)
*
dap
.
CancelResponse
{
t
.
Helper
()
t
.
Helper
()
return
c
.
expectReadProtocol
Message
(
t
)
.
(
*
dap
.
CancelResponse
)
return
c
.
Expect
Message
(
t
)
.
(
*
dap
.
CancelResponse
)
}
}
func
(
c
*
Client
)
ExpectBreakpointLocationsResponse
(
t
*
testing
.
T
)
*
dap
.
BreakpointLocationsResponse
{
func
(
c
*
Client
)
ExpectBreakpointLocationsResponse
(
t
*
testing
.
T
)
*
dap
.
BreakpointLocationsResponse
{
t
.
Helper
()
t
.
Helper
()
return
c
.
expectReadProtocol
Message
(
t
)
.
(
*
dap
.
BreakpointLocationsResponse
)
return
c
.
Expect
Message
(
t
)
.
(
*
dap
.
BreakpointLocationsResponse
)
}
}
func
(
c
*
Client
)
ExpectModulesResponse
(
t
*
testing
.
T
)
*
dap
.
ModulesResponse
{
func
(
c
*
Client
)
ExpectModulesResponse
(
t
*
testing
.
T
)
*
dap
.
ModulesResponse
{
t
.
Helper
()
t
.
Helper
()
return
c
.
expectReadProtocol
Message
(
t
)
.
(
*
dap
.
ModulesResponse
)
return
c
.
Expect
Message
(
t
)
.
(
*
dap
.
ModulesResponse
)
}
}
// InitializeRequest sends an 'initialize' request.
// InitializeRequest sends an 'initialize' request.
...
@@ -317,7 +317,7 @@ func (c *Client) InitializeRequest() {
...
@@ -317,7 +317,7 @@ func (c *Client) InitializeRequest() {
}
}
// LaunchRequest sends a 'launch' request with the specified args.
// LaunchRequest sends a 'launch' request with the specified args.
func
(
c
*
Client
)
LaunchRequest
(
mode
string
,
program
string
,
stopOnEntry
bool
)
{
func
(
c
*
Client
)
LaunchRequest
(
mode
,
program
string
,
stopOnEntry
bool
)
{
request
:=
&
dap
.
LaunchRequest
{
Request
:
*
c
.
newRequest
(
"launch"
)}
request
:=
&
dap
.
LaunchRequest
{
Request
:
*
c
.
newRequest
(
"launch"
)}
request
.
Arguments
=
map
[
string
]
interface
{}{
request
.
Arguments
=
map
[
string
]
interface
{}{
"request"
:
"launch"
,
"request"
:
"launch"
,
...
...
service/dap/server_test.go
浏览文件 @
79e6f7fa
...
@@ -2236,12 +2236,7 @@ func TestStepOutPreservesGoroutine(t *testing.T) {
...
@@ -2236,12 +2236,7 @@ func TestStepOutPreservesGoroutine(t *testing.T) {
client
.
StepOutRequest
(
goroutineId
)
client
.
StepOutRequest
(
goroutineId
)
client
.
ExpectStepOutResponse
(
t
)
client
.
ExpectStepOutResponse
(
t
)
m
,
err
:=
client
.
ReadMessage
()
switch
e
:=
client
.
ExpectMessage
(
t
)
.
(
type
)
{
if
err
!=
nil
{
t
.
Fatal
(
err
)
}
switch
e
:=
m
.
(
type
)
{
case
*
dap
.
StoppedEvent
:
case
*
dap
.
StoppedEvent
:
if
e
.
Body
.
ThreadId
!=
goroutineId
{
if
e
.
Body
.
ThreadId
!=
goroutineId
{
t
.
Fatalf
(
"StepOut did not continue on the selected goroutine, expected %d got %d"
,
goroutineId
,
e
.
Body
.
ThreadId
)
t
.
Fatalf
(
"StepOut did not continue on the selected goroutine, expected %d got %d"
,
goroutineId
,
e
.
Body
.
ThreadId
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录