Changeset 29227

Show
Ignore:
Timestamp:
01/29/09 16:42:33 (4 years ago)
Author:
isaisstillalive
Message:
  • 改行カウントに不具合があったので修正
Location:
lang/ruby/ruwin
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • lang/ruby/ruwin/lib/ruwin/edit_field.rb

    r29225 r29227  
    192192      private 
    193193      def count_br physical_first, physical_length 
    194         string[physical_first, physical_length].split("\r\n").size-1 
     194        (string[physical_first, physical_length]+" ").split("\r").size-1 
    195195      end 
    196196       
  • lang/ruby/ruwin/test/ruwin/test_edit_field.rb

    r29145 r29227  
    3030    assert_equal [12, 19], @control.get_selection 
    3131  end 
     32   
     33   
     34  def test_count_br_half_line_brake 
     35    @control.string = "caption\r\ncaption\r\ncaption" 
     36    assert_equal 1, @control.__send__(:count_br, 0, 8) 
     37  end 
     38   
     39  def test_count_br_after_line_brake 
     40    @control.string = "caption\r\ncaption\r\ncaption" 
     41    assert_equal 1, @control.__send__(:count_br, 0, 9) 
     42  end 
    3243end