in reply to Test::More fails on foreach loop
What does parse() return?
I'm not being flippant; ok() expects a boolean. If the method returns something which coerces to a true value, that test assertion will pass.
If you want to continue to use the ok() assertion, make the method return a boolean value in all normal cases.
Update: I posted before I wrote what I really want to write: in the absence of an explicit return, the method will perform an implicit return of the last expression evaluated. Sometimes that's okay, but in this case it's not what you want.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Test::More fails on foreach loop
by Notdeadyet (Initiate) on Mar 16, 2011 at 19:50 UTC | |
by ikegami (Patriarch) on Mar 16, 2011 at 20:05 UTC | |
by Notdeadyet (Initiate) on Mar 16, 2011 at 20:44 UTC |