1
0
mirror of https://github.com/jhillyerd/inbucket.git synced 2025-12-18 18:17:03 +00:00

lua: Use table syntax for user object bindings (#325)

* lua: update bind_message to use table syntax

* lua: update bind_address to use table syntax
This commit is contained in:
James Hillyerd
2023-02-08 13:38:00 -08:00
committed by GitHub
parent 17b054b5a1
commit 239426692e
3 changed files with 101 additions and 135 deletions

View File

@@ -35,19 +35,19 @@ func TestAfterMessageStored(t *testing.T) {
end
function after_message_stored(msg)
assert_eq(msg:mailbox(), "mb1")
assert_eq(msg:id(), "id1")
assert_eq(msg:subject(), "subj1")
assert_eq(msg:size(), 42)
assert_eq(msg.mailbox, "mb1")
assert_eq(msg.id, "id1")
assert_eq(msg.subject, "subj1")
assert_eq(msg.size, 42)
assert_eq(msg:from():name(), "name1")
assert_eq(msg:from():address(), "addr1")
assert_eq(msg.from.name, "name1")
assert_eq(msg.from.address, "addr1")
assert_eq(table.getn(msg:to()), 1)
assert_eq(msg:to()[1]:name(), "name2")
assert_eq(msg:to()[1]:address(), "addr2")
assert_eq(table.getn(msg.to), 1)
assert_eq(msg.to[1].name, "name2")
assert_eq(msg.to[1].address, "addr2")
assert_eq(msg:date(), 981173106)
assert_eq(msg.date, 981173106)
notify:send(test_ok)
end