mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
21 lines
641 B
Ruby
21 lines
641 B
Ruby
|
# vim: set fileencoding=euc-jp
|
|||
|
|
|||
|
require "test/unit"
|
|||
|
|
|||
|
class TestEUC_JP < Test::Unit::TestCase
|
|||
|
def test_mbc_case_fold
|
|||
|
assert_match(/(<28><>)(a)\1\2/i, "<EFBFBD><EFBFBD>a<EFBFBD><EFBFBD>A")
|
|||
|
assert_no_match(/(<28><>)(a)\1\2/i, "<EFBFBD><EFBFBD>a<EFBFBD><EFBFBD>A")
|
|||
|
end
|
|||
|
|
|||
|
def test_property
|
|||
|
assert_match(/<EFBFBD><EFBFBD>{0}\p{Hiragana}{4}/, "<EFBFBD>Ҥ餬<EFBFBD><EFBFBD>")
|
|||
|
assert_no_match(/<EFBFBD><EFBFBD>{0}\p{Hiragana}{4}/, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>")
|
|||
|
assert_no_match(/<EFBFBD><EFBFBD>{0}\p{Hiragana}{4}/, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>")
|
|||
|
assert_no_match(/<EFBFBD><EFBFBD>{0}\p{Katakana}{4}/, "<EFBFBD>Ҥ餬<EFBFBD><EFBFBD>")
|
|||
|
assert_match(/<EFBFBD><EFBFBD>{0}\p{Katakana}{4}/, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>")
|
|||
|
assert_no_match(/<EFBFBD><EFBFBD>{0}\p{Katakana}{4}/, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>")
|
|||
|
assert_raise(RegexpError) { Regexp.new('<27><>{0}\p{foobarbaz}') }
|
|||
|
end
|
|||
|
end
|