blob: d61ece351d091687e200bce369008d41f3e36244 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
##
# String(Ext) Test
assert('String#getbyte') do
str1 = "hello"
bytes1 = [104, 101, 108, 108, 111]
assert_equal bytes1[0], str1.getbyte(0)
assert_equal bytes1[-1], str1.getbyte(-1)
assert_equal bytes1[6], str1.getbyte(6)
str2 = "\xFF"
bytes2 = [0xFF]
assert_equal bytes2[0], str2.getbyte(0)
end
assert('String#dump') do
"foo".dump == "\"foo\""
end
|