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

Function TestRemove

state_test.go:132–163  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

130}
131
132func TestRemove(t *testing.T) {
133 L := NewState()
134 defer L.Close()
135 L.Push(LString("a"))
136 L.Push(LString("b"))
137 L.Push(LString("c"))
138
139 L.Remove(4)
140 errorIfNotEqual(t, LString("a"), L.Get(1))
141 errorIfNotEqual(t, LString("b"), L.Get(2))
142 errorIfNotEqual(t, LString("c"), L.Get(3))
143 errorIfNotEqual(t, 3, L.GetTop())
144
145 L.Remove(3)
146 errorIfNotEqual(t, LString("a"), L.Get(1))
147 errorIfNotEqual(t, LString("b"), L.Get(2))
148 errorIfNotEqual(t, LNil, L.Get(3))
149 errorIfNotEqual(t, 2, L.GetTop())
150 L.Push(LString("c"))
151
152 L.Remove(-10)
153 errorIfNotEqual(t, LString("a"), L.Get(1))
154 errorIfNotEqual(t, LString("b"), L.Get(2))
155 errorIfNotEqual(t, LString("c"), L.Get(3))
156 errorIfNotEqual(t, 3, L.GetTop())
157
158 L.Remove(2)
159 errorIfNotEqual(t, LString("a"), L.Get(1))
160 errorIfNotEqual(t, LString("c"), L.Get(2))
161 errorIfNotEqual(t, LNil, L.Get(3))
162 errorIfNotEqual(t, 2, L.GetTop())
163}
164
165func TestToInt(t *testing.T) {
166 L := NewState()

Callers

nothing calls this directly

Calls 8

LStringTypeAlias · 0.85
errorIfNotEqualFunction · 0.85
NewStateFunction · 0.70
PushMethod · 0.65
CloseMethod · 0.45
RemoveMethod · 0.45
GetMethod · 0.45
GetTopMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…