diff options
| author | jacqueline <me@jacqueline.id.au> | 2023-12-13 16:10:08 +1100 |
|---|---|---|
| committer | jacqueline <me@jacqueline.id.au> | 2023-12-13 16:10:08 +1100 |
| commit | 64b106c13e18c33be0f2b0de532054e0ed3f731d (patch) | |
| tree | b54b1c90d941bc456b4d51e864970720bdf2d648 /lib/lua-repl/t/abstract-repl-tests.lua | |
| parent | 5a2f0b08e0e3f20cda977b510b680d5843ae7283 (diff) | |
| download | tangara-fw-64b106c13e18c33be0f2b0de532054e0ed3f731d.tar.gz | |
add a cool lua repl
Diffstat (limited to 'lib/lua-repl/t/abstract-repl-tests.lua')
| -rw-r--r-- | lib/lua-repl/t/abstract-repl-tests.lua | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/lib/lua-repl/t/abstract-repl-tests.lua b/lib/lua-repl/t/abstract-repl-tests.lua new file mode 100644 index 00000000..50d4b07c --- /dev/null +++ b/lib/lua-repl/t/abstract-repl-tests.lua @@ -0,0 +1,33 @@ +-- vim:foldmethod=marker +local repl = require 'repl' +pcall(require, 'luarocks.loader') +require 'Test.More' + +plan(8) + +do -- getprompt tests {{{ + is(repl:getprompt(1), '>') + is(repl:getprompt(2), '>>') +end -- }}} + +do -- prompt abstract tests {{{ + error_like(function() + repl:prompt(1) + end, 'You must implement the showprompt method') + + error_like(function() + repl:prompt(2) + end, 'You must implement the showprompt method') +end -- }}} + +do -- name tests {{{ + is(repl:name(), 'REPL') +end -- }}} + +do -- handleline abstract tests {{{ + is(_G.testresult, nil) + error_like(function() + repl:handleline '_G.testresult = 17' + end, 'You must implement the displayresults method') + is(_G.testresult, 17) +end -- }}} |
