MCPcopy Index your code
hub / github.com/Shopify/go-lua / TestToBooleanOutOfRange

Function TestToBooleanOutOfRange

lua_test.go:19–31  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

17}
18
19func TestToBooleanOutOfRange(t *testing.T) {
20 l := NewState()
21 l.SetTop(0)
22 l.PushBoolean(false)
23 l.PushBoolean(true)
24
25 for i, want := range []bool{false, true, false, false} {
26 idx := 1 + i
27 if got := l.ToBoolean(idx); got != want {
28 t.Errorf("l.ToBoolean(%d) = %t; want %t", idx, got, want)
29 }
30 }
31}

Callers

nothing calls this directly

Calls 4

SetTopMethod · 0.95
PushBooleanMethod · 0.95
ToBooleanMethod · 0.95
NewStateFunction · 0.85

Tested by

no test coverage detected