kward / shunit2

shUnit2 is a xUnit based unit test framework for Bourne based shell scripts.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

_shunit_extractTestFunctions does not detect ksh style functions

GoogleCodeExporter opened this issue · comments

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