use strict; use warnings; use diagnostics; use Scalar::Util qw(looks_like_number); use Test::More 'no_plan'; use ListStats; print "========================================\n"; diag( "Tests of Average" ); #AVERAGE IS DONE YEEEEEEEEAH # fix/add more tests for Average ... is( Average( ), 0, "Average empty list" ); is( Average( (2) ), 2, "Average singleton list" ); is( Average( (-7..5) ), -1, "Average list" ); is( Average( ("a") ), undef, "Average non-number in list" ); is( Average( 1, 2, 3, 4), 2.5, "Average numeric string - test one" ); is( Average( 52, "53", 93, 2678), 719, "Average numeric string - test two" ); print "========================================\n"; diag( "Tests of Median" ); is( Median( ), 0, "Median empty list" ); is( Median( (2) ), 2, "Median singleton list" ); is( Median( (-7..5) ), -1, "Median list" ); is( Median( ("a") ), undef, "Median non-number in list" ); is( Median( 0, "1", 2 ), 1, "Median numeric string - test one" ); is( Median( 0, "65", 34 ), 34, "Median numeric string - test two" ); #find length of string, get middle. print "========================================\n"; diag( "Tests of Low" ); # fix/add more tests for Low ... is( Low( ), 0, "Low empty list" ); is( Low( (2) ), 2, "Low singleton list" ); is( Low( (0,2,-2,-1) ), -2, "Low list" ); is( Low( ("a") ), undef, "Low non-number in list" ); is( Low( 0, "-1", 2 ), -1, "Low numeric string - test one" ); is( Low( 34, "-1", -47 ), -47, "Low numeric string - test two" ); print "========================================\n"; diag( "Tests of High" ); is( High( ), 0, "High empty list" ); is( High( (2) ), 2, "High singleton list" ); is( High( (0,2,-2,-1) ), 2, "High list" ); is( High( ("a") ), undef, "High non-number in list" ); is( High( 0, "-1", 2 ), 2, "High numeric string - test one" ); is( High( 0, "-1", 2,47, 2737 ), 2737, "High numeric string - test two" );