readString can now read strings of any length as well as sliced strings

This commit is contained in:
epipho
2015-01-19 18:25:08 -05:00
parent cf672154fe
commit 67ad85feec
3 changed files with 25 additions and 14 deletions

View File

@ -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")