Skip to content

Commit

Permalink
add the appropriate amount of trailing spaces to tests
Browse files Browse the repository at this point in the history
  • Loading branch information
moritz committed Sep 5, 2010
1 parent 73abd33 commit 2f14892
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
7 changes: 6 additions & 1 deletion lib/Nonogram.pm
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,12 @@ class Nonogram {

method solve-shift {
for <right down> -> $direction {
my @spec = $direction eq (any <left right>) ?? @!rowspec !! @!colspec;
my @spec = do given $direction {
when 'right' { @!rowspec }
when 'left' { @!rowspec.reverse }
when 'down' { @!colspec }
when 'up' { @!colspec.reverse }
}
for @spec.kv -> $idx, @chunks is copy {
next unless @chunks;
my $expect_next = '';
Expand Down
3 changes: 2 additions & 1 deletion t/solving.t
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ my $n = Nonogram.new(
lives_ok { $n.solve() }, 'can run .solve';

# note: traling spaces here must be preserved!
my $solved = q[
my $solved =
q[
??????
######
## ???
Expand Down

0 comments on commit 2f14892

Please sign in to comment.