diff --git a/modpol/tests/nested_functions.lua b/modpol/tests/nested_functions.lua new file mode 100644 index 0000000..378cb42 --- /dev/null +++ b/modpol/tests/nested_functions.lua @@ -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)