github.com/neilgarb/delve@v1.9.2-nobreaks/service/dap/daptest/resp.go (about)

     1  package daptest
     2  
     3  // Code generated by go generate; DO NOT EDIT.
     4  // The code generator program is in ./gen directory.
     5  
     6  import (
     7  	"testing"
     8  
     9  	"github.com/google/go-dap"
    10  )
    11  
    12  // ExpectAttachResponse reads a protocol message from the connection
    13  // and fails the test if the read message is not *AttachResponse.
    14  func (c *Client) ExpectAttachResponse(t *testing.T) *dap.AttachResponse {
    15  	t.Helper()
    16  	m := c.ExpectMessage(t)
    17  	return c.CheckAttachResponse(t, m)
    18  }
    19  
    20  // CheckAttachResponse fails the test if m is not *AttachResponse.
    21  func (c *Client) CheckAttachResponse(t *testing.T, m dap.Message) *dap.AttachResponse {
    22  	t.Helper()
    23  	r, ok := m.(*dap.AttachResponse)
    24  	if !ok {
    25  		t.Fatalf("got %#v, want *dap.AttachResponse", m)
    26  	}
    27  	return r
    28  }
    29  
    30  // ExpectBreakpointEvent reads a protocol message from the connection
    31  // and fails the test if the read message is not *BreakpointEvent.
    32  func (c *Client) ExpectBreakpointEvent(t *testing.T) *dap.BreakpointEvent {
    33  	t.Helper()
    34  	m := c.ExpectMessage(t)
    35  	return c.CheckBreakpointEvent(t, m)
    36  }
    37  
    38  // CheckBreakpointEvent fails the test if m is not *BreakpointEvent.
    39  func (c *Client) CheckBreakpointEvent(t *testing.T, m dap.Message) *dap.BreakpointEvent {
    40  	t.Helper()
    41  	r, ok := m.(*dap.BreakpointEvent)
    42  	if !ok {
    43  		t.Fatalf("got %#v, want *dap.BreakpointEvent", m)
    44  	}
    45  	return r
    46  }
    47  
    48  // ExpectBreakpointLocationsResponse reads a protocol message from the connection
    49  // and fails the test if the read message is not *BreakpointLocationsResponse.
    50  func (c *Client) ExpectBreakpointLocationsResponse(t *testing.T) *dap.BreakpointLocationsResponse {
    51  	t.Helper()
    52  	m := c.ExpectMessage(t)
    53  	return c.CheckBreakpointLocationsResponse(t, m)
    54  }
    55  
    56  // CheckBreakpointLocationsResponse fails the test if m is not *BreakpointLocationsResponse.
    57  func (c *Client) CheckBreakpointLocationsResponse(t *testing.T, m dap.Message) *dap.BreakpointLocationsResponse {
    58  	t.Helper()
    59  	r, ok := m.(*dap.BreakpointLocationsResponse)
    60  	if !ok {
    61  		t.Fatalf("got %#v, want *dap.BreakpointLocationsResponse", m)
    62  	}
    63  	return r
    64  }
    65  
    66  // ExpectCancelResponse reads a protocol message from the connection
    67  // and fails the test if the read message is not *CancelResponse.
    68  func (c *Client) ExpectCancelResponse(t *testing.T) *dap.CancelResponse {
    69  	t.Helper()
    70  	m := c.ExpectMessage(t)
    71  	return c.CheckCancelResponse(t, m)
    72  }
    73  
    74  // CheckCancelResponse fails the test if m is not *CancelResponse.
    75  func (c *Client) CheckCancelResponse(t *testing.T, m dap.Message) *dap.CancelResponse {
    76  	t.Helper()
    77  	r, ok := m.(*dap.CancelResponse)
    78  	if !ok {
    79  		t.Fatalf("got %#v, want *dap.CancelResponse", m)
    80  	}
    81  	return r
    82  }
    83  
    84  // ExpectCapabilitiesEvent reads a protocol message from the connection
    85  // and fails the test if the read message is not *CapabilitiesEvent.
    86  func (c *Client) ExpectCapabilitiesEvent(t *testing.T) *dap.CapabilitiesEvent {
    87  	t.Helper()
    88  	m := c.ExpectMessage(t)
    89  	return c.CheckCapabilitiesEvent(t, m)
    90  }
    91  
    92  // CheckCapabilitiesEvent fails the test if m is not *CapabilitiesEvent.
    93  func (c *Client) CheckCapabilitiesEvent(t *testing.T, m dap.Message) *dap.CapabilitiesEvent {
    94  	t.Helper()
    95  	r, ok := m.(*dap.CapabilitiesEvent)
    96  	if !ok {
    97  		t.Fatalf("got %#v, want *dap.CapabilitiesEvent", m)
    98  	}
    99  	return r
   100  }
   101  
   102  // ExpectCompletionsResponse reads a protocol message from the connection
   103  // and fails the test if the read message is not *CompletionsResponse.
   104  func (c *Client) ExpectCompletionsResponse(t *testing.T) *dap.CompletionsResponse {
   105  	t.Helper()
   106  	m := c.ExpectMessage(t)
   107  	return c.CheckCompletionsResponse(t, m)
   108  }
   109  
   110  // CheckCompletionsResponse fails the test if m is not *CompletionsResponse.
   111  func (c *Client) CheckCompletionsResponse(t *testing.T, m dap.Message) *dap.CompletionsResponse {
   112  	t.Helper()
   113  	r, ok := m.(*dap.CompletionsResponse)
   114  	if !ok {
   115  		t.Fatalf("got %#v, want *dap.CompletionsResponse", m)
   116  	}
   117  	return r
   118  }
   119  
   120  // ExpectConfigurationDoneResponse reads a protocol message from the connection
   121  // and fails the test if the read message is not *ConfigurationDoneResponse.
   122  func (c *Client) ExpectConfigurationDoneResponse(t *testing.T) *dap.ConfigurationDoneResponse {
   123  	t.Helper()
   124  	m := c.ExpectMessage(t)
   125  	return c.CheckConfigurationDoneResponse(t, m)
   126  }
   127  
   128  // CheckConfigurationDoneResponse fails the test if m is not *ConfigurationDoneResponse.
   129  func (c *Client) CheckConfigurationDoneResponse(t *testing.T, m dap.Message) *dap.ConfigurationDoneResponse {
   130  	t.Helper()
   131  	oe, ok := m.(*dap.OutputEvent)
   132  	if !ok {
   133  		t.Fatalf("got %#v, want *dap.OutputEvent", m)
   134  	}
   135  	if oe.Body.Output != "Type 'dlv help' for list of commands.\n" {
   136  		t.Fatalf("got %#v, want Output=%q", m, "Type 'dlv help' for list of commands.\n")
   137  	}
   138  	m = c.ExpectMessage(t)
   139  	r, ok := m.(*dap.ConfigurationDoneResponse)
   140  	if !ok {
   141  		t.Fatalf("got %#v, want *dap.ConfigurationDoneResponse", m)
   142  	}
   143  	return r
   144  }
   145  
   146  // ExpectContinueResponse reads a protocol message from the connection
   147  // and fails the test if the read message is not *ContinueResponse.
   148  func (c *Client) ExpectContinueResponse(t *testing.T) *dap.ContinueResponse {
   149  	t.Helper()
   150  	m := c.ExpectMessage(t)
   151  	return c.CheckContinueResponse(t, m)
   152  }
   153  
   154  // CheckContinueResponse fails the test if m is not *ContinueResponse.
   155  func (c *Client) CheckContinueResponse(t *testing.T, m dap.Message) *dap.ContinueResponse {
   156  	t.Helper()
   157  	r, ok := m.(*dap.ContinueResponse)
   158  	if !ok {
   159  		t.Fatalf("got %#v, want *dap.ContinueResponse", m)
   160  	}
   161  	return r
   162  }
   163  
   164  // ExpectContinuedEvent reads a protocol message from the connection
   165  // and fails the test if the read message is not *ContinuedEvent.
   166  func (c *Client) ExpectContinuedEvent(t *testing.T) *dap.ContinuedEvent {
   167  	t.Helper()
   168  	m := c.ExpectMessage(t)
   169  	return c.CheckContinuedEvent(t, m)
   170  }
   171  
   172  // CheckContinuedEvent fails the test if m is not *ContinuedEvent.
   173  func (c *Client) CheckContinuedEvent(t *testing.T, m dap.Message) *dap.ContinuedEvent {
   174  	t.Helper()
   175  	r, ok := m.(*dap.ContinuedEvent)
   176  	if !ok {
   177  		t.Fatalf("got %#v, want *dap.ContinuedEvent", m)
   178  	}
   179  	return r
   180  }
   181  
   182  // ExpectDataBreakpointInfoResponse reads a protocol message from the connection
   183  // and fails the test if the read message is not *DataBreakpointInfoResponse.
   184  func (c *Client) ExpectDataBreakpointInfoResponse(t *testing.T) *dap.DataBreakpointInfoResponse {
   185  	t.Helper()
   186  	m := c.ExpectMessage(t)
   187  	return c.CheckDataBreakpointInfoResponse(t, m)
   188  }
   189  
   190  // CheckDataBreakpointInfoResponse fails the test if m is not *DataBreakpointInfoResponse.
   191  func (c *Client) CheckDataBreakpointInfoResponse(t *testing.T, m dap.Message) *dap.DataBreakpointInfoResponse {
   192  	t.Helper()
   193  	r, ok := m.(*dap.DataBreakpointInfoResponse)
   194  	if !ok {
   195  		t.Fatalf("got %#v, want *dap.DataBreakpointInfoResponse", m)
   196  	}
   197  	return r
   198  }
   199  
   200  // ExpectDisassembleResponse reads a protocol message from the connection
   201  // and fails the test if the read message is not *DisassembleResponse.
   202  func (c *Client) ExpectDisassembleResponse(t *testing.T) *dap.DisassembleResponse {
   203  	t.Helper()
   204  	m := c.ExpectMessage(t)
   205  	return c.CheckDisassembleResponse(t, m)
   206  }
   207  
   208  // CheckDisassembleResponse fails the test if m is not *DisassembleResponse.
   209  func (c *Client) CheckDisassembleResponse(t *testing.T, m dap.Message) *dap.DisassembleResponse {
   210  	t.Helper()
   211  	r, ok := m.(*dap.DisassembleResponse)
   212  	if !ok {
   213  		t.Fatalf("got %#v, want *dap.DisassembleResponse", m)
   214  	}
   215  	return r
   216  }
   217  
   218  // ExpectDisconnectResponse reads a protocol message from the connection
   219  // and fails the test if the read message is not *DisconnectResponse.
   220  func (c *Client) ExpectDisconnectResponse(t *testing.T) *dap.DisconnectResponse {
   221  	t.Helper()
   222  	m := c.ExpectMessage(t)
   223  	return c.CheckDisconnectResponse(t, m)
   224  }
   225  
   226  // CheckDisconnectResponse fails the test if m is not *DisconnectResponse.
   227  func (c *Client) CheckDisconnectResponse(t *testing.T, m dap.Message) *dap.DisconnectResponse {
   228  	t.Helper()
   229  	r, ok := m.(*dap.DisconnectResponse)
   230  	if !ok {
   231  		t.Fatalf("got %#v, want *dap.DisconnectResponse", m)
   232  	}
   233  	return r
   234  }
   235  
   236  // ExpectErrorResponse reads a protocol message from the connection
   237  // and fails the test if the read message is not *ErrorResponse.
   238  func (c *Client) ExpectErrorResponse(t *testing.T) *dap.ErrorResponse {
   239  	t.Helper()
   240  	m := c.ExpectMessage(t)
   241  	return c.CheckErrorResponse(t, m)
   242  }
   243  
   244  // CheckErrorResponse fails the test if m is not *ErrorResponse.
   245  func (c *Client) CheckErrorResponse(t *testing.T, m dap.Message) *dap.ErrorResponse {
   246  	t.Helper()
   247  	r, ok := m.(*dap.ErrorResponse)
   248  	if !ok {
   249  		t.Fatalf("got %#v, want *dap.ErrorResponse", m)
   250  	}
   251  	return r
   252  }
   253  
   254  // ExpectEvaluateResponse reads a protocol message from the connection
   255  // and fails the test if the read message is not *EvaluateResponse.
   256  func (c *Client) ExpectEvaluateResponse(t *testing.T) *dap.EvaluateResponse {
   257  	t.Helper()
   258  	m := c.ExpectMessage(t)
   259  	return c.CheckEvaluateResponse(t, m)
   260  }
   261  
   262  // CheckEvaluateResponse fails the test if m is not *EvaluateResponse.
   263  func (c *Client) CheckEvaluateResponse(t *testing.T, m dap.Message) *dap.EvaluateResponse {
   264  	t.Helper()
   265  	r, ok := m.(*dap.EvaluateResponse)
   266  	if !ok {
   267  		t.Fatalf("got %#v, want *dap.EvaluateResponse", m)
   268  	}
   269  	return r
   270  }
   271  
   272  // ExpectExceptionInfoResponse reads a protocol message from the connection
   273  // and fails the test if the read message is not *ExceptionInfoResponse.
   274  func (c *Client) ExpectExceptionInfoResponse(t *testing.T) *dap.ExceptionInfoResponse {
   275  	t.Helper()
   276  	m := c.ExpectMessage(t)
   277  	return c.CheckExceptionInfoResponse(t, m)
   278  }
   279  
   280  // CheckExceptionInfoResponse fails the test if m is not *ExceptionInfoResponse.
   281  func (c *Client) CheckExceptionInfoResponse(t *testing.T, m dap.Message) *dap.ExceptionInfoResponse {
   282  	t.Helper()
   283  	r, ok := m.(*dap.ExceptionInfoResponse)
   284  	if !ok {
   285  		t.Fatalf("got %#v, want *dap.ExceptionInfoResponse", m)
   286  	}
   287  	return r
   288  }
   289  
   290  // ExpectExitedEvent reads a protocol message from the connection
   291  // and fails the test if the read message is not *ExitedEvent.
   292  func (c *Client) ExpectExitedEvent(t *testing.T) *dap.ExitedEvent {
   293  	t.Helper()
   294  	m := c.ExpectMessage(t)
   295  	return c.CheckExitedEvent(t, m)
   296  }
   297  
   298  // CheckExitedEvent fails the test if m is not *ExitedEvent.
   299  func (c *Client) CheckExitedEvent(t *testing.T, m dap.Message) *dap.ExitedEvent {
   300  	t.Helper()
   301  	r, ok := m.(*dap.ExitedEvent)
   302  	if !ok {
   303  		t.Fatalf("got %#v, want *dap.ExitedEvent", m)
   304  	}
   305  	return r
   306  }
   307  
   308  // ExpectGotoResponse reads a protocol message from the connection
   309  // and fails the test if the read message is not *GotoResponse.
   310  func (c *Client) ExpectGotoResponse(t *testing.T) *dap.GotoResponse {
   311  	t.Helper()
   312  	m := c.ExpectMessage(t)
   313  	return c.CheckGotoResponse(t, m)
   314  }
   315  
   316  // CheckGotoResponse fails the test if m is not *GotoResponse.
   317  func (c *Client) CheckGotoResponse(t *testing.T, m dap.Message) *dap.GotoResponse {
   318  	t.Helper()
   319  	r, ok := m.(*dap.GotoResponse)
   320  	if !ok {
   321  		t.Fatalf("got %#v, want *dap.GotoResponse", m)
   322  	}
   323  	return r
   324  }
   325  
   326  // ExpectGotoTargetsResponse reads a protocol message from the connection
   327  // and fails the test if the read message is not *GotoTargetsResponse.
   328  func (c *Client) ExpectGotoTargetsResponse(t *testing.T) *dap.GotoTargetsResponse {
   329  	t.Helper()
   330  	m := c.ExpectMessage(t)
   331  	return c.CheckGotoTargetsResponse(t, m)
   332  }
   333  
   334  // CheckGotoTargetsResponse fails the test if m is not *GotoTargetsResponse.
   335  func (c *Client) CheckGotoTargetsResponse(t *testing.T, m dap.Message) *dap.GotoTargetsResponse {
   336  	t.Helper()
   337  	r, ok := m.(*dap.GotoTargetsResponse)
   338  	if !ok {
   339  		t.Fatalf("got %#v, want *dap.GotoTargetsResponse", m)
   340  	}
   341  	return r
   342  }
   343  
   344  // ExpectInitializeResponse reads a protocol message from the connection
   345  // and fails the test if the read message is not *InitializeResponse.
   346  func (c *Client) ExpectInitializeResponse(t *testing.T) *dap.InitializeResponse {
   347  	t.Helper()
   348  	m := c.ExpectMessage(t)
   349  	return c.CheckInitializeResponse(t, m)
   350  }
   351  
   352  // CheckInitializeResponse fails the test if m is not *InitializeResponse.
   353  func (c *Client) CheckInitializeResponse(t *testing.T, m dap.Message) *dap.InitializeResponse {
   354  	t.Helper()
   355  	r, ok := m.(*dap.InitializeResponse)
   356  	if !ok {
   357  		t.Fatalf("got %#v, want *dap.InitializeResponse", m)
   358  	}
   359  	return r
   360  }
   361  
   362  // ExpectInitializedEvent reads a protocol message from the connection
   363  // and fails the test if the read message is not *InitializedEvent.
   364  func (c *Client) ExpectInitializedEvent(t *testing.T) *dap.InitializedEvent {
   365  	t.Helper()
   366  	m := c.ExpectMessage(t)
   367  	return c.CheckInitializedEvent(t, m)
   368  }
   369  
   370  // CheckInitializedEvent fails the test if m is not *InitializedEvent.
   371  func (c *Client) CheckInitializedEvent(t *testing.T, m dap.Message) *dap.InitializedEvent {
   372  	t.Helper()
   373  	r, ok := m.(*dap.InitializedEvent)
   374  	if !ok {
   375  		t.Fatalf("got %#v, want *dap.InitializedEvent", m)
   376  	}
   377  	return r
   378  }
   379  
   380  // ExpectInvalidatedEvent reads a protocol message from the connection
   381  // and fails the test if the read message is not *InvalidatedEvent.
   382  func (c *Client) ExpectInvalidatedEvent(t *testing.T) *dap.InvalidatedEvent {
   383  	t.Helper()
   384  	m := c.ExpectMessage(t)
   385  	return c.CheckInvalidatedEvent(t, m)
   386  }
   387  
   388  // CheckInvalidatedEvent fails the test if m is not *InvalidatedEvent.
   389  func (c *Client) CheckInvalidatedEvent(t *testing.T, m dap.Message) *dap.InvalidatedEvent {
   390  	t.Helper()
   391  	r, ok := m.(*dap.InvalidatedEvent)
   392  	if !ok {
   393  		t.Fatalf("got %#v, want *dap.InvalidatedEvent", m)
   394  	}
   395  	return r
   396  }
   397  
   398  // ExpectLaunchResponse reads a protocol message from the connection
   399  // and fails the test if the read message is not *LaunchResponse.
   400  func (c *Client) ExpectLaunchResponse(t *testing.T) *dap.LaunchResponse {
   401  	t.Helper()
   402  	m := c.ExpectMessage(t)
   403  	return c.CheckLaunchResponse(t, m)
   404  }
   405  
   406  // CheckLaunchResponse fails the test if m is not *LaunchResponse.
   407  func (c *Client) CheckLaunchResponse(t *testing.T, m dap.Message) *dap.LaunchResponse {
   408  	t.Helper()
   409  	r, ok := m.(*dap.LaunchResponse)
   410  	if !ok {
   411  		t.Fatalf("got %#v, want *dap.LaunchResponse", m)
   412  	}
   413  	return r
   414  }
   415  
   416  // ExpectLoadedSourceEvent reads a protocol message from the connection
   417  // and fails the test if the read message is not *LoadedSourceEvent.
   418  func (c *Client) ExpectLoadedSourceEvent(t *testing.T) *dap.LoadedSourceEvent {
   419  	t.Helper()
   420  	m := c.ExpectMessage(t)
   421  	return c.CheckLoadedSourceEvent(t, m)
   422  }
   423  
   424  // CheckLoadedSourceEvent fails the test if m is not *LoadedSourceEvent.
   425  func (c *Client) CheckLoadedSourceEvent(t *testing.T, m dap.Message) *dap.LoadedSourceEvent {
   426  	t.Helper()
   427  	r, ok := m.(*dap.LoadedSourceEvent)
   428  	if !ok {
   429  		t.Fatalf("got %#v, want *dap.LoadedSourceEvent", m)
   430  	}
   431  	return r
   432  }
   433  
   434  // ExpectLoadedSourcesResponse reads a protocol message from the connection
   435  // and fails the test if the read message is not *LoadedSourcesResponse.
   436  func (c *Client) ExpectLoadedSourcesResponse(t *testing.T) *dap.LoadedSourcesResponse {
   437  	t.Helper()
   438  	m := c.ExpectMessage(t)
   439  	return c.CheckLoadedSourcesResponse(t, m)
   440  }
   441  
   442  // CheckLoadedSourcesResponse fails the test if m is not *LoadedSourcesResponse.
   443  func (c *Client) CheckLoadedSourcesResponse(t *testing.T, m dap.Message) *dap.LoadedSourcesResponse {
   444  	t.Helper()
   445  	r, ok := m.(*dap.LoadedSourcesResponse)
   446  	if !ok {
   447  		t.Fatalf("got %#v, want *dap.LoadedSourcesResponse", m)
   448  	}
   449  	return r
   450  }
   451  
   452  // ExpectMemoryEvent reads a protocol message from the connection
   453  // and fails the test if the read message is not *MemoryEvent.
   454  func (c *Client) ExpectMemoryEvent(t *testing.T) *dap.MemoryEvent {
   455  	t.Helper()
   456  	m := c.ExpectMessage(t)
   457  	return c.CheckMemoryEvent(t, m)
   458  }
   459  
   460  // CheckMemoryEvent fails the test if m is not *MemoryEvent.
   461  func (c *Client) CheckMemoryEvent(t *testing.T, m dap.Message) *dap.MemoryEvent {
   462  	t.Helper()
   463  	r, ok := m.(*dap.MemoryEvent)
   464  	if !ok {
   465  		t.Fatalf("got %#v, want *dap.MemoryEvent", m)
   466  	}
   467  	return r
   468  }
   469  
   470  // ExpectModuleEvent reads a protocol message from the connection
   471  // and fails the test if the read message is not *ModuleEvent.
   472  func (c *Client) ExpectModuleEvent(t *testing.T) *dap.ModuleEvent {
   473  	t.Helper()
   474  	m := c.ExpectMessage(t)
   475  	return c.CheckModuleEvent(t, m)
   476  }
   477  
   478  // CheckModuleEvent fails the test if m is not *ModuleEvent.
   479  func (c *Client) CheckModuleEvent(t *testing.T, m dap.Message) *dap.ModuleEvent {
   480  	t.Helper()
   481  	r, ok := m.(*dap.ModuleEvent)
   482  	if !ok {
   483  		t.Fatalf("got %#v, want *dap.ModuleEvent", m)
   484  	}
   485  	return r
   486  }
   487  
   488  // ExpectModulesResponse reads a protocol message from the connection
   489  // and fails the test if the read message is not *ModulesResponse.
   490  func (c *Client) ExpectModulesResponse(t *testing.T) *dap.ModulesResponse {
   491  	t.Helper()
   492  	m := c.ExpectMessage(t)
   493  	return c.CheckModulesResponse(t, m)
   494  }
   495  
   496  // CheckModulesResponse fails the test if m is not *ModulesResponse.
   497  func (c *Client) CheckModulesResponse(t *testing.T, m dap.Message) *dap.ModulesResponse {
   498  	t.Helper()
   499  	r, ok := m.(*dap.ModulesResponse)
   500  	if !ok {
   501  		t.Fatalf("got %#v, want *dap.ModulesResponse", m)
   502  	}
   503  	return r
   504  }
   505  
   506  // ExpectNextResponse reads a protocol message from the connection
   507  // and fails the test if the read message is not *NextResponse.
   508  func (c *Client) ExpectNextResponse(t *testing.T) *dap.NextResponse {
   509  	t.Helper()
   510  	m := c.ExpectMessage(t)
   511  	return c.CheckNextResponse(t, m)
   512  }
   513  
   514  // CheckNextResponse fails the test if m is not *NextResponse.
   515  func (c *Client) CheckNextResponse(t *testing.T, m dap.Message) *dap.NextResponse {
   516  	t.Helper()
   517  	_, ok := m.(*dap.ContinuedEvent)
   518  	if !ok {
   519  		t.Fatalf("got %#v, want *dap.ContinuedEvent", m)
   520  	}
   521  	m = c.ExpectMessage(t)
   522  	r, ok := m.(*dap.NextResponse)
   523  	if !ok {
   524  		t.Fatalf("got %#v, want *dap.NextResponse", m)
   525  	}
   526  	return r
   527  }
   528  
   529  // ExpectOutputEvent reads a protocol message from the connection
   530  // and fails the test if the read message is not *OutputEvent.
   531  func (c *Client) ExpectOutputEvent(t *testing.T) *dap.OutputEvent {
   532  	t.Helper()
   533  	m := c.ExpectMessage(t)
   534  	return c.CheckOutputEvent(t, m)
   535  }
   536  
   537  // CheckOutputEvent fails the test if m is not *OutputEvent.
   538  func (c *Client) CheckOutputEvent(t *testing.T, m dap.Message) *dap.OutputEvent {
   539  	t.Helper()
   540  	r, ok := m.(*dap.OutputEvent)
   541  	if !ok {
   542  		t.Fatalf("got %#v, want *dap.OutputEvent", m)
   543  	}
   544  	return r
   545  }
   546  
   547  // ExpectPauseResponse reads a protocol message from the connection
   548  // and fails the test if the read message is not *PauseResponse.
   549  func (c *Client) ExpectPauseResponse(t *testing.T) *dap.PauseResponse {
   550  	t.Helper()
   551  	m := c.ExpectMessage(t)
   552  	return c.CheckPauseResponse(t, m)
   553  }
   554  
   555  // CheckPauseResponse fails the test if m is not *PauseResponse.
   556  func (c *Client) CheckPauseResponse(t *testing.T, m dap.Message) *dap.PauseResponse {
   557  	t.Helper()
   558  	r, ok := m.(*dap.PauseResponse)
   559  	if !ok {
   560  		t.Fatalf("got %#v, want *dap.PauseResponse", m)
   561  	}
   562  	return r
   563  }
   564  
   565  // ExpectProcessEvent reads a protocol message from the connection
   566  // and fails the test if the read message is not *ProcessEvent.
   567  func (c *Client) ExpectProcessEvent(t *testing.T) *dap.ProcessEvent {
   568  	t.Helper()
   569  	m := c.ExpectMessage(t)
   570  	return c.CheckProcessEvent(t, m)
   571  }
   572  
   573  // CheckProcessEvent fails the test if m is not *ProcessEvent.
   574  func (c *Client) CheckProcessEvent(t *testing.T, m dap.Message) *dap.ProcessEvent {
   575  	t.Helper()
   576  	r, ok := m.(*dap.ProcessEvent)
   577  	if !ok {
   578  		t.Fatalf("got %#v, want *dap.ProcessEvent", m)
   579  	}
   580  	return r
   581  }
   582  
   583  // ExpectProgressEndEvent reads a protocol message from the connection
   584  // and fails the test if the read message is not *ProgressEndEvent.
   585  func (c *Client) ExpectProgressEndEvent(t *testing.T) *dap.ProgressEndEvent {
   586  	t.Helper()
   587  	m := c.ExpectMessage(t)
   588  	return c.CheckProgressEndEvent(t, m)
   589  }
   590  
   591  // CheckProgressEndEvent fails the test if m is not *ProgressEndEvent.
   592  func (c *Client) CheckProgressEndEvent(t *testing.T, m dap.Message) *dap.ProgressEndEvent {
   593  	t.Helper()
   594  	r, ok := m.(*dap.ProgressEndEvent)
   595  	if !ok {
   596  		t.Fatalf("got %#v, want *dap.ProgressEndEvent", m)
   597  	}
   598  	return r
   599  }
   600  
   601  // ExpectProgressStartEvent reads a protocol message from the connection
   602  // and fails the test if the read message is not *ProgressStartEvent.
   603  func (c *Client) ExpectProgressStartEvent(t *testing.T) *dap.ProgressStartEvent {
   604  	t.Helper()
   605  	m := c.ExpectMessage(t)
   606  	return c.CheckProgressStartEvent(t, m)
   607  }
   608  
   609  // CheckProgressStartEvent fails the test if m is not *ProgressStartEvent.
   610  func (c *Client) CheckProgressStartEvent(t *testing.T, m dap.Message) *dap.ProgressStartEvent {
   611  	t.Helper()
   612  	r, ok := m.(*dap.ProgressStartEvent)
   613  	if !ok {
   614  		t.Fatalf("got %#v, want *dap.ProgressStartEvent", m)
   615  	}
   616  	return r
   617  }
   618  
   619  // ExpectProgressUpdateEvent reads a protocol message from the connection
   620  // and fails the test if the read message is not *ProgressUpdateEvent.
   621  func (c *Client) ExpectProgressUpdateEvent(t *testing.T) *dap.ProgressUpdateEvent {
   622  	t.Helper()
   623  	m := c.ExpectMessage(t)
   624  	return c.CheckProgressUpdateEvent(t, m)
   625  }
   626  
   627  // CheckProgressUpdateEvent fails the test if m is not *ProgressUpdateEvent.
   628  func (c *Client) CheckProgressUpdateEvent(t *testing.T, m dap.Message) *dap.ProgressUpdateEvent {
   629  	t.Helper()
   630  	r, ok := m.(*dap.ProgressUpdateEvent)
   631  	if !ok {
   632  		t.Fatalf("got %#v, want *dap.ProgressUpdateEvent", m)
   633  	}
   634  	return r
   635  }
   636  
   637  // ExpectReadMemoryResponse reads a protocol message from the connection
   638  // and fails the test if the read message is not *ReadMemoryResponse.
   639  func (c *Client) ExpectReadMemoryResponse(t *testing.T) *dap.ReadMemoryResponse {
   640  	t.Helper()
   641  	m := c.ExpectMessage(t)
   642  	return c.CheckReadMemoryResponse(t, m)
   643  }
   644  
   645  // CheckReadMemoryResponse fails the test if m is not *ReadMemoryResponse.
   646  func (c *Client) CheckReadMemoryResponse(t *testing.T, m dap.Message) *dap.ReadMemoryResponse {
   647  	t.Helper()
   648  	r, ok := m.(*dap.ReadMemoryResponse)
   649  	if !ok {
   650  		t.Fatalf("got %#v, want *dap.ReadMemoryResponse", m)
   651  	}
   652  	return r
   653  }
   654  
   655  // ExpectRestartFrameResponse reads a protocol message from the connection
   656  // and fails the test if the read message is not *RestartFrameResponse.
   657  func (c *Client) ExpectRestartFrameResponse(t *testing.T) *dap.RestartFrameResponse {
   658  	t.Helper()
   659  	m := c.ExpectMessage(t)
   660  	return c.CheckRestartFrameResponse(t, m)
   661  }
   662  
   663  // CheckRestartFrameResponse fails the test if m is not *RestartFrameResponse.
   664  func (c *Client) CheckRestartFrameResponse(t *testing.T, m dap.Message) *dap.RestartFrameResponse {
   665  	t.Helper()
   666  	r, ok := m.(*dap.RestartFrameResponse)
   667  	if !ok {
   668  		t.Fatalf("got %#v, want *dap.RestartFrameResponse", m)
   669  	}
   670  	return r
   671  }
   672  
   673  // ExpectRestartResponse reads a protocol message from the connection
   674  // and fails the test if the read message is not *RestartResponse.
   675  func (c *Client) ExpectRestartResponse(t *testing.T) *dap.RestartResponse {
   676  	t.Helper()
   677  	m := c.ExpectMessage(t)
   678  	return c.CheckRestartResponse(t, m)
   679  }
   680  
   681  // CheckRestartResponse fails the test if m is not *RestartResponse.
   682  func (c *Client) CheckRestartResponse(t *testing.T, m dap.Message) *dap.RestartResponse {
   683  	t.Helper()
   684  	r, ok := m.(*dap.RestartResponse)
   685  	if !ok {
   686  		t.Fatalf("got %#v, want *dap.RestartResponse", m)
   687  	}
   688  	return r
   689  }
   690  
   691  // ExpectReverseContinueResponse reads a protocol message from the connection
   692  // and fails the test if the read message is not *ReverseContinueResponse.
   693  func (c *Client) ExpectReverseContinueResponse(t *testing.T) *dap.ReverseContinueResponse {
   694  	t.Helper()
   695  	m := c.ExpectMessage(t)
   696  	return c.CheckReverseContinueResponse(t, m)
   697  }
   698  
   699  // CheckReverseContinueResponse fails the test if m is not *ReverseContinueResponse.
   700  func (c *Client) CheckReverseContinueResponse(t *testing.T, m dap.Message) *dap.ReverseContinueResponse {
   701  	t.Helper()
   702  	r, ok := m.(*dap.ReverseContinueResponse)
   703  	if !ok {
   704  		t.Fatalf("got %#v, want *dap.ReverseContinueResponse", m)
   705  	}
   706  	return r
   707  }
   708  
   709  // ExpectRunInTerminalResponse reads a protocol message from the connection
   710  // and fails the test if the read message is not *RunInTerminalResponse.
   711  func (c *Client) ExpectRunInTerminalResponse(t *testing.T) *dap.RunInTerminalResponse {
   712  	t.Helper()
   713  	m := c.ExpectMessage(t)
   714  	return c.CheckRunInTerminalResponse(t, m)
   715  }
   716  
   717  // CheckRunInTerminalResponse fails the test if m is not *RunInTerminalResponse.
   718  func (c *Client) CheckRunInTerminalResponse(t *testing.T, m dap.Message) *dap.RunInTerminalResponse {
   719  	t.Helper()
   720  	r, ok := m.(*dap.RunInTerminalResponse)
   721  	if !ok {
   722  		t.Fatalf("got %#v, want *dap.RunInTerminalResponse", m)
   723  	}
   724  	return r
   725  }
   726  
   727  // ExpectScopesResponse reads a protocol message from the connection
   728  // and fails the test if the read message is not *ScopesResponse.
   729  func (c *Client) ExpectScopesResponse(t *testing.T) *dap.ScopesResponse {
   730  	t.Helper()
   731  	m := c.ExpectMessage(t)
   732  	return c.CheckScopesResponse(t, m)
   733  }
   734  
   735  // CheckScopesResponse fails the test if m is not *ScopesResponse.
   736  func (c *Client) CheckScopesResponse(t *testing.T, m dap.Message) *dap.ScopesResponse {
   737  	t.Helper()
   738  	r, ok := m.(*dap.ScopesResponse)
   739  	if !ok {
   740  		t.Fatalf("got %#v, want *dap.ScopesResponse", m)
   741  	}
   742  	return r
   743  }
   744  
   745  // ExpectSetBreakpointsResponse reads a protocol message from the connection
   746  // and fails the test if the read message is not *SetBreakpointsResponse.
   747  func (c *Client) ExpectSetBreakpointsResponse(t *testing.T) *dap.SetBreakpointsResponse {
   748  	t.Helper()
   749  	m := c.ExpectMessage(t)
   750  	return c.CheckSetBreakpointsResponse(t, m)
   751  }
   752  
   753  // CheckSetBreakpointsResponse fails the test if m is not *SetBreakpointsResponse.
   754  func (c *Client) CheckSetBreakpointsResponse(t *testing.T, m dap.Message) *dap.SetBreakpointsResponse {
   755  	t.Helper()
   756  	r, ok := m.(*dap.SetBreakpointsResponse)
   757  	if !ok {
   758  		t.Fatalf("got %#v, want *dap.SetBreakpointsResponse", m)
   759  	}
   760  	return r
   761  }
   762  
   763  // ExpectSetDataBreakpointsResponse reads a protocol message from the connection
   764  // and fails the test if the read message is not *SetDataBreakpointsResponse.
   765  func (c *Client) ExpectSetDataBreakpointsResponse(t *testing.T) *dap.SetDataBreakpointsResponse {
   766  	t.Helper()
   767  	m := c.ExpectMessage(t)
   768  	return c.CheckSetDataBreakpointsResponse(t, m)
   769  }
   770  
   771  // CheckSetDataBreakpointsResponse fails the test if m is not *SetDataBreakpointsResponse.
   772  func (c *Client) CheckSetDataBreakpointsResponse(t *testing.T, m dap.Message) *dap.SetDataBreakpointsResponse {
   773  	t.Helper()
   774  	r, ok := m.(*dap.SetDataBreakpointsResponse)
   775  	if !ok {
   776  		t.Fatalf("got %#v, want *dap.SetDataBreakpointsResponse", m)
   777  	}
   778  	return r
   779  }
   780  
   781  // ExpectSetExceptionBreakpointsResponse reads a protocol message from the connection
   782  // and fails the test if the read message is not *SetExceptionBreakpointsResponse.
   783  func (c *Client) ExpectSetExceptionBreakpointsResponse(t *testing.T) *dap.SetExceptionBreakpointsResponse {
   784  	t.Helper()
   785  	m := c.ExpectMessage(t)
   786  	return c.CheckSetExceptionBreakpointsResponse(t, m)
   787  }
   788  
   789  // CheckSetExceptionBreakpointsResponse fails the test if m is not *SetExceptionBreakpointsResponse.
   790  func (c *Client) CheckSetExceptionBreakpointsResponse(t *testing.T, m dap.Message) *dap.SetExceptionBreakpointsResponse {
   791  	t.Helper()
   792  	r, ok := m.(*dap.SetExceptionBreakpointsResponse)
   793  	if !ok {
   794  		t.Fatalf("got %#v, want *dap.SetExceptionBreakpointsResponse", m)
   795  	}
   796  	return r
   797  }
   798  
   799  // ExpectSetExpressionResponse reads a protocol message from the connection
   800  // and fails the test if the read message is not *SetExpressionResponse.
   801  func (c *Client) ExpectSetExpressionResponse(t *testing.T) *dap.SetExpressionResponse {
   802  	t.Helper()
   803  	m := c.ExpectMessage(t)
   804  	return c.CheckSetExpressionResponse(t, m)
   805  }
   806  
   807  // CheckSetExpressionResponse fails the test if m is not *SetExpressionResponse.
   808  func (c *Client) CheckSetExpressionResponse(t *testing.T, m dap.Message) *dap.SetExpressionResponse {
   809  	t.Helper()
   810  	r, ok := m.(*dap.SetExpressionResponse)
   811  	if !ok {
   812  		t.Fatalf("got %#v, want *dap.SetExpressionResponse", m)
   813  	}
   814  	return r
   815  }
   816  
   817  // ExpectSetFunctionBreakpointsResponse reads a protocol message from the connection
   818  // and fails the test if the read message is not *SetFunctionBreakpointsResponse.
   819  func (c *Client) ExpectSetFunctionBreakpointsResponse(t *testing.T) *dap.SetFunctionBreakpointsResponse {
   820  	t.Helper()
   821  	m := c.ExpectMessage(t)
   822  	return c.CheckSetFunctionBreakpointsResponse(t, m)
   823  }
   824  
   825  // CheckSetFunctionBreakpointsResponse fails the test if m is not *SetFunctionBreakpointsResponse.
   826  func (c *Client) CheckSetFunctionBreakpointsResponse(t *testing.T, m dap.Message) *dap.SetFunctionBreakpointsResponse {
   827  	t.Helper()
   828  	r, ok := m.(*dap.SetFunctionBreakpointsResponse)
   829  	if !ok {
   830  		t.Fatalf("got %#v, want *dap.SetFunctionBreakpointsResponse", m)
   831  	}
   832  	return r
   833  }
   834  
   835  // ExpectSetInstructionBreakpointsResponse reads a protocol message from the connection
   836  // and fails the test if the read message is not *SetInstructionBreakpointsResponse.
   837  func (c *Client) ExpectSetInstructionBreakpointsResponse(t *testing.T) *dap.SetInstructionBreakpointsResponse {
   838  	t.Helper()
   839  	m := c.ExpectMessage(t)
   840  	return c.CheckSetInstructionBreakpointsResponse(t, m)
   841  }
   842  
   843  // CheckSetInstructionBreakpointsResponse fails the test if m is not *SetInstructionBreakpointsResponse.
   844  func (c *Client) CheckSetInstructionBreakpointsResponse(t *testing.T, m dap.Message) *dap.SetInstructionBreakpointsResponse {
   845  	t.Helper()
   846  	r, ok := m.(*dap.SetInstructionBreakpointsResponse)
   847  	if !ok {
   848  		t.Fatalf("got %#v, want *dap.SetInstructionBreakpointsResponse", m)
   849  	}
   850  	return r
   851  }
   852  
   853  // ExpectSetVariableResponse reads a protocol message from the connection
   854  // and fails the test if the read message is not *SetVariableResponse.
   855  func (c *Client) ExpectSetVariableResponse(t *testing.T) *dap.SetVariableResponse {
   856  	t.Helper()
   857  	m := c.ExpectMessage(t)
   858  	return c.CheckSetVariableResponse(t, m)
   859  }
   860  
   861  // CheckSetVariableResponse fails the test if m is not *SetVariableResponse.
   862  func (c *Client) CheckSetVariableResponse(t *testing.T, m dap.Message) *dap.SetVariableResponse {
   863  	t.Helper()
   864  	r, ok := m.(*dap.SetVariableResponse)
   865  	if !ok {
   866  		t.Fatalf("got %#v, want *dap.SetVariableResponse", m)
   867  	}
   868  	return r
   869  }
   870  
   871  // ExpectSourceResponse reads a protocol message from the connection
   872  // and fails the test if the read message is not *SourceResponse.
   873  func (c *Client) ExpectSourceResponse(t *testing.T) *dap.SourceResponse {
   874  	t.Helper()
   875  	m := c.ExpectMessage(t)
   876  	return c.CheckSourceResponse(t, m)
   877  }
   878  
   879  // CheckSourceResponse fails the test if m is not *SourceResponse.
   880  func (c *Client) CheckSourceResponse(t *testing.T, m dap.Message) *dap.SourceResponse {
   881  	t.Helper()
   882  	r, ok := m.(*dap.SourceResponse)
   883  	if !ok {
   884  		t.Fatalf("got %#v, want *dap.SourceResponse", m)
   885  	}
   886  	return r
   887  }
   888  
   889  // ExpectStackTraceResponse reads a protocol message from the connection
   890  // and fails the test if the read message is not *StackTraceResponse.
   891  func (c *Client) ExpectStackTraceResponse(t *testing.T) *dap.StackTraceResponse {
   892  	t.Helper()
   893  	m := c.ExpectMessage(t)
   894  	return c.CheckStackTraceResponse(t, m)
   895  }
   896  
   897  // CheckStackTraceResponse fails the test if m is not *StackTraceResponse.
   898  func (c *Client) CheckStackTraceResponse(t *testing.T, m dap.Message) *dap.StackTraceResponse {
   899  	t.Helper()
   900  	r, ok := m.(*dap.StackTraceResponse)
   901  	if !ok {
   902  		t.Fatalf("got %#v, want *dap.StackTraceResponse", m)
   903  	}
   904  	return r
   905  }
   906  
   907  // ExpectStepBackResponse reads a protocol message from the connection
   908  // and fails the test if the read message is not *StepBackResponse.
   909  func (c *Client) ExpectStepBackResponse(t *testing.T) *dap.StepBackResponse {
   910  	t.Helper()
   911  	m := c.ExpectMessage(t)
   912  	return c.CheckStepBackResponse(t, m)
   913  }
   914  
   915  // CheckStepBackResponse fails the test if m is not *StepBackResponse.
   916  func (c *Client) CheckStepBackResponse(t *testing.T, m dap.Message) *dap.StepBackResponse {
   917  	t.Helper()
   918  	r, ok := m.(*dap.StepBackResponse)
   919  	if !ok {
   920  		t.Fatalf("got %#v, want *dap.StepBackResponse", m)
   921  	}
   922  	return r
   923  }
   924  
   925  // ExpectStepInResponse reads a protocol message from the connection
   926  // and fails the test if the read message is not *StepInResponse.
   927  func (c *Client) ExpectStepInResponse(t *testing.T) *dap.StepInResponse {
   928  	t.Helper()
   929  	m := c.ExpectMessage(t)
   930  	return c.CheckStepInResponse(t, m)
   931  }
   932  
   933  // CheckStepInResponse fails the test if m is not *StepInResponse.
   934  func (c *Client) CheckStepInResponse(t *testing.T, m dap.Message) *dap.StepInResponse {
   935  	t.Helper()
   936  	_, ok := m.(*dap.ContinuedEvent)
   937  	if !ok {
   938  		t.Fatalf("got %#v, want *dap.ContinuedEvent", m)
   939  	}
   940  	m = c.ExpectMessage(t)
   941  	r, ok := m.(*dap.StepInResponse)
   942  	if !ok {
   943  		t.Fatalf("got %#v, want *dap.StepInResponse", m)
   944  	}
   945  	return r
   946  }
   947  
   948  // ExpectStepInTargetsResponse reads a protocol message from the connection
   949  // and fails the test if the read message is not *StepInTargetsResponse.
   950  func (c *Client) ExpectStepInTargetsResponse(t *testing.T) *dap.StepInTargetsResponse {
   951  	t.Helper()
   952  	m := c.ExpectMessage(t)
   953  	return c.CheckStepInTargetsResponse(t, m)
   954  }
   955  
   956  // CheckStepInTargetsResponse fails the test if m is not *StepInTargetsResponse.
   957  func (c *Client) CheckStepInTargetsResponse(t *testing.T, m dap.Message) *dap.StepInTargetsResponse {
   958  	t.Helper()
   959  	r, ok := m.(*dap.StepInTargetsResponse)
   960  	if !ok {
   961  		t.Fatalf("got %#v, want *dap.StepInTargetsResponse", m)
   962  	}
   963  	return r
   964  }
   965  
   966  // ExpectStepOutResponse reads a protocol message from the connection
   967  // and fails the test if the read message is not *StepOutResponse.
   968  func (c *Client) ExpectStepOutResponse(t *testing.T) *dap.StepOutResponse {
   969  	t.Helper()
   970  	m := c.ExpectMessage(t)
   971  	return c.CheckStepOutResponse(t, m)
   972  }
   973  
   974  // CheckStepOutResponse fails the test if m is not *StepOutResponse.
   975  func (c *Client) CheckStepOutResponse(t *testing.T, m dap.Message) *dap.StepOutResponse {
   976  	t.Helper()
   977  	_, ok := m.(*dap.ContinuedEvent)
   978  	if !ok {
   979  		t.Fatalf("got %#v, want *dap.ContinuedEvent", m)
   980  	}
   981  	m = c.ExpectMessage(t)
   982  	r, ok := m.(*dap.StepOutResponse)
   983  	if !ok {
   984  		t.Fatalf("got %#v, want *dap.StepOutResponse", m)
   985  	}
   986  	return r
   987  }
   988  
   989  // ExpectStoppedEvent reads a protocol message from the connection
   990  // and fails the test if the read message is not *StoppedEvent.
   991  func (c *Client) ExpectStoppedEvent(t *testing.T) *dap.StoppedEvent {
   992  	t.Helper()
   993  	m := c.ExpectMessage(t)
   994  	return c.CheckStoppedEvent(t, m)
   995  }
   996  
   997  // CheckStoppedEvent fails the test if m is not *StoppedEvent.
   998  func (c *Client) CheckStoppedEvent(t *testing.T, m dap.Message) *dap.StoppedEvent {
   999  	t.Helper()
  1000  	r, ok := m.(*dap.StoppedEvent)
  1001  	if !ok {
  1002  		t.Fatalf("got %#v, want *dap.StoppedEvent", m)
  1003  	}
  1004  	return r
  1005  }
  1006  
  1007  // ExpectTerminateResponse reads a protocol message from the connection
  1008  // and fails the test if the read message is not *TerminateResponse.
  1009  func (c *Client) ExpectTerminateResponse(t *testing.T) *dap.TerminateResponse {
  1010  	t.Helper()
  1011  	m := c.ExpectMessage(t)
  1012  	return c.CheckTerminateResponse(t, m)
  1013  }
  1014  
  1015  // CheckTerminateResponse fails the test if m is not *TerminateResponse.
  1016  func (c *Client) CheckTerminateResponse(t *testing.T, m dap.Message) *dap.TerminateResponse {
  1017  	t.Helper()
  1018  	r, ok := m.(*dap.TerminateResponse)
  1019  	if !ok {
  1020  		t.Fatalf("got %#v, want *dap.TerminateResponse", m)
  1021  	}
  1022  	return r
  1023  }
  1024  
  1025  // ExpectTerminateThreadsResponse reads a protocol message from the connection
  1026  // and fails the test if the read message is not *TerminateThreadsResponse.
  1027  func (c *Client) ExpectTerminateThreadsResponse(t *testing.T) *dap.TerminateThreadsResponse {
  1028  	t.Helper()
  1029  	m := c.ExpectMessage(t)
  1030  	return c.CheckTerminateThreadsResponse(t, m)
  1031  }
  1032  
  1033  // CheckTerminateThreadsResponse fails the test if m is not *TerminateThreadsResponse.
  1034  func (c *Client) CheckTerminateThreadsResponse(t *testing.T, m dap.Message) *dap.TerminateThreadsResponse {
  1035  	t.Helper()
  1036  	r, ok := m.(*dap.TerminateThreadsResponse)
  1037  	if !ok {
  1038  		t.Fatalf("got %#v, want *dap.TerminateThreadsResponse", m)
  1039  	}
  1040  	return r
  1041  }
  1042  
  1043  // ExpectTerminatedEvent reads a protocol message from the connection
  1044  // and fails the test if the read message is not *TerminatedEvent.
  1045  func (c *Client) ExpectTerminatedEvent(t *testing.T) *dap.TerminatedEvent {
  1046  	t.Helper()
  1047  	m := c.ExpectMessage(t)
  1048  	return c.CheckTerminatedEvent(t, m)
  1049  }
  1050  
  1051  // CheckTerminatedEvent fails the test if m is not *TerminatedEvent.
  1052  func (c *Client) CheckTerminatedEvent(t *testing.T, m dap.Message) *dap.TerminatedEvent {
  1053  	t.Helper()
  1054  	r, ok := m.(*dap.TerminatedEvent)
  1055  	if !ok {
  1056  		t.Fatalf("got %#v, want *dap.TerminatedEvent", m)
  1057  	}
  1058  	return r
  1059  }
  1060  
  1061  // ExpectThreadEvent reads a protocol message from the connection
  1062  // and fails the test if the read message is not *ThreadEvent.
  1063  func (c *Client) ExpectThreadEvent(t *testing.T) *dap.ThreadEvent {
  1064  	t.Helper()
  1065  	m := c.ExpectMessage(t)
  1066  	return c.CheckThreadEvent(t, m)
  1067  }
  1068  
  1069  // CheckThreadEvent fails the test if m is not *ThreadEvent.
  1070  func (c *Client) CheckThreadEvent(t *testing.T, m dap.Message) *dap.ThreadEvent {
  1071  	t.Helper()
  1072  	r, ok := m.(*dap.ThreadEvent)
  1073  	if !ok {
  1074  		t.Fatalf("got %#v, want *dap.ThreadEvent", m)
  1075  	}
  1076  	return r
  1077  }
  1078  
  1079  // ExpectThreadsResponse reads a protocol message from the connection
  1080  // and fails the test if the read message is not *ThreadsResponse.
  1081  func (c *Client) ExpectThreadsResponse(t *testing.T) *dap.ThreadsResponse {
  1082  	t.Helper()
  1083  	m := c.ExpectMessage(t)
  1084  	return c.CheckThreadsResponse(t, m)
  1085  }
  1086  
  1087  // CheckThreadsResponse fails the test if m is not *ThreadsResponse.
  1088  func (c *Client) CheckThreadsResponse(t *testing.T, m dap.Message) *dap.ThreadsResponse {
  1089  	t.Helper()
  1090  	r, ok := m.(*dap.ThreadsResponse)
  1091  	if !ok {
  1092  		t.Fatalf("got %#v, want *dap.ThreadsResponse", m)
  1093  	}
  1094  	return r
  1095  }
  1096  
  1097  // ExpectVariablesResponse reads a protocol message from the connection
  1098  // and fails the test if the read message is not *VariablesResponse.
  1099  func (c *Client) ExpectVariablesResponse(t *testing.T) *dap.VariablesResponse {
  1100  	t.Helper()
  1101  	m := c.ExpectMessage(t)
  1102  	return c.CheckVariablesResponse(t, m)
  1103  }
  1104  
  1105  // CheckVariablesResponse fails the test if m is not *VariablesResponse.
  1106  func (c *Client) CheckVariablesResponse(t *testing.T, m dap.Message) *dap.VariablesResponse {
  1107  	t.Helper()
  1108  	r, ok := m.(*dap.VariablesResponse)
  1109  	if !ok {
  1110  		t.Fatalf("got %#v, want *dap.VariablesResponse", m)
  1111  	}
  1112  	return r
  1113  }
  1114  
  1115  // ExpectWriteMemoryResponse reads a protocol message from the connection
  1116  // and fails the test if the read message is not *WriteMemoryResponse.
  1117  func (c *Client) ExpectWriteMemoryResponse(t *testing.T) *dap.WriteMemoryResponse {
  1118  	t.Helper()
  1119  	m := c.ExpectMessage(t)
  1120  	return c.CheckWriteMemoryResponse(t, m)
  1121  }
  1122  
  1123  // CheckWriteMemoryResponse fails the test if m is not *WriteMemoryResponse.
  1124  func (c *Client) CheckWriteMemoryResponse(t *testing.T, m dap.Message) *dap.WriteMemoryResponse {
  1125  	t.Helper()
  1126  	r, ok := m.(*dap.WriteMemoryResponse)
  1127  	if !ok {
  1128  		t.Fatalf("got %#v, want *dap.WriteMemoryResponse", m)
  1129  	}
  1130  	return r
  1131  }