]> git.vpit.fr Git - perl/modules/Test-Leaner.git/blobdiff - t/22-cmp_ok.t
Fix, export and test cmp_ok()
[perl/modules/Test-Leaner.git] / t / 22-cmp_ok.t
diff --git a/t/22-cmp_ok.t b/t/22-cmp_ok.t
new file mode 100644 (file)
index 0000000..f26d687
--- /dev/null
@@ -0,0 +1,25 @@
+#!perl -T
+
+use strict;
+use warnings;
+
+use Test::Leaner tests => 4 * 8;
+
+my @num_tests = (
+ [ '1.0', '==', '1.0' ],
+ [ '1e0', '==', '1e0' ],
+ [ '1.0', '<=', '1.0' ],
+ [ '1.0', '>=', '1.0' ],
+ [ '1.0', '<=', '2.0' ],
+ [ '1.0', '<',  '2.0' ],
+ [ '2.0', '>=', '1.0' ],
+ [ '2.0', '>',  '1.0' ],
+);
+
+for my $t (@num_tests) {
+ my ($x, $op, $y) = @$t;
+ cmp_ok $x,      $op, $y;
+ cmp_ok int($x), $op, $y;
+ cmp_ok $x,      $op, int($y);
+ cmp_ok int($x), $op, int($y);
+}