plan
tests
=> 5;
my
$project_path
= path(
$Bin
,
'data'
,
'chapter3'
);
my
$results_path
= path(
$project_path
,
'amcpresults'
);
unlink
$results_path
if
-e
$results_path
;
my
$am
= Algorithm::AM->new(
$project_path
,
commas
=>
'no'
,
);
$am
->classify();
my
$results
= read_file(
$results_path
);
like_string(
$results
,
qr/e\s+4\s+30.769%\v+r\s+9\s+69.231%/
,
'Chapter 3 data, counting pointers'
)
or diag
$results
;
like_string(
$results
,
qr/Gang: squared/
,
'Chapter 3 data, counting occurences'
)
or diag
$results
;
unlink
$results_path
if
-e
$results_path
;
$am
->classify(
linear
=> 1);
$results
= read_file(
$results_path
);
like_string(
$results
,
qr/e\s+2\s+28.571%\v+r\s+5\s+71.429%/
,
'Chapter 3 data, counting occurences'
)
or diag
$results
;
like_string(
$results
,
qr/Gang: linear/
,
'Chapter 3 data, counting occurences'
)
or diag
$results
;
unlink
$results_path
if
-e
$results_path
;