зеркало из https://github.com/github/ruby.git
Add test for String#ord
* test/ruby/test_string.rb (test_ord): Add test for String#ord. [Fix GH-1181] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53384 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
6fd18ca51b
Коммит
f880d5dcd2
|
@ -1,3 +1,8 @@
|
|||
Wed Dec 30 16:43:23 2015 Kuniaki IGARASHI <igaiga@gmail.com>
|
||||
|
||||
* test/ruby/test_string.rb (test_ord): Add test for String#ord.
|
||||
[Fix GH-1181]
|
||||
|
||||
Wed Dec 30 11:28:57 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* lib/forwardable.rb (def_instance_delegator): adjust backtrace of
|
||||
|
|
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче