forked from TrueCloudLab/neoneo-go
compiler: allow usage of string literals in index expressions
This commit is contained in:
parent
058958729d
commit
4fd766fe09
2 changed files with 48 additions and 21 deletions
|
@ -39,6 +39,22 @@ var mapTestCases = []testCase{
|
|||
`,
|
||||
big.NewInt(4),
|
||||
},
|
||||
{
|
||||
"map with string index",
|
||||
`
|
||||
package foo
|
||||
func Main() string {
|
||||
t := map[string]string{
|
||||
"name": "Valera",
|
||||
"age": "33",
|
||||
}
|
||||
|
||||
name := t["name"]
|
||||
return name
|
||||
}
|
||||
`,
|
||||
[]byte("Valera"),
|
||||
},
|
||||
}
|
||||
|
||||
func TestMaps(t *testing.T) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue