diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-12-09 00:56:10 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-12-09 00:56:10 +0000 |
commit | be98b422b086ecd51da282e29f7f002970f767a4 (patch) | |
tree | b37881bcdfdda1fea098c3460bcff935ea6e8fa0 | |
parent | 56f8092459c4c5b6c5f263552bbd8db352eb72e9 (diff) | |
download | ruby-be98b422b086ecd51da282e29f7f002970f767a4.tar.gz |
more tests.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14146 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | bootstraptest/test_knownbug.rb | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/bootstraptest/test_knownbug.rb b/bootstraptest/test_knownbug.rb index ec148ca39f..cbe83a6365 100644 --- a/bootstraptest/test_knownbug.rb +++ b/bootstraptest/test_knownbug.rb @@ -121,3 +121,52 @@ assert_equal 'true', %q{ s = "\xa3\xb0\xa3\xb1\xa3\xb2\xa3\xb3\xa3\xb4".force_encoding("euc-jp") s.gsub(/\xa3\xb1/e, "z") == "\xa3\xb0z\xa3\xb2\xa3\xb3\xa3\xb4".force_encoding("euc-jp") } + +assert_equal 'false', %q{ + s = "\xa3\xb0\xa3\xb1\xa3\xb2\xa3\xb3\xa3\xb4".force_encoding("euc-jp") + s.include?("\xb0\xa3".force_encoding("euc-jp")) +} + +assert_equal 'nil', %q{ + s = "\xa3\xb0\xa3\xb1\xa3\xb2\xa3\xb3\xa3\xb4".force_encoding("euc-jp") + s.index("\xb3\xa3".force_encoding("euc-jp")) +} + +assert_equal 'ok', %q{ + s = "\xa3\xb0\xa3\xb1\xa3\xb2\xa3\xb3\xa3\xb4".force_encoding("euc-jp") + s.insert(-1, "a") + :ok +} + +assert_finish 1, %q{ "\xa3\xfe".force_encoding("euc-jp").next } + +assert_equal 'ok', %q{ + s = "\xa3\xb0\xa3\xb1\xa3\xb2\xa3\xb3\xa3\xb4".force_encoding("euc-jp") + begin + s.rindex("\xb1\xa3".force_encoding("ascii-8bit")) + :ng + rescue ArgumentError + :ok + end +} + +assert_equal 'true', %q{ + s = "\xa3\xb0\xa3\xb1\xa3\xb2\xa3\xb3\xa3\xb4".force_encoding("euc-jp") + s.split("\xa3\xb1".force_encoding("euc-jp")) == [ + "\xa3\xb0".force_encoding("euc-jp") + "\xa3\xb2\xa3\xb3\xa3\xb4".force_encoding("euc-jp") + ] +} + +assert_equal 'true', %q{ + s = "\xa3\xb0\xa3\xb1\xa3\xb1\xa3\xb3\xa3\xb4".force_encoding("euc-jp") + s.squeeze == "\xa3\xb0\xa3\xb1\xa3\xb3\xa3\xb4".force_encoding("euc-jp") +} + +assert_normal_exit %q{ + "\x81\x41".force_encoding("shift_jis").tr("A", "B") +} + +assert_normal_exit %q{ + "\x81\x41".force_encoding("shift_jis").tr_s("A", "B") +} |