1 package Math::GSL::GSL::Test;
2 use base q{Test::Class};
3 use Test::More tests => 18;
4 use Math::GSL::SF qw/:all/;
5 use Math::GSL::BLAS qw/:all/;
6 use Math::GSL::Vector qw/:all/;
7 use Math::GSL::Complex qw/:all/;
8 use Math::GSL::Matrix qw/:all/;
9 use Math::GSL::CBLAS qw/:all/;
10 use Math::GSL qw/:all/;
11 use Math::GSL::Test qw/:all/;
12 use Math::GSL::Errno qw/:all/;
16 BEGIN { gsl_set_error_handler_off(); }
18 sub make_fixture : Test(setup) {
21 sub teardown : Test(teardown) {
24 sub TEST_STUFF : Tests {
27 q{is_similar(undef, [1,2,3]) } => [ 0 ],
28 q{is_similar(0.10005,0.1000501, 1e-5)} => [ 1 ],
29 q{is_similar(0.10005,0.1000501, 1e-7)} => [ 0 ],
30 q{is_similar([1,2,3 ], [1,2,3.001])} => [ 0 ],
31 q{is_similar([1,2,3.001], [1,2,3.001])} => [ 1 ],
32 q{is_similar([1,2,3.001], [1,2,3.001],1e-2)} => [ 1 ],
33 q{is_similar([1,2,3.0010001], [1,2,3.0010002], 1e-5)} => [ 1 ],
34 q{is_similar([1,2,3.0010001], [1,2,3.0010002] )} => [ 0 ],
35 q{is_similar_relative( 1e8, 1e8 + 1, 1e-7) } => [ 1 ],
36 q{is_similar_relative( 1e8, 1e8 + 1e3, 1e-7) } => [ 0 ],
37 q{is_status_ok($GSL_SUCCESS)} => [ 1 ],
38 q{is_status_ok($GSL_EDOM)} => [ 0 ],
41 verify($results, 'Math::GSL');
44 ok_status(0,$GSL_SUCCESS);
48 my $fh = gsl_fopen('mrfuji','w');
49 ok(defined $fh, 'gsl_fopen can create files');
50 ok_status(gsl_fclose($fh));
53 my $fh = gsl_fopen('mrfuji','r');
54 ok(defined $fh, 'gsl_fopen can read files');
55 ok_status(gsl_fclose($fh));
56 unlink 'mrfuji' if -e 'mrfuji';
61 Test::Class->runtests;