Bugs: Browse | Submit New | Admin

[#18046] misreported coverage on simple if stmt

Date:
2008-02-13 22:18
Priority:
3
Submitted By:
Ryan Davis (zenspider)
Assigned To:
Mauricio Julio Fernandez Pradier (batsman)
Category:
None
State:
Open
Summary:
misreported coverage on simple if stmt

Detailed description
The last conditional fails to execute but rcov is currently reporting 100% coverage. The p before the conditional shows
in my test runs that neither c nor beg are ever nil. The p inside never prints.

  def parse_quote(c) # Region has 64 lines
    beg, nnd = nil, nil
    short_hand = false

    unless c =~ /[a-z0-9]/i then # Short-hand (e.g. %{,%.,%!,... versus %Q{).
      beg, c = c, 'Q'
      short_hand = true
    else                         # Long-hand (e.g. %Q{}).
      short_hand = false
      beg = src.getch
      if beg =~ /[a-z0-9]/i then
        rb_compile_error "unknown type of %string"
      end
    end

    p [c, beg]

    if c == RubyLexer::EOF or beg == RubyLexer::EOF then
      p caller
      rb_compile_error "unterminated quoted string meets end of file"
    end

    # ... lots and lots more... ugh
  end

Add A Comment: Notepad

Please login


Followup

No Followups Have Been Posted

Attached Files:

Name Description Download
No Files Currently Attached

Changes:

Field Old Value Date By
assigned_tonone2008-02-13 22:18zenspider