mirror of
https://github.com/zhigang1992/RubyMotion.git
synced 2026-04-24 04:46:05 +08:00
update TestUnit
This commit is contained in:
@@ -1356,8 +1356,8 @@ class TestM17N < Test::Unit::TestCase
|
||||
def test_force_encoding
|
||||
assert(("".center(1, "\x80".force_encoding("utf-8")); true),
|
||||
"moved from btest/knownbug, [ruby-dev:33807]")
|
||||
# a = "".force_encoding("ascii-8bit") << 0xC3 << 0xB6
|
||||
# assert_equal(1, a.force_encoding("utf-8").size, '[ruby-core:22437]')
|
||||
a = "".force_encoding("ascii-8bit") << 0xC3 << 0xB6
|
||||
assert_equal(1, a.force_encoding("utf-8").size, '[ruby-core:22437]')
|
||||
b = "".force_encoding("ascii-8bit") << 0xC3.chr << 0xB6.chr
|
||||
assert_equal(1, b.force_encoding("utf-8").size, '[ruby-core:22437]')
|
||||
end
|
||||
|
||||
@@ -334,22 +334,22 @@ class TestM17NComb < Test::Unit::TestCase
|
||||
}
|
||||
end
|
||||
|
||||
# def test_str_concat
|
||||
# combination(STRINGS, STRINGS) {|s1, s2|
|
||||
# s = s1.dup
|
||||
# if s1.ascii_only? || s2.ascii_only? || s1.encoding == s2.encoding
|
||||
# s << s2
|
||||
# assert(s.valid_encoding?) if s1.valid_encoding? && s2.valid_encoding?
|
||||
# assert_equal(a(s), a(s1) + a(s2))
|
||||
# assert_str_enc_propagation(s, s1, s2)
|
||||
# else
|
||||
# assert_raise(Encoding::CompatibilityError) { s << s2 }
|
||||
# end
|
||||
# }
|
||||
def test_str_concat
|
||||
combination(STRINGS, STRINGS) {|s1, s2|
|
||||
s = s1.dup
|
||||
if s1.ascii_only? || s2.ascii_only? || s1.encoding == s2.encoding
|
||||
s << s2
|
||||
assert(s.valid_encoding?) if s1.valid_encoding? && s2.valid_encoding?
|
||||
assert_equal(a(s), a(s1) + a(s2))
|
||||
assert_str_enc_propagation(s, s1, s2)
|
||||
else
|
||||
assert_raise(Encoding::CompatibilityError) { s << s2 }
|
||||
end
|
||||
}
|
||||
|
||||
# assert_equal("A\x84\x31\xA4\x39".force_encoding("GB18030"),
|
||||
# "A".force_encoding("GB18030") << 0x8431A439)
|
||||
# end
|
||||
# assert_equal("A\x84\x31\xA4\x39".force_encoding("GB18030"),
|
||||
# "A".force_encoding("GB18030") << 0x8431A439)
|
||||
end
|
||||
|
||||
# def test_str_aref
|
||||
# STRINGS.each {|s|
|
||||
|
||||
@@ -243,7 +243,7 @@ class TestModule < Test::Unit::TestCase
|
||||
end
|
||||
assert_equal("foo", Other.class_eval_test)
|
||||
|
||||
# assert_equal([Other], Other.class_eval { |*args| args })
|
||||
assert_equal([Other], Other.class_eval { |*args| args })
|
||||
end
|
||||
|
||||
def test_const_defined?
|
||||
|
||||
Reference in New Issue
Block a user