MCPcopy Index your code
hub / github.com/yuin/gopher-lua / TestTableAppend

Function TestTableAppend

table_test.go:54–74  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

52}
53
54func TestTableAppend(t *testing.T) {
55 tbl := newLTable(0, 0)
56 tbl.RawSetInt(1, LNumber(1))
57 tbl.RawSetInt(2, LNumber(2))
58 tbl.RawSetInt(3, LNumber(3))
59 errorIfNotEqual(t, 3, tbl.Len())
60
61 tbl.RawSetInt(1, LNil)
62 tbl.RawSetInt(2, LNil)
63 errorIfNotEqual(t, 3, tbl.Len())
64
65 tbl.Append(LNumber(4))
66 errorIfNotEqual(t, 4, tbl.Len())
67
68 tbl.RawSetInt(3, LNil)
69 tbl.RawSetInt(4, LNil)
70 errorIfNotEqual(t, 0, tbl.Len())
71
72 tbl.Append(LNumber(5))
73 errorIfNotEqual(t, 1, tbl.Len())
74}
75
76func TestTableInsert(t *testing.T) {
77 tbl := newLTable(0, 0)

Callers

nothing calls this directly

Calls 6

newLTableFunction · 0.85
LNumberTypeAlias · 0.85
errorIfNotEqualFunction · 0.85
AppendMethod · 0.80
RawSetIntMethod · 0.45
LenMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…