Sha256: 3510558ecac36c777fa1c6f540ecda38d06b8561ccc05322a9980b8a979f54d2

Contents?: true

Size: 1.03 KB

Versions: 2

Compression:

Stored size: 1.03 KB

Contents

#!/usr/bin/env ruby
require_relative 'cmd-helper'
require_relative '../../processor/command/list'

class TestCommandParseListCmd < Test::Unit::TestCase
  include UnitHelper
  def setup
    common_setup
    @cmd = @cmds['list']
  end
  def test_parse_list_cmd
    tf = RubyVM::Frame.current
    @cmdproc.frame_setup(tf)
    short_file = File.basename(__FILE__)
    listsize = 10
    line = __LINE__ - 8
    load 'tmpdir.rb'
    [['', [short_file, line, line+listsize-1]],
     ["#{__FILE__}:10", [short_file, 5, 14]],
     ["#{__FILE__} 10", [short_file, 5, 14]],
     ['tmpdir.rb', ['tmpdir.rb', 1, listsize]],
     ['tmpdir.rb 10', ['tmpdir.rb', 5, 5+listsize-1]],
#     ['Columnize.columnize 15', ['columnize.rb', 10, 10+listsize -1]],
#     ['Columnize.columnize 30 3', ['columnize.rb', 30, 32]],
#     ['Columnize.columnize 40 50', ['columnize.rb', 40, 50]],
    ].each do |arg_str, expect|
      got = @cmdproc.parse_list_cmd(arg_str, listsize, listsize/2)[1..-1]
      got[0] = File.basename(got[0])
      assert_equal expect, got
    end
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
trepanning-1.93.35 test/unit/test-cmd-parse_list_cmd.rb
trepanning-1.93.32 test/unit/test-cmd-parse_list_cmd.rb