(t *testing.T)
| 139 | } |
| 140 | |
| 141 | func TestPullStringTableFromLua(t *testing.T) { |
| 142 | |
| 143 | for _, tt := range fromLuaTT { |
| 144 | want, code := tt.want, tt.code |
| 145 | l := lua.NewState() |
| 146 | |
| 147 | var got map[string]string |
| 148 | var err error |
| 149 | |
| 150 | l.Register("pull_table", func(l *lua.State) int { |
| 151 | got, err = util.PullStringTable(l, 1) |
| 152 | return 0 |
| 153 | }) |
| 154 | lua.LoadString(l, code) |
| 155 | l.Call(0, 0) |
| 156 | |
| 157 | if err != nil { |
| 158 | t.Fatalf("pulling table, %v", err) |
| 159 | } |
| 160 | |
| 161 | checkMaps(t, want, got) |
| 162 | } |
| 163 | |
| 164 | } |
| 165 | |
| 166 | var fromLuaRecTT = []struct { |
| 167 | want map[string]interface{} |
nothing calls this directly
no test coverage detected