my
$NAME
=
'ipchgmon'
;
my
$invoke
=
"$^X $RealBin/../bin/$NAME"
;
my
$rtn
=
qx($invoke --debug --email foo\@bar 2>&1)
;
like
$rtn
,
qr/Invalid email/
m,
'Reject if single email address malformed'
;
$rtn
=
qx($invoke --debug --email invalid\@example.com 2>&1)
;
unlike
$rtn
,
qr/Invalid email/
m,
'Well-formed email address accepted'
;
$rtn
=
qx($invoke --debug --email invalid\@example.com --email foo\@bar 2>&1)
;
like
$rtn
,
qr/Invalid email/
m,
'Rejected if second email address invalid'
;
$rtn
=
qx($invoke --debug --email foo\@bar --email invalid\@example.com 2>&1)
;
like
$rtn
,
qr/Invalid email/
m,
'Rejected if first email address (of two) invalid'
;
done_testing();