Commits

Anonymous committed bf55013

Add tests for mindex and maxdex after using a methid that triggers a sort on the data.

Comments (0)

Files changed (1)

Statistics-Descriptive/t/descr.t

 use strict;
 use warnings;
 
-use Test::More tests => 59;
+use Test::More tests => 61;
 
 use lib 't/lib';
 use Utils qw/is_between compare_hash_by_ranges/;
     $stat1->add_data(@data2);     #  add new data
     is ($stat1->mindex, $e_mindex, "mindex is correct after new data added");
     is ($stat1->maxdex, $e_maxdex, "maxdex is correct after new data added");
+
+    # TEST*2
+    $stat1->median;  #  trigger a sort
+    $e_maxdex = scalar @data1 + scalar @data2 - 1;
+    is ($stat1->mindex, 0, "mindex is correct after sorting");
+    is ($stat1->maxdex, $e_maxdex, "maxdex is correct after sorting");
+    
 }