tests/wplua/scripts/lib/testlib.lua
raw| 1 | local testlib = {} |
| 2 | |
| 3 | testlib.table1 = {} |
| 4 | |
| 5 | testlib.table1 ["test-key"] = "test-value" |
| 6 | |
| 7 | function testlib.test_add_ten (x) |
| 8 | return x + 10 |
| 9 | end |
| 10 | |
| 11 | function testlib.get_empty_table (key) |
| 12 | testlib.table1 [key] = {} |
| 13 | return testlib.table1 [key] |
| 14 | end |
| 15 | |
| 16 | function testlib.set_table (key, value) |
| 17 | testlib.table1 [key] = value |
| 18 | end |
| 19 | |
| 20 | function testlib.get_table (key) |
| 21 | return testlib.table1 [key] |
| 22 | end |
| 23 | |
| 24 | Log.info ("in testlib") |
| 25 | |
| 26 | return testlib |