}
sub pat {
- my (undef, $a, $b, $x) = @_;
+ my (undef, $a, $b, $x, $y) = @_;
myfill $_[0], 0, $a, $x;
myfill $_[0], $a, $b, 1 - $x;
- myfill $_[0], $a + $b, $n - ($a + $b), $x;
+ myfill $_[0], $a + $b, $n - ($a + $b), $x if $y;
}
-my ($v1, $v2) = ('') x 2;
-
my @s = ($p - $q) .. ($p + $q);
for my $s1 (@s) {
for my $s2 (@s) {
for my $l (0 .. $n - 1) {
next if $s1 + $l > $n or $s2 + $l > $n;
- pat $v1, $s1, $l, 0;
- pat $v2, $s2, $l, 0;
+ my $v1 = '';
+ my $v2 = '';
+ pat $v1, $s1, $l, 0, 0;
+ pat $v2, $s2, $l, 0, 1;
+ my $desc = "veq_pp $s1, $s2, $l";
ok Scalar::Vec::Util::veq_pp($v1 => $s1, $v2 => $s2, $l),
- "veq_pp $s1, $s2, $l";
+ "$desc [1<=>2]";
+ ok Scalar::Vec::Util::veq_pp($v2 => $s2, $v1 => $s1, $l),
+ "$desc [2<=>1]";
if ($l > 0) {
ok !Scalar::Vec::Util::veq_pp($v1 => $s1 - 1, $v2 => $s2, $l),
- 'not veq_pp ' . ($s1-1) . ", $s2, $l";
+ 'not veq_pp ' . ($s1-1) . ", $s2, $l [1<=>2]";
ok !Scalar::Vec::Util::veq_pp($v1 => $s1 + 1, $v2 => $s2, $l),
- 'not veq_pp ' . ($s1+1) . ", $s2, $l";
+ 'not veq_pp ' . ($s1+1) . ", $s2, $l [1<=>2]";
}
}
}