plan
tests
=> 7;
my
$project_path
= path(
$Bin
,
'data'
,
'chapter3_given'
);
my
$results_path
= path(
$project_path
,
'amcpresults'
);
unlink
$results_path
if
-e
$results_path
;
my
$am
= Algorithm::AM->new(
$project_path
,
commas
=>
'no'
,
exclude_given
=> 1
);
$am
->classify();
my
$results
= read_file(
$results_path
);
like_string(
$results
,
qr/e 4 30.769%\v+r 9 69.231%/
,
'Results for exclude given'
)
or diag
$results
;
like_string(
$results
,
qr/If context is in data file then exclude/
,
'Flag should indicate exclude given'
)
or diag
$results
;
unlike_string(
$results
,
qr/Include context even if it is in the data file/
,
'Flag should not indicate include given'
)
or diag
$results
;
unlink
$results_path
if
-e
$results_path
;
$am
->classify(
exclude_given
=> 0);
$results
= read_file(
$results_path
);
like_string(
$results
,
qr/r\s+15\s+100.000%/
,
'Include given'
)
or diag
$results
;
like_string(
$results
,
qr/Include context even if it is in the data file/
,
'Flag should indicate include given'
)
or diag
$results
;
unlike_string(
$results
,
qr/If context is in data file then exclude/
,
'Flag should not indicate exclude given'
)
or diag
$results
;
unlink
$results_path
if
-e
$results_path
;