test with mixed field name and index
This commit is contained in:
+5
-6
@@ -46,16 +46,14 @@ func TestDictParser(t *testing.T) {
|
|||||||
runTestSuite(t, section, inputs)
|
runTestSuite(t, section, inputs)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestPoc(t *testing.T) {
|
func TestAccessSubFields(t *testing.T) {
|
||||||
section := "Dict-Assign-Item"
|
section := "Dict-Assign-Item"
|
||||||
ctx := NewSimpleStore()
|
ctx := NewSimpleStore()
|
||||||
ctx.UnsafeSetVar(
|
ctx.UnsafeSetVar(
|
||||||
"D",
|
"D",
|
||||||
kern.NewDict(map[any]any{
|
kern.NewDict(map[any]any{
|
||||||
"a": kern.NewDict(map[any]any{
|
"a": kern.NewDict(map[any]any{"uno": int64(10)}),
|
||||||
"uno": int64(10),
|
"b": kern.NewListA(1, 2, 3),
|
||||||
},
|
|
||||||
),
|
|
||||||
}),
|
}),
|
||||||
) // D={"a": {"uno":1}}
|
) // D={"a": {"uno":1}}
|
||||||
|
|
||||||
@@ -63,8 +61,9 @@ func TestPoc(t *testing.T) {
|
|||||||
/* 1 */ {`D.a.uno`, int64(10), nil},
|
/* 1 */ {`D.a.uno`, int64(10), nil},
|
||||||
/* 2 */ {`D.a.uno = 111; D.a."uno"`, int64(111), nil},
|
/* 2 */ {`D.a.uno = 111; D.a."uno"`, int64(111), nil},
|
||||||
/* 3 */ {`D.a.uno = 111; D["a"]["uno"]`, int64(111), nil},
|
/* 3 */ {`D.a.uno = 111; D["a"]["uno"]`, int64(111), nil},
|
||||||
|
/* 4 */ {`D.b[1] = 22; D["b"][1]`, int64(22), nil},
|
||||||
}
|
}
|
||||||
// runCtxTestSuiteSpec(t, ctx, section, inputs, 3)
|
// runCtxTestSuiteSpec(t, ctx, section, inputs, 4)
|
||||||
runCtxTestSuite(t, ctx, section, inputs)
|
runCtxTestSuite(t, ctx, section, inputs)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user