Sha256: 9b9affb939c8f5ea2ba7dcda062abab4edc79e69f9c22681d1081d12557a0a3f
Contents?: true
Size: 1.12 KB
Versions: 2
Compression:
Stored size: 1.12 KB
Contents
#!/usr/bin/env ruby # $Id$ require 'test/unit' require 'fileutils' require 'tempfile' # Test TestLineNumbers module class TestLineNumbers1 < Test::Unit::TestCase @@TEST_DIR = File.expand_path(File.dirname(__FILE__)) @@TOP_SRC_DIR = File.join(@@TEST_DIR, '..', 'lib') require File.join(@@TOP_SRC_DIR, 'tracelines.rb') @@rcov_file = File.join(@@TEST_DIR, 'rcov-bug.rb') # File.open(@@rcov_file, 'r') {|fp| # first_line = fp.readline[1..-2] # @@rcov_lnums = eval(first_line, binding, __FILE__, __LINE__) # } @@rcov_lnums = [3, 7, 8] def test_for_file rcov_lines = TraceLineNumbers.lnums_for_file(@@rcov_file) assert_equal(@@rcov_lnums, rcov_lines) end def test_for_string string = "# Some rcov bugs.\nz = \"\nNow is the time\n\"\n\nz =~ \n /\n 5\n /ix\n" rcov_lines = TraceLineNumbers.lnums_for_str(string) check = [2, 6, 7] # check = [2, 9] assert_equal(check, rcov_lines) end def test_for_string_array lines = File.open(@@rcov_file).readlines rcov_lines = TraceLineNumbers.lnums_for_str_array(lines) assert_equal(@@rcov_lnums, rcov_lines) end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
rbx-linecache-1.4-universal-rubinius-2.0 | test/test-tracelines.rb |
rbx-linecache-1.4-universal-rubinius-1.2 | test/test-tracelines.rb |