mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
add a test.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15403 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
f3d18d8c4c
commit
d55c77f565
1 changed files with 7 additions and 1 deletions
|
@ -864,7 +864,7 @@ class TestM17N < Test::Unit::TestCase
|
||||||
assert_equal(["a"], e("\xa1\xa2a\xa3\xa4").scan(/a/))
|
assert_equal(["a"], e("\xa1\xa2a\xa3\xa4").scan(/a/))
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_scan_dup
|
def test_dup_scan
|
||||||
s1 = e("\xa4\xa2")*100
|
s1 = e("\xa4\xa2")*100
|
||||||
s2 = s1.dup.force_encoding("ascii-8bit")
|
s2 = s1.dup.force_encoding("ascii-8bit")
|
||||||
s2.scan(/\A./n) {|f|
|
s2.scan(/\A./n) {|f|
|
||||||
|
@ -872,6 +872,12 @@ class TestM17N < Test::Unit::TestCase
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_dup_aref
|
||||||
|
s1 = e("\xa4\xa2")*100
|
||||||
|
s2 = s1.dup.force_encoding("ascii-8bit")
|
||||||
|
assert_equal(Encoding::ASCII_8BIT, s2[10..-1].encoding)
|
||||||
|
end
|
||||||
|
|
||||||
def test_upto
|
def test_upto
|
||||||
s1 = e("\xa1\xa2")
|
s1 = e("\xa1\xa2")
|
||||||
s2 = s("\xa1\xa2")
|
s2 = s("\xa1\xa2")
|
||||||
|
|
Loading…
Reference in a new issue