Project

General

Profile

Bug #4381 ยป test_string.rb.aset_encoding.patch

Test to illustrate encoding changing - drbrain (Eric Hodel), 02/08/2011 05:11 AM

View differences:

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"))
    (1-1/1)