#!/usr/bin/perl
BEGIN { use_ok(
'Devel::Trace::More'
) };
is(
$Devel::Trace::More::IS_INTERESTING
->(), 1,
"Default IS_INTERESTING returns 1 with no params entered"
);
Devel::Trace::More::filter_on(
qr/Test/
);
is(
$Devel::Trace::More::IS_INTERESTING
->(
''
,
'Stuff Test Blah'
,
''
,
''
), 1,
"IS_INTERESTING found something interesting with a regex"
);
is(
$Devel::Trace::More::IS_INTERESTING
->(
''
,
'Stuff Thing Blah'
,
''
,
''
),
''
,
"IS_INTERESTING did not find something interesting with a regex"
);
Devel::Trace::More::filter_on(
sub
{
my
(
$p
,
$f
,
$l
,
$c
) =
@_
;
return
index
(
$f
,
'Test'
) > -1; } );
is(
$Devel::Trace::More::IS_INTERESTING
->(
''
,
'Stuff Test Blah'
,
''
,
''
), 1,
"IS_INTERESTING found something interesting with a code ref"
);
is(
$Devel::Trace::More::IS_INTERESTING
->(
''
,
'Stuff Thing Blah'
,
''
,
''
),
''
,
"IS_INTERESTING did not find something interesting with a code ref"
);
Devel::Trace::More::filter_on(
'Test'
);
is(
$Devel::Trace::More::IS_INTERESTING
->(
''
,
'Stuff Test Blah'
,
''
,
''
), 1,
"IS_INTERESTING found something interesting with a scalar"
);
is(
$Devel::Trace::More::IS_INTERESTING
->(
''
,
'Stuff Thing Blah'
,
''
,
''
),
''
,
"IS_INTERESTING did not find something interesting with a scalar"
);