xref: /openbsd/gnu/usr.bin/perl/cpan/bignum/t/in_effect.t (revision 5dea098c)
1# -*- mode: perl; -*-
2
3###############################################################################
4# Test in_effect()
5
6use strict;
7use warnings;
8
9use Test::More tests => 21;
10
11{
12    use bigint;
13
14    can_ok('bigint', qw/in_effect/);
15
16  SKIP: {
17        skip('Need at least Perl v5.9.4', 3) if $] < "5.009005";
18
19        is(bigint::in_effect(), 1,     'bigint in effect');
20        is(bigfloat::in_effect(), undef, 'bigfloat not in effect');
21        is(bigrat::in_effect(), undef, 'bigint not in effect');
22    }
23
24    {
25        no bigint;
26
27        is(bigint::in_effect(), undef, 'bigint not in effect');
28        is(bigfloat::in_effect(), undef, 'bigfloat not in effect');
29        is(bigrat::in_effect(), undef, 'bigrat not in effect');
30    }
31}
32
33{
34    use bigfloat;
35
36    can_ok('bigfloat', qw/in_effect/);
37
38  SKIP: {
39        skip('Need at least Perl v5.9.4', 3) if $] < "5.009005";
40
41        is(bigint::in_effect(), undef, 'bigint not in effect');
42        is(bigfloat::in_effect(), 1,     'bigfloat in effect');
43        is(bigrat::in_effect(), undef, 'bigint not in effect');
44    }
45
46    {
47        no bigfloat;
48
49        is(bigint::in_effect(), undef, 'bigint not in effect');
50        is(bigfloat::in_effect(), undef, 'bigfloat not in effect');
51        is(bigrat::in_effect(), undef, 'bigrat not in effect');
52    }
53}
54
55{
56    use bigrat;
57
58    can_ok('bigrat', qw/in_effect/);
59
60  SKIP: {
61        skip('Need at least Perl v5.9.4', 3) if $] < "5.009005";
62
63        is(bigint::in_effect(), undef, 'bigint not in effect');
64        is(bigfloat::in_effect(), undef, 'bigfloat not in effect');
65        is(bigrat::in_effect(), 1,     'bigint in effect');
66    }
67
68    {
69        no bigrat;
70
71        is(bigint::in_effect(), undef, 'bigint not in effect');
72        is(bigfloat::in_effect(), undef, 'bigfloat not in effect');
73        is(bigrat::in_effect(), undef, 'bigrat not in effect');
74    }
75}
76