]> git.vpit.fr Git - perl/modules/Test-Leaner.git/blob - t/22-cmp_ok.t
Fix, export and test cmp_ok()
[perl/modules/Test-Leaner.git] / t / 22-cmp_ok.t
1 #!perl -T
2
3 use strict;
4 use warnings;
5
6 use Test::Leaner tests => 4 * 8;
7
8 my @num_tests = (
9  [ '1.0', '==', '1.0' ],
10  [ '1e0', '==', '1e0' ],
11  [ '1.0', '<=', '1.0' ],
12  [ '1.0', '>=', '1.0' ],
13  [ '1.0', '<=', '2.0' ],
14  [ '1.0', '<',  '2.0' ],
15  [ '2.0', '>=', '1.0' ],
16  [ '2.0', '>',  '1.0' ],
17 );
18
19 for my $t (@num_tests) {
20  my ($x, $op, $y) = @$t;
21  cmp_ok $x,      $op, $y;
22  cmp_ok int($x), $op, $y;
23  cmp_ok $x,      $op, int($y);
24  cmp_ok int($x), $op, int($y);
25 }