mirror of
https://github.com/go-delve/delve.git
synced 2025-10-30 10:17:03 +08:00
readString can now read strings of any length as well as sliced strings
This commit is contained in:
@ -37,7 +37,8 @@ func TestVariableEvaluation(t *testing.T) {
|
||||
}
|
||||
|
||||
testcases := []varTest{
|
||||
{"a1", "foo", "struct string", nil},
|
||||
{"a1", "foofoofoofoofoofoo", "struct string", nil},
|
||||
{"a10", "ofo", "struct string", nil},
|
||||
{"a2", "6", "int", nil},
|
||||
{"a3", "7.23", "float64", nil},
|
||||
{"a4", "[2]int [1 2]", "[2]int", nil},
|
||||
@ -61,7 +62,7 @@ func TestVariableEvaluation(t *testing.T) {
|
||||
}
|
||||
|
||||
withTestProcess(executablePath, t, func(p *DebuggedProcess) {
|
||||
pc, _, _ := p.GoSymTable.LineToPC(fp, 38)
|
||||
pc, _, _ := p.GoSymTable.LineToPC(fp, 39)
|
||||
|
||||
_, err := p.Break(pc)
|
||||
assertNoError(err, t, "Break() returned an error")
|
||||
@ -92,7 +93,7 @@ func TestVariableFunctionScoping(t *testing.T) {
|
||||
}
|
||||
|
||||
withTestProcess(executablePath, t, func(p *DebuggedProcess) {
|
||||
pc, _, _ := p.GoSymTable.LineToPC(fp, 38)
|
||||
pc, _, _ := p.GoSymTable.LineToPC(fp, 39)
|
||||
|
||||
_, err := p.Break(pc)
|
||||
assertNoError(err, t, "Break() returned an error")
|
||||
@ -156,7 +157,8 @@ func TestLocalVariables(t *testing.T) {
|
||||
}{
|
||||
{(*ThreadContext).LocalVariables,
|
||||
[]varTest{
|
||||
{"a1", "foo", "struct string", nil},
|
||||
{"a1", "foofoofoofoofoofoo", "struct string", nil},
|
||||
{"a10", "ofo", "struct string", nil},
|
||||
{"a2", "6", "int", nil},
|
||||
{"a3", "7.23", "float64", nil},
|
||||
{"a4", "[2]int [1 2]", "[2]int", nil},
|
||||
@ -176,7 +178,7 @@ func TestLocalVariables(t *testing.T) {
|
||||
}
|
||||
|
||||
withTestProcess(executablePath, t, func(p *DebuggedProcess) {
|
||||
pc, _, _ := p.GoSymTable.LineToPC(fp, 38)
|
||||
pc, _, _ := p.GoSymTable.LineToPC(fp, 39)
|
||||
|
||||
_, err := p.Break(pc)
|
||||
assertNoError(err, t, "Break() returned an error")
|
||||
|
||||
Reference in New Issue
Block a user