(t *testing.T)
| 157 | } |
| 158 | |
| 159 | func TestCheckOption(t *testing.T) { |
| 160 | opts := []string{ |
| 161 | "opt1", |
| 162 | "opt2", |
| 163 | "opt3", |
| 164 | } |
| 165 | L := NewState() |
| 166 | defer L.Close() |
| 167 | errorIfGFuncNotFail(t, L, func(L *LState) int { |
| 168 | L.Push(LString("opt1")) |
| 169 | errorIfNotEqual(t, 0, L.CheckOption(2, opts)) |
| 170 | L.Push(LString("opt5")) |
| 171 | L.CheckOption(3, opts) |
| 172 | return 0 |
| 173 | }, "invalid option: opt5 \\(must be one of opt1,opt2,opt3\\)") |
| 174 | } |
| 175 | |
| 176 | func TestOptInt(t *testing.T) { |
| 177 | L := NewState() |
nothing calls this directly
no test coverage detected
searching dependent graphs…