Next | Automated Testing | 18 |
my ($rec) = qx{ grep '^netmon:' $db_file }; is((split(/:/, $rec))[3], "expired", "netmon user was expired");
Other potential sources of error don't arise
We wouldn't want to use a shell command in production code
What if $db_file contained a shell metacharacter?
In the test program, who cares?
What if $username contained a shell metacharacter?
In the test program, $username is hardwired as netmon
In the test program, we don't care if grep is inefficient
In the test program, we don't care if grep is unportable
Next | Copyright © 2004 Mark Dominus |