proc/variables: Support for nested struct members

Fixes #220
This commit is contained in:
Luke Hoban
2015-09-29 10:15:31 -07:00
committed by Derek Parker
parent 80107dba8d
commit e0519dd540
2 changed files with 8 additions and 9 deletions

View File

@ -97,6 +97,9 @@ func TestVariableEvaluation(t *testing.T) {
{"f", "main.barfoo", "", "func()", nil},
{"ba", "[]int len: 200, cap: 200, [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,...+136 more]", "", "struct []int", nil},
{"ms", "main.Nest {Level: 0, Nest: *main.Nest {Level: 1, Nest: *main.Nest {...}}}", "", "main.Nest", nil},
{"ms.Nest.Nest", "*main.Nest {Level: 2, Nest: *main.Nest {Level: 3, Nest: *main.Nest {...}}}", "", "*main.Nest", nil},
{"ms.Nest.Nest.Nest.Nest.Nest", "*main.Nest nil", "", "*main.Nest", nil},
{"ms.Nest.Nest.Nest.Nest.Nest.Nest", "", "", "*main.Nest", fmt.Errorf("ms.Nest.Nest.Nest.Nest.Nest is nil")},
{"main.p1", "10", "12", "int", nil},
{"p1", "10", "13", "int", nil},
{"NonExistent", "", "", "", fmt.Errorf("could not find symbol value for NonExistent")},