Skip to content
Discussion options

You must be logged in to vote

parametrize does this. put the tests in a set parametrized by the function name and every case inside runs once per entry, getting it as an argument:

T['impl'] = MiniTest.new_set({ parametrize = { { 'func_re' }, { 'func_ts' } } })

T['impl']['returns the thing'] = function(fname)
  local ret = child.lua('return ' .. fname .. '()')
  eq(ret, expected)
end

works for nested sets too, everything under T['impl'] gets multiplied. there's a small example under :h MiniTest.new_set().

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ymic9963
Comment options

Answer selected by ymic9963
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Further information is requested mini.test
2 participants