mirror of
https://github.com/ruby/ruby.git
synced 2025-09-22 03:53:58 +02:00
String#unpack1 [Feature #12752]
Returns the first value of String#unpack. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56959 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
b6e137e93c
commit
306f43acfe
3 changed files with 164 additions and 125 deletions
|
@ -837,4 +837,11 @@ EXPECTED
|
|||
|
||||
assert_equal addr, [buf].pack('p')
|
||||
end
|
||||
|
||||
def test_unpack1
|
||||
assert_equal 65, "A".unpack1("C")
|
||||
assert_equal 68, "ABCD".unpack1("x3C")
|
||||
assert_equal 0x3042, "\u{3042 3044 3046}".unpack1("U*")
|
||||
assert_equal "hogefuga", "aG9nZWZ1Z2E=".unpack1("m")
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue