Bug #4381 ยป test_string.rb.aset_encoding.patch
| test/ruby/test_string.rb (working copy) | ||
|---|---|---|
|
assert_raise(ArgumentError) { "foo"[1, 2, 3] = "" }
|
||
|
end
|
||
|
def test_ASET_encoding
|
||
|
a = S("a")
|
||
|
a.force_encoding Encoding::US_ASCII
|
||
|
r = S("")
|
||
|
r.force_encoding Encoding::UTF_8
|
||
|
a[/a/] = r
|
||
|
assert_equal Encoding::US_ASCII, a.encoding
|
||
|
end
|
||
|
def test_CMP # '<=>'
|
||
|
assert_equal(1, S("abcdef") <=> S("abcde"))
|
||
|
assert_equal(0, S("abcdef") <=> S("abcdef"))
|
||