More tests + GUI
[ltsps.git] / t / 205_ten_point_furthest_heuristic.t
blobe7904621c85d7b88135dbce662f424dffb7f0785
1 use warnings;
2 use strict;
4 use Test::More qw(no_plan);
5 use Digest::MD5;
6 use Data::Dumper;
8 require 't/lib/Common.pm';
10 my $erm;
11 my $tm;
12 my $d = Digest::MD5->new;
15 my $cmd = "M = [1 7 7; 2 7 10; 3 3 8; 4 3 2; 5 7 5; 6 5 7; 7 8 4; 8 7 5; 9 9 9; 10 3 7];";
16 $cmd   .= "D = generateDistanceMatrix(M); ";
17 $cmd   .= "ltspsFurthestNeighbourHeuristic(M);";
18 run_matlab_cmd($cmd);
22 $erm = "output didn't match what I expected";
23 $tm  = "ten point furthest neighbour heuristic use";
25 my $expected_fn = "t/expected_output/205_ten_point_furthest_heuristic";
27 open(my $expected, "<", $expected_fn);
28 open(my $got,      "<", "t/matlab_output/output");
30 $d->addfile($expected);
31 my $d_expected = $d->hexdigest;
33 $d->addfile($got);
34 my $d_got = $d->hexdigest;
36 print Dumper($d_expected);
37 print Dumper($d_got);
39 ok(($d_expected eq $d_got or die($erm)),$tm);