Added working test of nested poll function on CLI

This commit is contained in:
Nathan Schneider 2021-08-03 15:48:11 -06:00
parent 4e10d74bff
commit 82226f71b1

View File

@ -0,0 +1,24 @@
dofile("../modpol.lua")
print('\nRemoving existing orgs')
modpol.orgs.reset()
print('\nCreating an org called "test_org"')
test_org = modpol.instance:add_org('test_org', 'luke')
print('\nAdding user "nathan" to test_org')
test_org:add_member('nathan')
print('\nTrying to remove user "nathan" from empty member list')
test_org:remove_member('nathan')
print('\nInteractive test poll with nested functions...')
modpol.interactions.text_query(
"nathan","Poll question:",
function(input)
modpol.interactions.binary_poll_user(
"nathan", input,
function(response)
print("Poll successful!")
end)
end)