Skip to content

Commit

Permalink
fixed/unfudged a logic error
Browse files Browse the repository at this point in the history
  • Loading branch information
dwarring committed Jul 24, 2014
1 parent 08f409e commit 659ac13
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions integration/99problems-11-to-20.t
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ plan 25;
elsif ($prev_ch eq '') {
$ch_cnt++;
# If it's the last char, add it.
if (@chars.elems == 1) {
if (@chars.elems == 0) {
if ($ch_cnt != 1) {
$encoded ~= $ch_cnt;
}
Expand All @@ -115,7 +115,7 @@ plan 25;
sub encode_direct2(*@array is copy) returns Str {
my ($packed, $count);
while @array {
if @array[0] eq @array[1] {
if @array > 1 && @array[0] eq @array[1] {
$count++;
}
else {
Expand All @@ -128,11 +128,7 @@ plan 25;
}

is encode_direct(()),'', 'We should be able to encode_direct an empty list';
#?niecza todo
#?rakudo todo 'unknown'
is encode_direct(<a>), 'a', '.. or a one-element iist';
#?niecza todo
#?rakudo todo 'unknown'
is encode_direct(<a a>), '2a', '.. or a n-ary list with always same element';
is encode_direct(<a a a a b c c a a d e e e e>),
'4ab2c2ad4e',
Expand Down

0 comments on commit 659ac13

Please sign in to comment.