theboocock / shunit2

Automatically exported from code.google.com/p/shunit2
0 stars 0 forks source link

_shunit_extractTestFunctions does not detect ksh style functions #38

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
The regular expression in _shunit_extractTestFunctions (^[  ]*(function 
)*test[A-Za-z0-9_]* *\(\)) cannot detect ksh style functions, due to it 
expecting the "()" to follow the function name. This causes shunit2 to ignore 
all tests when running against a ksh compatible code-base. The following 
function syntax is possible in ksh:

function foo {
  ...
}

function foo
{
  ...
}

foo() {
  ...
}

foo()
{
  ...
}

Original issue reported on code.google.com by postmode...@gmail.com on 7 Aug 2013 at 9:29