summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_string.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/ruby/test_string.rb b/test/ruby/test_string.rb
index 00e1f5f8ff..72fca75b29 100644
--- a/test/ruby/test_string.rb
+++ b/test/ruby/test_string.rb
@@ -2342,6 +2342,13 @@ class TestString < Test::Unit::TestCase
assert_not_equal(str.object_id, (+str).object_id)
assert_equal(str.object_id, (-str).object_id)
end
+
+ def test_ord
+ assert_equal(97, "a".ord)
+ assert_equal(97, "abc".ord)
+ assert_equal(0x3042, "\u3042\u3043".ord)
+ assert_raise(ArgumentError) { "".ord }
+ end
end
class TestString2 < TestString