mirror of
https://github.com/go-delve/delve.git
synced 2025-10-30 10:17:03 +08:00
proc: return error when assigning between function variables (#2692)
Fixes #2691
This commit is contained in:
committed by
GitHub
parent
1893c9769b
commit
bdcbcc6836
@ -5681,3 +5681,18 @@ func TestWatchpointStackBackwardsOutOfScope(t *testing.T) {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
func TestSetOnFunctions(t *testing.T) {
|
||||
// The set command between function variables should fail with an error
|
||||
// Issue #2691
|
||||
withTestProcess("goroutinestackprog", t, func(p *proc.Target, fixture protest.Fixture) {
|
||||
setFunctionBreakpoint(p, t, "main.main")
|
||||
assertNoError(p.Continue(), t, "Continue()")
|
||||
scope, err := proc.GoroutineScope(p, p.CurrentThread())
|
||||
assertNoError(err, t, "GoroutineScope")
|
||||
err = scope.SetVariable("main.func1", "main.func2")
|
||||
if err == nil {
|
||||
t.Fatal("expected error when assigning between function variables")
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user