Skip to content

Commit

Permalink
modify test for converting Lua tables to Go structs
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim Cooper committed Jul 3, 2016
1 parent ce56eb0 commit d124f8e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1078,6 +1078,7 @@ func Example__32() {
type E_33 struct {
Person
P Person
P2 Person `luar:"other"`
}

func Example__33() {
Expand All @@ -1094,6 +1095,10 @@ func Example__33() {
Age = 77
}
}
x.other = {
Name = "Dale",
Age = 26
}
`

L := lua.NewState()
Expand All @@ -1112,13 +1117,17 @@ func Example__33() {
fmt.Println(e.P.Age)
fmt.Println(e.P.Friend.Name)
fmt.Println(e.P.Friend.Age)
fmt.Println(e.P2.Name)
fmt.Println(e.P2.Age)
// Output:
// Bill
// 33
// Tim
// 94
// Bob
// 77
// Dale
// 26
}

func ExampleLState() {
Expand Down

0 comments on commit d124f8e

Please sign in to comment.