Skip to content

Commit

Permalink
Add a test for Reline::Unicode#take_range
Browse files Browse the repository at this point in the history
  • Loading branch information
aycabta committed Sep 5, 2021
1 parent c30632f commit af7953f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/reline/test_unicode.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,9 @@ def test_get_mbchar_width
def test_ambiguous_width
assert_equal 2, Reline::Unicode.calculate_width('√', true)
end

def test_take_range
assert_equal 'cdef', Reline::Unicode.take_range('abcdefghi', 2, 4)
assert_equal 'いう', Reline::Unicode.take_range('あいうえお', 2, 4)
end
end

0 comments on commit af7953f

Please sign in to comment.