use strict;
use warnings;
-use Test::Leaner tests => 4 * 8;
+use Test::Leaner tests => 4 * 10 + 7 + 10;
my @num_tests = (
[ '1.0', '==', '1.0' ],
[ '1.0', '<', '2.0' ],
[ '2.0', '>=', '1.0' ],
[ '2.0', '>', '1.0' ],
+ [ '1.0', '!=', '2.0' ],
+ [ '2.0', '!=', '1.0' ],
);
for my $t (@num_tests) {
cmp_ok $x, $op, int($y);
cmp_ok int($x), $op, int($y);
}
+
+my @str_tests = (
+ [ 'a', 'eq', 'a' ],
+ [ 'a', 'le', 'b' ],
+ [ 'a', 'lt', 'b' ],
+ [ 'b', 'ge', 'a' ],
+ [ 'b', 'gt', 'a' ],
+ [ 'a', 'ne', 'b' ],
+ [ 'b', 'ne', 'a' ],
+);
+
+for my $t (@str_tests) {
+ my ($x, $op, $y) = @$t;
+ cmp_ok $x, $op, $y;
+}
+
+my @logic_tests = (
+ [ 1, 'or', 0 ],
+ [ 0, 'or', 1 ],
+ [ 1, 'or', 1 ],
+ [ 1, 'xor', 0 ],
+ [ 0, 'xor', 1 ],
+ [ 1, 'and', 1 ],
+
+ [ 1, '||', 0 ],
+ [ 0, '||', 1 ],
+ [ 1, '||', 1 ],
+ [ 1, '&&', 1 ],
+);
+
+for my $t (@logic_tests) {
+ my ($x, $op, $y) = @$t;
+ cmp_ok $x, $op, $y;
+}