Merge pull request #4589 from shuujii/refine-String-chr-test

Refine `String#chr` test and separate `Fixnum#chr` test
This commit is contained in:
Yukihiro "Matz" Matsumoto
2019-07-20 08:15:02 +09:00
committed by GitHub
2 changed files with 6 additions and 6 deletions
+3
View File
@@ -0,0 +1,3 @@
assert('Fixnum#chr') do
assert_equal "a", 97.chr
end
+3 -6
View File
@@ -298,12 +298,6 @@ assert('String#oct') do
assert_equal (-8), "-10".oct
end
assert('String#chr') do
assert_equal "a", "abcde".chr
# test Fixnum#chr as well
assert_equal "a", 97.chr
end
assert('String#lines') do
assert_equal ["Hel\n", "lo\n", "World!"], "Hel\nlo\nWorld!".lines
assert_equal ["Hel\n", "lo\n", "World!\n"], "Hel\nlo\nWorld!\n".lines
@@ -681,8 +675,11 @@ assert('String#ord(UTF-8)') do
end if UTF8STRING
assert('String#chr') do
assert_equal "a", "abcde".chr
assert_equal "h", "hello!".chr
assert_equal "", "".chr
end
assert('String#chr(UTF-8)') do
assert_equal "", "こんにちは世界!".chr
end if UTF8STRING