From 9efdeffcacc47d33f736245e3a1e19865a7f8150 Mon Sep 17 00:00:00 2001 From: Celestino Amoroso Date: Sun, 17 May 2026 19:14:35 +0200 Subject: [PATCH] test with mixed field name and index --- t_dict_test.go | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/t_dict_test.go b/t_dict_test.go index f503919..644bbac 100644 --- a/t_dict_test.go +++ b/t_dict_test.go @@ -46,16 +46,14 @@ func TestDictParser(t *testing.T) { runTestSuite(t, section, inputs) } -func TestPoc(t *testing.T) { +func TestAccessSubFields(t *testing.T) { section := "Dict-Assign-Item" ctx := NewSimpleStore() ctx.UnsafeSetVar( "D", kern.NewDict(map[any]any{ - "a": kern.NewDict(map[any]any{ - "uno": int64(10), - }, - ), + "a": kern.NewDict(map[any]any{"uno": int64(10)}), + "b": kern.NewListA(1, 2, 3), }), ) // D={"a": {"uno":1}} @@ -63,8 +61,9 @@ func TestPoc(t *testing.T) { /* 1 */ {`D.a.uno`, int64(10), nil}, /* 2 */ {`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) }