File: Const.t

package info (click to toggle)
libmath-gsl-perl 0.45-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 192,156 kB
  • sloc: ansic: 895,524; perl: 24,682; makefile: 12
file content (33 lines) | stat: -rw-r--r-- 869 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package Math::GSL::Const::Test;
use base q{Test::Class};
use Test::More tests => 6;
use Math::GSL        qw/:all/;
use Math::GSL::SF    qw/:all/;
use Math::GSL::Const qw/:all/;
use Math::GSL::Test  qw/:all/;
use Math::GSL::Errno qw/:all/;
use strict;
BEGIN { gsl_set_error_handler_off() }

sub make_fixture : Test(setup) {
    my $self = shift;
}

sub teardown : Test(teardown) {
}

sub GSL_CONST_CGS : Tests {
    my $self = shift;
    cmp_ok( $GSL_CONST_CGS_SPEED_OF_LIGHT ,'==',   29979245800  );
}

sub MATH_CONSTANTS : Tests {
    my $self = shift;
    ok_similar( gsl_sf_log($M_E), 1,'ln($M_E)=1');
    ok_similar( gsl_sf_exp($M_LN2), 2,'e^($M_LN2)=2' );
    ok_similar( gsl_sf_exp($M_LNPI), $M_PI ,'e^($M_LNPI)=$M_PI');
    ok_similar( $M_SQRT2 ** 2, 2,'($M_SQRT2)**2=2' );
    ok_similar( $M_EULER, 0.577215664901532860606512090082 );
}

Test::Class->runtests;