Sha256: a7e1af10d39f04e8db149553fd8ecfade426154c45f5b892ca3d7ce1e7315cbd

Contents?: true

Size: 993 Bytes

Versions: 4

Compression:

Stored size: 993 Bytes

Contents

#!/usr/local/bin/ruby
if $0 == __FILE__
  Dir.chdir File.dirname(__FILE__)+'/../'
  $:.unshift File.expand_path('../lib/')
end

require 'rio'
require 'tc/testcase'

class TC_skiplines < Test::RIO::TestCase
  @@once = false
  N_LINES = 4
  def self.once
    @@once = true
    rio('f1') < (0...N_LINES).map { |i| "L#{i}:f1\n" }
    rio('f2') < (0...N_LINES).map { |i| "L#{i}:f2\n" }
    rio('g1') < (0...N_LINES).map { |i| "L#{i}:g1\n" }
    rio('g2') < (0...N_LINES).map { |i| "L#{i}:g2\n" }
  end
  def setup
    super
    self.class.once unless @@once
    
  end

  def test_prefix_lines
#    exprio = rio(@d0).skipfiles(/1/)
#    ansrio = rio(@d0).skip.files(/1/)
    r = rio('f1').skip.lines(1)
#    p r.cx
#    p r.to_a
#    assert_equal(smap(exprio[]),smap(ansrio[]))
  end
  def test_skip_param
#    exprio = rio(@d0).skipfiles(/1/)
#    ansrio = rio(@d0).skip.files(/1/)
    r = rio('f1').lines(/^L/).skip(1..2)
#    p r.to_a
#    assert_equal(smap(exprio[]),smap(ansrio[]))
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rio-0.3.8 test/tc/skiplines.rb
rio-0.3.7 test/tc/skiplines.rb
rio-0.3.6 test/tc/skiplines.rb
rio-0.3.4 test/tc/skiplines.rb