summaryrefslogtreecommitdiff
path: root/bootstraptest
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-12-09 00:31:02 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-12-09 00:31:02 +0000
commit56f8092459c4c5b6c5f263552bbd8db352eb72e9 (patch)
tree159b14780fc1a1fc77e097376cd6befe2c483353 /bootstraptest
parent78eae5da628492d64f582b577d401b3864b04f16 (diff)
more tests.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14145 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'bootstraptest')
-rw-r--r--bootstraptest/test_knownbug.rb58
1 files changed, 58 insertions, 0 deletions
diff --git a/bootstraptest/test_knownbug.rb b/bootstraptest/test_knownbug.rb
index 47c188a8dc..ec148ca39f 100644
--- a/bootstraptest/test_knownbug.rb
+++ b/bootstraptest/test_knownbug.rb
@@ -63,3 +63,61 @@ assert_equal 'ok', %q{
s1.casecmp(s2) == 0 ? :ng : :ok
}
+assert_equal 'EUC-JP', %q{ ("\xc2\xa1 %s".force_encoding("EUC-JP") % "foo").encoding.name }
+assert_equal 'true', %q{ "\xa1\xa2\xa3\xa4".force_encoding("euc-jp")["\xa2\xa3".force_encoding("euc-jp")] == nil }
+assert_equal 'ok', %q{
+ s = "\xa3\xb0\xa3\xb1\xa3\xb2\xa3\xb3\xa3\xb4".force_encoding("euc-jp")
+ begin
+ s["\xb0\xa3"] = "foo"
+ :ng
+ rescue IndexError
+ :ok
+ end
+}
+
+assert_equal 'EUC-JP', %q{ "\xa3\xb0".force_encoding("EUC-JP").center(10).encoding.name }
+
+assert_equal 'ok', %q{
+ s = "\xa3\xb0\xa3\xb1\xa3\xb2\xa3\xb3\xa3\xb4".force_encoding("euc-jp")
+ begin
+ s.chomp("\xa3\xb4".force_encoding("shift_jis"))
+ :ng
+ rescue ArgumentError
+ :ok
+ end
+}
+
+assert_equal 'ok', %q{
+ s = "\xa3\xb0\xa3\xb1\xa3\xb2\xa3\xb3\xa3\xb4".force_encoding("euc-jp")
+ begin
+ s.count("\xa3\xb0".force_encoding("ascii-8bit"))
+ :ng
+ rescue ArgumentError
+ :ok
+ end
+}
+
+assert_equal 'ok', %q{
+ s = "\xa3\xb0\xa3\xb1\xa3\xb2\xa3\xb3\xa3\xb4".force_encoding("euc-jp")
+ begin
+ s.delete("\xa3\xb2".force_encoding("ascii-8bit"))
+ :ng
+ rescue ArgumentError
+ :ok
+ end
+}
+
+assert_equal 'ok', %q{
+ s = "\xa3\xb0\xa3\xb1\xa3\xb2\xa3\xb3\xa3\xb4".force_encoding("euc-jp")
+ begin
+ s.each_line("\xa3\xb1".force_encoding("ascii-8bit")) {|l| }
+ :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.gsub(/\xa3\xb1/e, "z") == "\xa3\xb0z\xa3\xb2\xa3\xb3\xa3\xb4".force_encoding("euc-jp")
+}