You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
722 B
33 lines
722 B
-- 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 -- }}}
|
|
|