Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fix a couple last test fails in eof of list (bad expected result)

  • Loading branch information...
commit dba92a8535c77e417ea132998cca333f9f2c5024 1 parent e742ec4
@calebc calebc authored
Showing with 8 additions and 3 deletions.
  1. +8 −3 test/test_rexscan.rb
View
11 test/test_rexscan.rb
@@ -164,13 +164,15 @@ def a_seq
seq
end
- def idx2chunknum(i) i/8 end
+ def idx2chunknum(i,seq)
+ i/8
+ end
def chunk_regex; /.{1,8}/m end
def test__lookup_idx
seq=a_seq
(0..DATA.size).map{|i|
- assert_equal idx2chunknum(i), seq._lookup_idx(i)
+ assert_equal idx2chunknum(i,seq), seq._lookup_idx(i)
}
end
@@ -178,7 +180,10 @@ def test__lookup_idx
class ListMaxxed < List
def chunk_regex; /./m end
- def idx2chunknum(i) i end
+ def idx2chunknum(i,seq)
+ return seq.size-1 if i>=seq.size
+ i
+ end
end
class List1 < Indexed
Please sign in to comment.
Something went wrong with that request. Please try again.