Skip to content

Commit

Permalink
[FEATURE] Range Testing TEST_CASE()-like macro
Browse files Browse the repository at this point in the history
Remove type discovery for the generation of the loops due it is not
needed.
  • Loading branch information
alejmrm committed Dec 16, 2013
1 parent 8bb8044 commit 6041a83
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions auto/generate_test_runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,12 @@ def find_test_for_range_case(arguments, name, call)
ranges = nil
if (@options[:use_param_tests] and !arguments.empty?)
args = []
targs = []
ranges = []
# discover the variable type for each loop
call.strip.split(/,/).each { |s| targs << s.strip.split(/\s/) }
# discover the loop boundaries
args = arguments.strip.gsub(/\s*\]\s*,\s*\[\s*/,"-").gsub(/\[|\]/,"").split('-')
args.each_index do |i|
iter = args[i].split(/,/)
ranges << { :vtype => targs[i][0], :start =>iter[0], :stop =>iter[1], :increment =>iter[2] }
ranges << { :start =>iter[0], :stop =>iter[1], :increment =>iter[2] }
end
end
return { :type => "TEST_RANGE", :test => name, :args => args, :call => call, :line_number => 0, :iterator=> ranges}
Expand Down

0 comments on commit 6041a83

Please sign in to comment.