Exemple #1
0
func TestLoopDetectorInner(t *testing.T) {
	s1 := &mockStore1{}
	s2 := &mockStore2{}
	s3 := &mockStore3{}
	s4 := &mockStore4{}
	s5 := &mockStore5{}
	s6 := &mockStore6{}
	d := newLoopDetector()

	found, store := d.request(s1, s2)
	assert.False(t, found)
	assert.Nil(t, store)
	found, store = d.request(s2, s3)
	assert.False(t, found)
	assert.Nil(t, store)
	found, store = d.request(s3, s1)
	assert.True(t, found)
	assert.Equal(t, s1, store)
	found, store = d.request(s4, s5)
	assert.False(t, found)
	assert.Nil(t, store)
	found, store = d.request(s6, s4)
	assert.False(t, found)
	assert.Nil(t, store)
}
Exemple #2
0
func TestNode_InitialiseMapChild(t *testing.T) {
	cb, n := data.Setup(t)
	test := func(t *testing.T, n *node.Node, m *data.Multi) {

		c := node.NewNode()
		require.NoError(t, c.InitialiseMapItem(cb.Ctx(), n.Map["mjs"], "c"))
		require.NoError(t, c.AddToMap(cb.Ctx(), n.Map["mjs"], "c", true))
		assert.Equal(t, 3, len(n.Map["mjs"].Map))
		assert.True(t, n.Map["mjs"].Map["c"].Null)
		assert.False(t, n.Map["mjs"].Map["c"].Missing)
		assert.Equal(t, c, n.Map["mjs"].Map["c"])
		assert.Equal(t, "", m.Mjs["c"])

		c1 := node.NewNode()
		require.NoError(t, c1.InitialiseMapItem(cb.Ctx(), n.Map["mss"], "c"))
		require.NoError(t, c1.AddToMap(cb.Ctx(), n.Map["mss"], "c", true))
		assert.Equal(t, 3, len(n.Map["mss"].Map))
		assert.Nil(t, m.Mss["c"])

		c2 := node.NewNode()
		require.NoError(t, c2.InitialiseMapItem(cb.Ctx(), n.Map["mm"], "c"))
		require.NoError(t, c2.AddToMap(cb.Ctx(), n.Map["mm"], "c", true))
		assert.Equal(t, 3, len(m.Mm))
		assert.Nil(t, m.Mm["c"])
	}
	data.Run(t, n, n.Value.(*data.Multi), test)

}
Exemple #3
0
func TestNode_SetValueZero2(t *testing.T) {
	cb, n := data.Empty(t)
	test := func(t *testing.T, n *node.Node, m *data.Multi) {
		sstring, ok := system.GetTypeFromCache(cb.Ctx(), "kego.io/system", "string")
		assert.True(t, ok)
		snumber, ok := system.GetTypeFromCache(cb.Ctx(), "kego.io/system", "number")
		assert.True(t, ok)

		require.NoError(t, n.Map["ss"].SetValueZero(cb.Ctx(), true, sstring))
		assert.Nil(t, m.Ss)

		require.NoError(t, n.Map["sn"].SetValueZero(cb.Ctx(), false, snumber))
		assert.NotNil(t, m.Sn)

		require.NoError(t, n.Map["mnri"].SetValueZero(cb.Ctx(), true, nil))
		assert.Nil(t, m.Mnri)

		require.NoError(t, n.Map["mi"].SetValueZero(cb.Ctx(), false, nil))
		assert.NotNil(t, m.Mi)
		assert.Equal(t, 0, len(m.Mi))

		require.NoError(t, n.Map["anri"].SetValueZero(cb.Ctx(), true, nil))
		assert.Nil(t, m.Anri)

		require.NoError(t, n.Map["ai"].SetValueZero(cb.Ctx(), false, nil))
		assert.NotNil(t, m.Ai)
		assert.Equal(t, 0, len(m.Ai))

	}
	data.Run(t, n, n.Value.(*data.Multi), test)

}
Exemple #4
0
func TestNumberUnmarshalJSON(t *testing.T) {

	var n *Number

	err := n.Unpack(envctx.Empty, Pack(nil), false)
	require.NoError(t, err)
	assert.Nil(t, n)

	n = NewNumber(0.0)
	err = n.Unpack(envctx.Empty, Pack(1.2), false)
	require.NoError(t, err)
	assert.NotNil(t, n)
	assert.Equal(t, 1.2, n.Value())

	n = NewNumber(0.0)
	err = n.Unpack(envctx.Empty, Pack(map[string]interface{}{
		"type":  "system:number",
		"value": 1.2,
	}), false)
	require.NoError(t, err)
	assert.NotNil(t, n)
	assert.Equal(t, 1.2, n.Value())

	n = NewNumber(0.0)
	err = n.Unpack(envctx.Empty, Pack("foo"), false)
	assert.Error(t, err)

}
Exemple #5
0
func TestBoolUnmarshalJSON(t *testing.T) {

	var b *Bool

	err := b.Unpack(envctx.Empty, Pack(nil), false)
	require.NoError(t, err)
	assert.Nil(t, b)

	b = NewBool(false)
	err = b.Unpack(envctx.Empty, Pack(true), false)
	require.NoError(t, err)
	assert.NotNil(t, b)
	assert.True(t, b.Value())

	b = NewBool(false)
	err = b.Unpack(envctx.Empty, Pack(map[string]interface{}{
		"type":  "system:bool",
		"value": true,
	}), false)
	require.NoError(t, err)
	assert.NotNil(t, b)
	assert.True(t, b.Value())

	b = NewBool(true)
	err = b.Unpack(envctx.Empty, Pack(false), false)
	require.NoError(t, err)
	assert.NotNil(t, b)
	assert.False(t, b.Value())

	b = NewBool(false)
	err = b.Unpack(envctx.Empty, Pack("foo"), false)
	assert.Error(t, err)

}
Exemple #6
0
func TestStringUnmarshalJSON(t *testing.T) {

	var s *String

	err := s.Unpack(envctx.Empty, Pack(nil), false)
	require.NoError(t, err)
	assert.Nil(t, s)

	s = NewString("")
	err = s.Unpack(envctx.Empty, Pack(`foo "bar"`), false)
	require.NoError(t, err)
	assert.NotNil(t, s)
	assert.Equal(t, `foo "bar"`, s.Value())

	s = NewString("")
	err = s.Unpack(envctx.Empty, Pack(map[string]interface{}{
		"type":  "system:string",
		"value": `foo "bar"`,
	}), false)
	require.NoError(t, err)
	assert.NotNil(t, s)
	assert.Equal(t, `foo "bar"`, s.Value())

	s = NewString("")
	err = s.Unpack(envctx.Empty, Pack(1.0), false)
	assert.Error(t, err)

}
Exemple #7
0
func TestNode_DeleteObjectChild(t *testing.T) {
	cb, n := data.Setup(t)

	test := func(t *testing.T, n *node.Node, m *data.Multi) {
		require.NoError(t, n.DeleteObjectChild(cb.Ctx(), "js"))
		assert.True(t, n.Map["js"].Missing)
		assert.Equal(t, "", m.Js)
		require.NoError(t, n.DeleteObjectChild(cb.Ctx(), "ss"))
		assert.Nil(t, m.Ss)
		require.NoError(t, n.DeleteObjectChild(cb.Ctx(), "sr"))
		assert.Nil(t, m.Sr)
		require.NoError(t, n.DeleteObjectChild(cb.Ctx(), "jn"))
		assert.Equal(t, 0.0, m.Jn)
		require.NoError(t, n.DeleteObjectChild(cb.Ctx(), "sn"))
		assert.Nil(t, m.Sn)
		require.NoError(t, n.DeleteObjectChild(cb.Ctx(), "jb"))
		assert.Equal(t, false, m.Jb)
		require.NoError(t, n.DeleteObjectChild(cb.Ctx(), "sb"))
		assert.Nil(t, m.Sb)
		require.NoError(t, n.DeleteObjectChild(cb.Ctx(), "i"))
		assert.Nil(t, m.I)
		require.NoError(t, n.DeleteObjectChild(cb.Ctx(), "ajs"))
		assert.Nil(t, m.Ajs)
		require.NoError(t, n.DeleteObjectChild(cb.Ctx(), "mjs"))
		assert.Nil(t, m.Mjs)

	}
	data.Run(t, n, n.Value.(*data.Multi), test)
}
Exemple #8
0
func TestNode_extractType(t *testing.T) {
	r := &system.RuleWrapper{
		Struct: &system.Rule{Interface: true},
		Parent: &system.Type{Interface: true},
	}
	_, err := extractType(context.Background(), system.Pack(nil), r)
	assert.IsError(t, err, "TDXTPGVFAK")

	ty, err := extractType(context.Background(), nil, nil)
	require.NoError(t, err)
	assert.Nil(t, ty)

	r = &system.RuleWrapper{
		Parent: &system.Type{Interface: true},
	}
	_, err = extractType(context.Background(), system.Pack(""), r)
	assert.IsError(t, err, "DLSQRFLINL")

	r = &system.RuleWrapper{
		Struct: &system.Rule{Interface: true},
	}
	ty, err = extractType(context.Background(), nil, r)
	require.NoError(t, err)
	assert.Nil(t, ty)

	r = &system.RuleWrapper{
		Struct: &system.Rule{Interface: true},
	}
	_, err = extractType(context.Background(), system.MustPackString(`[""]`), r)
	assert.IsError(t, err, "SNYLGBJYTM")

	_, err = extractType(context.Background(), system.MustPackString(`{}`), nil)
	assert.IsError(t, err, "HBJVDKAKBJ")

	r = &system.RuleWrapper{
		Parent: &system.Type{Interface: true},
	}
	_, err = extractType(context.Background(), system.MustPackString(`{}`), r)
	assert.IsError(t, err, "HBJVDKAKBJ")

	cb := tests.Context("a.b/c").Sempty()
	_, err = extractType(cb.Ctx(), system.MustPackString(`{"type": "a"}`), nil)
	assert.IsError(t, err, "IJFMJJWVCA")

}
Exemple #9
0
func TestNewLoopDetector(t *testing.T) {
	s1 := &mockStore1{}
	s2 := &mockStore2{}
	d := newLoopDetector()

	found, store := d.request(s1, s2)
	assert.False(t, found)
	assert.Nil(t, store)

	found, store = d.request(s2, s1)
	assert.True(t, found)
	assert.Equal(t, s1, store)

	d.finished(s1)
	found, store = d.request(s2, s1)
	assert.False(t, found)
	assert.Nil(t, store)
}
Exemple #10
0
func TestRuleWrapper_ZeroValue(t *testing.T) {
	cb := tests.Context("kego.io/system").Jauto().Sauto(parser.Parse)
	r := system.WrapRule(cb.Ctx(), &system.MapRule{
		Object: &system.Object{Type: system.NewReference("kego.io/system", "@map")},
		Rule:   &system.Rule{},
		Items: &system.StringRule{
			Object: &system.Object{Type: system.NewReference("kego.io/system", "@string")},
			Rule:   &system.Rule{},
		},
	})

	v, err := r.ZeroValue(true)
	require.NoError(t, err)
	assert.IsType(t, map[string]*system.String{}, v.Interface())
	assert.Nil(t, v.Interface())

	v, err = r.ZeroValue(false)
	require.NoError(t, err)
	assert.IsType(t, map[string]*system.String{}, v.Interface())
	assert.NotNil(t, v.Interface())
	vv := v.Interface().(map[string]*system.String)
	vv["a"] = system.NewString("")

	r = system.WrapRule(cb.Ctx(), &system.MapRule{
		Object: &system.Object{Type: system.NewReference("kego.io/system", "@array")},
		Rule:   &system.Rule{},
		Items: &system.StringRule{
			Object: &system.Object{Type: system.NewReference("kego.io/system", "@string")},
			Rule:   &system.Rule{},
		},
	})

	v, err = r.ZeroValue(true)
	require.NoError(t, err)
	assert.IsType(t, []*system.String{}, v.Interface())
	assert.Nil(t, v.Interface())

	v, err = r.ZeroValue(false)
	require.NoError(t, err)
	assert.IsType(t, []*system.String{}, v.Interface())
	assert.NotNil(t, v.Interface())
	va := v.Interface().([]*system.String)
	va = append(va, system.NewString(""))
}
Exemple #11
0
func TestNode_Root(t *testing.T) {
	r := node.NewNode()
	a := node.NewNode()
	b := node.NewNode()
	a.Parent = r
	b.Parent = a
	assert.Equal(t, r, a.Root())
	assert.Equal(t, r, b.Root())
	n := (*node.Node)(nil)
	assert.Nil(t, n.Root())
}
Exemple #12
0
func TestNode_InitialiseRoot(t *testing.T) {
	n := newNonEmptyNode()
	n.InitialiseRoot()
	assert.Nil(t, n.Parent)
	assert.Equal(t, 0, len(n.Array))
	assert.Equal(t, 0, len(n.Map))
	assert.Equal(t, "", n.Key)
	assert.Equal(t, -1, n.Index)
	assert.Nil(t, n.Origin)
	assert.Equal(t, "", n.ValueString)
	assert.Equal(t, 0.0, n.ValueNumber)
	assert.Equal(t, false, n.ValueBool)
	assert.Nil(t, n.Value)
	assert.Equal(t, reflect.Value{}, n.Val)
	assert.True(t, n.Null)
	assert.True(t, n.Missing)
	assert.Nil(t, n.Rule)
	assert.Nil(t, n.Type)
	assert.Equal(t, system.J_NULL, n.JsonType)
}
Exemple #13
0
func TestGetInfo(t *testing.T) {
	cb := tests.Context("a.b/c").Wg().Sempty().Jsystem().TempGopath(false)
	defer cb.Cleanup()
	_, dirA := cb.TempPackage("a", map[string]string{
		"generated.go": "",
	})
	info, found, err := getInfo(cb.Ctx(), dirA)
	require.NoError(t, err)
	assert.Nil(t, info)
	assert.False(t, found)

}
Exemple #14
0
func TestBranchView_Unmount(t *testing.T) {
	cb := ctests.New(t).SetApp(true, true, false)
	defer cb.Finish()

	b := NewBranchView(cb.Ctx(), models.NewBranchModel(cb.Ctx(), &models.RootContents{Name: "a"}))

	c := mock_vecty.NewMockComponent(cb.GetMock())
	c.EXPECT().Unmount()
	b.Body = c
	b.Unmount()
	assert.Nil(t, b.Notifs)
}
Exemple #15
0
func TestNode_InitialiseArrayChild(t *testing.T) {
	cb, n := data.Setup(t)
	test := func(t *testing.T, n *node.Node, m *data.Multi) {
		c := node.NewNode()
		require.NoError(t, c.InitialiseArrayItem(cb.Ctx(), n.Map["ajs"], 4))
		require.NoError(t, c.AddToArray(cb.Ctx(), n.Map["ajs"], 4, true))
		assert.Equal(t, 5, len(n.Map["ajs"].Array))
		assert.True(t, n.Map["ajs"].Array[4].Null)
		assert.False(t, n.Map["ajs"].Array[4].Missing)
		assert.Equal(t, c, n.Map["ajs"].Array[4])
		assert.Equal(t, []string{"ajs0", "ajs1", "ajs2", "ajs3", ""}, m.Ajs)

		c1 := node.NewNode()
		require.NoError(t, c1.InitialiseArrayItem(cb.Ctx(), n.Map["ass"], 4))
		require.NoError(t, c1.AddToArray(cb.Ctx(), n.Map["ass"], 4, true))
		assert.Equal(t, 5, len(m.Ass))
		assert.Nil(t, m.Ass[4])

		c2 := node.NewNode()
		require.NoError(t, c2.InitialiseArrayItem(cb.Ctx(), n.Map["ajs"], 0))
		require.NoError(t, c2.AddToArray(cb.Ctx(), n.Map["ajs"], 0, true))
		assert.Equal(t, 6, len(n.Map["ajs"].Array))
		assert.Equal(t, []string{"", "ajs0", "ajs1", "ajs2", "ajs3", ""}, m.Ajs)

		c3 := node.NewNode()
		require.NoError(t, c3.InitialiseArrayItem(cb.Ctx(), n.Map["ass"], 0))
		require.NoError(t, c3.AddToArray(cb.Ctx(), n.Map["ass"], 0, true))
		assert.Equal(t, 6, len(m.Ass))
		assert.Nil(t, m.Ass[0])

		c4 := node.NewNode()
		require.NoError(t, c4.InitialiseArrayItem(cb.Ctx(), n.Map["am"], 2))
		require.NoError(t, c4.AddToArray(cb.Ctx(), n.Map["am"], 2, true))
		assert.Equal(t, 3, len(m.Am))
		assert.Nil(t, m.Am[2])
	}
	data.Run(t, n, n.Value.(*data.Multi), test)

}
Exemple #16
0
func TestIntUnmarshalJSON(t *testing.T) {

	var i *Int

	err := i.Unpack(envctx.Empty, Pack(nil), false)
	require.NoError(t, err)
	assert.Nil(t, i)

	i = NewInt(0)
	err = i.Unpack(envctx.Empty, Pack(2.0), false)
	require.NoError(t, err)
	assert.NotNil(t, i)
	assert.Equal(t, 2, i.Value())

	i = NewInt(0)
	err = i.Unpack(envctx.Empty, Pack(map[string]interface{}{
		"type":  "system:int",
		"value": 2.0,
	}), false)
	require.NoError(t, err)
	assert.NotNil(t, i)
	assert.Equal(t, 2, i.Value())

	i = NewInt(0)
	err = i.Unpack(envctx.Empty, Pack(-12.0), false)
	require.NoError(t, err)
	assert.NotNil(t, i)
	assert.Equal(t, -12, i.Value())

	i = NewInt(0)
	err = i.Unpack(envctx.Empty, Pack("foo"), false)
	assert.IsError(t, err, "UJUBDGVYGF")

	i = NewInt(0)
	err = i.Unpack(envctx.Empty, Pack(1.2), false)
	assert.HasError(t, err, "KVEOETSIJY")

}
Exemple #17
0
func TestDeleteMutation(t *testing.T) {

	cb, n := data.Setup(t)

	test := func(t *testing.T, n *node.Node, m *data.Multi) {
		var b, d, p *node.Node

		b = node.NewNode()
		d = n.Map["jb"]
		p = n
		require.NoError(t, mutateDeleteNode(cb.Ctx(), d, p, b))
		assert.False(t, n.Map["jb"].ValueBool)
		assert.False(t, m.Jb)
		require.NoError(t, mutateRestoreNode(cb.Ctx(), d, p, b))
		assert.True(t, n.Map["jb"].ValueBool)
		assert.True(t, m.Jb)

		b = node.NewNode()
		d = n.Map["ss"]
		p = n
		require.NoError(t, mutateDeleteNode(cb.Ctx(), d, p, b))
		assert.True(t, n.Map["ss"].Missing)
		assert.Equal(t, "", n.Map["ss"].ValueString)
		assert.Nil(t, m.Ss)
		require.NoError(t, mutateRestoreNode(cb.Ctx(), d, p, b))
		assert.False(t, n.Map["ss"].Missing)
		assert.Equal(t, "ss1", n.Map["ss"].ValueString)
		require.NotNil(t, m.Ss)
		assert.Equal(t, "ss1", m.Ss.Value())

		b = node.NewNode()
		d = n.Map["i"]
		p = n
		require.NoError(t, mutateDeleteNode(cb.Ctx(), d, p, b))
		assert.True(t, n.Map["i"].Missing)
		assert.Nil(t, m.I)
		require.NoError(t, mutateRestoreNode(cb.Ctx(), d, p, b))
		assert.False(t, n.Map["i"].Missing)
		assert.Equal(t, "ia", n.Map["i"].Value.(*data.Facea).A.Value())
		require.NotNil(t, m.I)
		assert.Equal(t, "ia", m.I.Face())

		b = node.NewNode()
		d = n.Map["ass"]
		p = n
		require.NoError(t, mutateDeleteNode(cb.Ctx(), d, p, b))
		assert.True(t, n.Map["ass"].Missing)
		assert.Equal(t, 0, len(m.Ass))
		require.NoError(t, mutateRestoreNode(cb.Ctx(), d, p, b))
		assert.False(t, n.Map["ass"].Missing)
		assert.Equal(t, 4, len(m.Ass))

		b = node.NewNode()
		d = n.Map["mss"]
		p = n
		require.NoError(t, mutateDeleteNode(cb.Ctx(), d, p, b))
		assert.True(t, n.Map["mss"].Missing)
		assert.Nil(t, m.Mss)
		require.NoError(t, mutateRestoreNode(cb.Ctx(), d, p, b))
		assert.False(t, n.Map["mss"].Missing)
		require.NotNil(t, m.Mss)
		assert.Equal(t, 2, len(m.Mss))
		require.NotNil(t, m.Mss["a"])
		assert.Equal(t, "mssa", m.Mss["a"].Value())

		b = node.NewNode()
		d = n.Map["ass"].Array[0]
		p = n.Map["ass"]
		require.NoError(t, mutateDeleteNode(cb.Ctx(), d, p, b))
		assert.Equal(t, 3, len(n.Map["ass"].Array))
		assert.Equal(t, 3, len(m.Ass))
		require.NoError(t, mutateRestoreNode(cb.Ctx(), d, p, b))
		assert.Equal(t, 4, len(n.Map["ass"].Array))
		assert.Equal(t, 4, len(m.Ass))
		assert.Equal(t, "ass0", n.Map["ass"].Array[0].ValueString)
		require.NotNil(t, m.Ass[0])
		assert.Equal(t, "ass0", m.Ass[0].Value())

	}

	data.Run(t, n, n.Value.(*data.Multi), test)
}
Exemple #18
0
func TestNode_SetValueZero(t *testing.T) {
	cb, n := data.Setup(t)
	test := func(t *testing.T, n *node.Node, m *data.Multi) {

		sstring, ok := system.GetTypeFromCache(cb.Ctx(), "kego.io/system", "string")
		assert.True(t, ok)
		facea, ok := system.GetTypeFromCache(cb.Ctx(), "kego.io/tests/data", "facea")
		assert.True(t, ok)
		faceb, ok := system.GetTypeFromCache(cb.Ctx(), "kego.io/tests/data", "faceb")
		assert.True(t, ok)

		c1 := node.NewNode()
		require.NoError(t, c1.InitialiseMapItem(cb.Ctx(), n.Map["mss"], "c"))
		require.NoError(t, c1.AddToMap(cb.Ctx(), n.Map["mss"], "c", true))
		require.NoError(t, c1.SetValueZero(cb.Ctx(), true, nil))
		assert.False(t, n.Map["mss"].Map["c"].Missing)
		assert.True(t, n.Map["mss"].Map["c"].Null)
		assert.Nil(t, m.Mss["c"])

		c1a := node.NewNode()
		require.NoError(t, c1a.InitialiseMapItem(cb.Ctx(), n.Map["mss"], "d"))
		require.NoError(t, c1a.AddToMap(cb.Ctx(), n.Map["mss"], "d", true))
		require.NoError(t, c1a.SetValueZero(cb.Ctx(), false, nil))
		assert.False(t, n.Map["mss"].Map["d"].Missing)
		assert.False(t, n.Map["mss"].Map["d"].Null)
		assert.NotNil(t, m.Mss["d"])
		assert.Equal(t, "", m.Mss["d"].Value())

		c2 := node.NewNode()
		require.NoError(t, c2.InitialiseMapItem(cb.Ctx(), n.Map["mm"], "c"))
		require.NoError(t, c2.AddToMap(cb.Ctx(), n.Map["mm"], "c", true))
		require.NoError(t, c2.SetValueZero(cb.Ctx(), true, nil))
		assert.Nil(t, m.Mm["c"])

		c2a := node.NewNode()
		require.NoError(t, c2a.InitialiseMapItem(cb.Ctx(), n.Map["mm"], "d"))
		require.NoError(t, c2a.AddToMap(cb.Ctx(), n.Map["mm"], "d", true))
		require.NoError(t, c2a.SetValueZero(cb.Ctx(), false, nil))
		assert.NotNil(t, m.Mm["d"])
		assert.Equal(t, "", m.Mm["d"].Js)

		require.NoError(t, n.Map["i"].SetValueZero(cb.Ctx(), true, faceb))
		assert.Nil(t, m.I)
		assert.IsType(t, &data.Faceb{}, m.I)

		require.NoError(t, n.Map["sri"].SetValueZero(cb.Ctx(), false, facea))
		assert.NotNil(t, m.Sri)
		assert.IsType(t, &data.Facea{}, m.Sri)

		c3 := node.NewNode()
		require.NoError(t, c3.InitialiseArrayItem(cb.Ctx(), n.Map["ass"], 4))
		require.NoError(t, c3.AddToArray(cb.Ctx(), n.Map["ass"], 4, true))
		require.NoError(t, c3.SetValueZero(cb.Ctx(), true, nil))
		assert.Nil(t, m.Ass[4])

		c3a := node.NewNode()
		require.NoError(t, c3a.InitialiseArrayItem(cb.Ctx(), n.Map["ass"], 5))
		require.NoError(t, c3a.AddToArray(cb.Ctx(), n.Map["ass"], 5, true))
		require.NoError(t, c3a.SetValueZero(cb.Ctx(), false, nil))
		assert.NotNil(t, m.Ass[5])

		c4 := node.NewNode()
		require.NoError(t, c4.InitialiseArrayItem(cb.Ctx(), n.Map["am"], 2))
		require.NoError(t, c4.AddToArray(cb.Ctx(), n.Map["am"], 2, true))
		require.NoError(t, c4.SetValueZero(cb.Ctx(), true, nil))
		assert.Nil(t, m.Am[2])

		c4a := node.NewNode()
		require.NoError(t, c4a.InitialiseArrayItem(cb.Ctx(), n.Map["am"], 3))
		require.NoError(t, c4a.AddToArray(cb.Ctx(), n.Map["am"], 3, true))
		require.NoError(t, c4a.SetValueZero(cb.Ctx(), false, nil))
		assert.NotNil(t, m.Am[3])

		c5 := node.NewNode()
		require.NoError(t, c5.InitialiseArrayItem(cb.Ctx(), n.Map["anri"], 3))
		require.NoError(t, c5.AddToArray(cb.Ctx(), n.Map["anri"], 3, true))
		require.NoError(t, c5.SetValueZero(cb.Ctx(), true, sstring))
		assert.Nil(t, m.Anri[3])
		assert.IsType(t, system.NewString(""), m.Anri[3])

		c5a := node.NewNode()
		require.NoError(t, c5a.InitialiseArrayItem(cb.Ctx(), n.Map["anri"], 4))
		require.NoError(t, c5a.AddToArray(cb.Ctx(), n.Map["anri"], 4, true))
		require.NoError(t, c5a.SetValueZero(cb.Ctx(), false, sstring))
		assert.NotNil(t, m.Anri[4])
		assert.IsType(t, system.NewString(""), m.Anri[4])

		c6 := node.NewNode()
		require.NoError(t, c6.InitialiseArrayItem(cb.Ctx(), n.Map["anri"], 5))
		require.NoError(t, c6.AddToArray(cb.Ctx(), n.Map["anri"], 5, true))
		require.NoError(t, c6.SetValueZero(cb.Ctx(), true, facea))
		assert.Nil(t, m.Anri[5])
		assert.IsType(t, &data.Facea{}, m.Anri[5])

		c6a := node.NewNode()
		require.NoError(t, c6a.InitialiseArrayItem(cb.Ctx(), n.Map["anri"], 6))
		require.NoError(t, c6a.AddToArray(cb.Ctx(), n.Map["anri"], 6, true))
		require.NoError(t, c6a.SetValueZero(cb.Ctx(), false, facea))
		assert.NotNil(t, m.Anri[6])
		assert.IsType(t, &data.Facea{}, m.Anri[6])

		c7 := node.NewNode()
		require.NoError(t, c7.InitialiseMapItem(cb.Ctx(), n.Map["mnri"], "d"))
		require.NoError(t, c7.AddToMap(cb.Ctx(), n.Map["mnri"], "d", true))
		require.NoError(t, c7.SetValueZero(cb.Ctx(), true, sstring))
		assert.Nil(t, m.Mnri["d"])
		assert.IsType(t, system.NewString(""), m.Mnri["d"])

		c7a := node.NewNode()
		require.NoError(t, c7a.InitialiseMapItem(cb.Ctx(), n.Map["mnri"], "e"))
		require.NoError(t, c7a.AddToMap(cb.Ctx(), n.Map["mnri"], "e", true))
		require.NoError(t, c7a.SetValueZero(cb.Ctx(), false, sstring))
		assert.NotNil(t, m.Mnri["e"])
		assert.IsType(t, system.NewString(""), m.Mnri["e"])

		c8 := node.NewNode()
		require.NoError(t, c8.InitialiseMapItem(cb.Ctx(), n.Map["mnri"], "f"))
		require.NoError(t, c8.AddToMap(cb.Ctx(), n.Map["mnri"], "f", true))
		require.NoError(t, c8.SetValueZero(cb.Ctx(), true, facea))
		assert.Nil(t, m.Mnri["f"])
		assert.IsType(t, &data.Facea{}, m.Mnri["f"])

		c8a := node.NewNode()
		require.NoError(t, c8a.InitialiseMapItem(cb.Ctx(), n.Map["mnri"], "g"))
		require.NoError(t, c8a.AddToMap(cb.Ctx(), n.Map["mnri"], "g", true))
		require.NoError(t, c8a.SetValueZero(cb.Ctx(), false, facea))
		assert.NotNil(t, m.Mnri["g"])
		assert.IsType(t, &data.Facea{}, m.Mnri["g"])
	}
	data.Run(t, n, n.Value.(*data.Multi), test)

}