summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorKOBAYASHI Shuji <[email protected]>2019-01-22 19:37:14 +0900
committerKOBAYASHI Shuji <[email protected]>2019-01-22 19:37:14 +0900
commit6d5a62cf5fc8b2e34c86042db9362aa81206fb81 (patch)
tree53767b60a844bf6904e2658b22c0b83943e7627b
parentb83e4df43dea43e5ded33a6efa3e3f679d444d8c (diff)
downloadmruby-6d5a62cf5fc8b2e34c86042db9362aa81206fb81.tar.gz
mruby-6d5a62cf5fc8b2e34c86042db9362aa81206fb81.zip
Fix tests for `String#reverse` with `MRB_UTF8_STRING`
-rw-r--r--test/t/string.rb11
1 files changed, 5 insertions, 6 deletions
diff --git a/test/t/string.rb b/test/t/string.rb
index e0f0eb99c..7f81c9335 100644
--- a/test/t/string.rb
+++ b/test/t/string.rb
@@ -464,12 +464,11 @@ assert('String#reverse', '15.2.10.5.29') do
end
assert('String#reverse(UTF-8)', '15.2.10.5.29') do
- assert_equal "ち", "こんにちは世界"[3]
- assert_equal nil, "こんにちは世界"[20]
- assert_equal "世", "こんにちは世界"[-2]
- assert_equal "世界", "こんにちは世界"[-2..-1]
- assert_equal "んに", "こんにちは世界"[1,2]
- assert_equal "世", "こんにちは世界"["世"]
+ a = 'こんにちは世界!'
+ a.reverse
+
+ assert_equal 'こんにちは世界!', a
+ assert_equal '!界世はちにんこ', 'こんにちは世界!'.reverse
end if UTF8STRING
assert('String#reverse!', '15.2.10.5.30') do