use_ok(
'Mail::Karmasphere::Parser::Score::IP4'
);
my
$io
=
bless
\
*DATA
,
'IO::File'
;
my
$parser
= new Mail::Karmasphere::Parser::Score::IP4(
fh
=>
$io
,
);
my
$record
;
for
(0..2) {
$record
=
$parser
->parse;
ok(
defined
$record
,
'Got a record'
);
is(
$record
->identity,
'123.45.6.7'
);
is(
$record
->value, 1000);
is(
$record
->data,
undef
);
}
for
(0..0) {
$record
=
$parser
->parse;
ok(
defined
$record
,
'Got a record'
);
is(
$record
->identity,
'123.45.6.7'
);
is(
$record
->value, -1000);
is(
$record
->data,
undef
);
}
for
(0..0) {
$record
=
$parser
->parse;
ok(
defined
$record
,
'Got a record'
);
is(
$record
->identity,
'43.2.1.7'
);
is(
$record
->value, 1000);
is(
$record
->data,
"arse foo"
);
}