in reply to OT: Test framework (Re: RegExp, grabbing first name)
in thread RegExp, grabbing first name

Nice work comparing these approaches (++).

If anyone wants the hippo version to work even in the OP-unspecified case, all that is required is to change the return statment to

return $fname || $sname;

which completes the test set for that approach.

Replies are listed 'Best First'.
Re^2: OT: Test framework (Re: RegExp, grabbing first name)
by soonix (Chancellor) on Mar 06, 2016 at 21:36 UTC
    Thanks, updated.

    The proper reason I wrote this (and why I marked it as OT) was to get acquainted with (and get used to) TDD, so I didn't look deeper into the solutions than was necessary to fit them in…

    BTW in my private copy, I have the test case from Re^2: RegExp, grabbing first name :-)
    'PEPPER ALICE BELINDA, CHARLOTTA, ..., YULIA, ZINNIA' => 'ALPHABET +'