@@ -144,8 +144,8 @@ def find_tests(source)
144144 if @options [ :use_param_tests ] && !arguments . empty?
145145 args = [ ]
146146 type_and_args = arguments . split ( /TEST_(CASE|RANGE)/ )
147- for i in ( 1 ...type_and_args . length ) . step ( 2 )
148- if type_and_args [ i ] == " CASE"
147+ ( 1 ...type_and_args . length ) . step ( 2 ) . each do | i |
148+ if type_and_args [ i ] == ' CASE'
149149 args << type_and_args [ i + 1 ] . sub ( /^\s *\( \s *(.*?)\s *\) \s *$/m , '\1' )
150150 next
151151 end
@@ -194,12 +194,11 @@ def find_includes(source)
194194 source . gsub! ( /\/ \/ .*$/ , '' ) # remove line comments (all that remain)
195195
196196 # parse out includes
197- includes = {
198- local : source . scan ( /^\s *#include\s +\ "\s *(.+\. #{ @options [ :include_extensions ] } )\s *\ " / ) . flatten ,
197+ {
198+ local : source . scan ( /^\s *#include\s +"\s *(.+\. #{ @options [ :include_extensions ] } )\s *"/ ) . flatten ,
199199 system : source . scan ( /^\s *#include\s +<\s *(.+)\s *>/ ) . flatten . map { |inc | "<#{ inc } >" } ,
200- linkonly : source . scan ( /^TEST_FILE\( \s *\ "\s *(.+\. #{ @options [ :source_extensions ] } )\s *\ " / ) . flatten
200+ linkonly : source . scan ( /^TEST_FILE\( \s *"\s *(.+\. #{ @options [ :source_extensions ] } )\s *"/ ) . flatten
201201 }
202- includes
203202 end
204203
205204 def find_mocks ( includes )
@@ -446,7 +445,7 @@ def create_main(output, filename, tests, used_mocks)
446445 end
447446
448447 def create_h_file ( output , filename , tests , testfile_includes , used_mocks )
449- filename = File . basename ( filename ) . gsub ( /[-\/ \\ \. \ ,\s ]/ , '_' ) . upcase
448+ filename = File . basename ( filename ) . gsub ( /[-\/ \\ . ,\s ]/ , '_' ) . upcase
450449 output . puts ( '/* AUTOGENERATED FILE. DO NOT EDIT. */' )
451450 output . puts ( "#ifndef _#{ filename } " )
452451 output . puts ( "#define _#{ filename } \n \n " )
@@ -485,7 +484,7 @@ def create_h_file(output, filename, tests, testfile_includes, used_mocks)
485484 when /\. *\. ya?ml$/
486485 options = UnityTestRunnerGenerator . grab_config ( arg )
487486 true
488- when /--(\w +)=\ " ?(.*)\ " ?/
487+ when /--(\w +)="?(.*)"?/
489488 options [ Regexp . last_match ( 1 ) . to_sym ] = Regexp . last_match ( 2 )
490489 true
491490 when /\. *\. (?:hpp|hh|H|h)$/
0 commit comments