use Test::More tests => 3; use File::Spec; use lib File::Spec->catfile("..","lib"); use Math::MatrixReal; do 'funcs.pl'; my $matrix = Math::MatrixReal->new_diag([1,2,3,4]); $matrix->display_precision(5); my $correct = Math::MatrixReal->new_from_string(<display_precision(5); ok( "$matrix" eq "$correct", 'display_precision(n)' ); $matrix->display_precision(0); $correct = Math::MatrixReal->new_from_string(<display_precision(0); ok( "$matrix" eq "$correct", 'display_precision(0)' ); { assert_dies ( sub { Math::MatrixReal->new(5,5)->display_precision(-42) }, 'display_precision dies on negative arg, matey!' ); }