blob: 894ff3c8c0018bac74ba1d479e49976f0bd2ce9b (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
package main
import (
"testing"
lua "github.com/yuin/gopher-lua"
)
func TestMetaTable(t *testing.T) {
luaState := lua.NewState()
defer luaState.Close()
RegisterCustomLuaTypes(luaState)
if err := luaState.DoString(`
print("Testing MetaTable")
print(toml_config)
for index, data in ipairs(toml_config) do
print(index, data)
for k,v in pairs(data) do
print("one")
print(k,v)
end
end
config = toml_config.new()
print(config:IrcServer())
config:IrcServer("irc.freenode.net")
print(config:IrcServer())
`); err != nil {
t.Fatal(err)
}
}
|