Commit bc3176da authored by KOBAYASHI Shuji's avatar KOBAYASHI Shuji

Use `__ENCODING__` in tests

It cannot be used for `String#size` test if judging whether or not `MRB_UTF8_STRING` is defined by result of `String#size`.
parent dc03bea8
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
## ##
# String(Ext) Test # String(Ext) Test
UTF8STRING = ("\343\201\202".size == 1) UTF8STRING = __ENCODING__ == "UTF-8"
assert('String#getbyte') do assert('String#getbyte') do
str1 = "hello" str1 = "hello"
......
...@@ -14,7 +14,7 @@ end ...@@ -14,7 +14,7 @@ end
assert("Symbol##{n}") do assert("Symbol##{n}") do
assert_equal 5, :hello.__send__(n) assert_equal 5, :hello.__send__(n)
assert_equal 4, :"aA\0b".__send__(n) assert_equal 4, :"aA\0b".__send__(n)
if "あ".size == 1 # enable MRB_UTF8_STRING? if __ENCODING__ == "UTF-8"
assert_equal 8, :"こんにちは世界!".__send__(n) assert_equal 8, :"こんにちは世界!".__send__(n)
assert_equal 4, :"aあ\0b".__send__(n) assert_equal 4, :"aあ\0b".__send__(n)
else else
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
## ##
# String ISO Test # String ISO Test
UTF8STRING = ("\343\201\202".size == 1) UTF8STRING = __ENCODING__ == "UTF-8"
assert('String', '15.2.10') do assert('String', '15.2.10') do
assert_equal Class, String.class assert_equal Class, String.class
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment