mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
update tests for latest /.../n handling.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14466 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
0067dc24d8
commit
da8b4a5e41
1 changed files with 24 additions and 14 deletions
|
@ -224,12 +224,12 @@ class TestM17N < Test::Unit::TestCase
|
|||
}
|
||||
end
|
||||
|
||||
def test_regexp_ascii
|
||||
assert_regexp_fixed_ascii8bit(/a/n)
|
||||
assert_regexp_fixed_ascii8bit(/\xc2\xa1/n)
|
||||
assert_regexp_fixed_ascii8bit(eval(a(%{/\xc2\xa1/})))
|
||||
assert_regexp_fixed_ascii8bit(eval(a(%{/\xc2\xa1/n})))
|
||||
assert_regexp_fixed_ascii8bit(eval(a(%q{/\xc2\xa1/})))
|
||||
def test_regexp_ascii_none
|
||||
begin
|
||||
old_verbose = $VERBOSE
|
||||
$VERBOSE = nil
|
||||
|
||||
assert_regexp_generic_ascii(/a/n)
|
||||
|
||||
[/a/n].each {|r|
|
||||
assert_equal(0, r =~ a("a"))
|
||||
|
@ -237,10 +237,20 @@ class TestM17N < Test::Unit::TestCase
|
|||
assert_equal(0, r =~ s("a"))
|
||||
assert_equal(0, r =~ u("a"))
|
||||
assert_equal(nil, r =~ a("\xc2\xa1"))
|
||||
assert_raise(ArgumentError) { r =~ e("\xc2\xa1") }
|
||||
assert_raise(ArgumentError) { r =~ s("\xc2\xa1") }
|
||||
assert_raise(ArgumentError) { r =~ u("\xc2\xa1") }
|
||||
assert_equal(nil, r =~ e("\xc2\xa1"))
|
||||
assert_equal(nil, r =~ s("\xc2\xa1"))
|
||||
assert_equal(nil, r =~ u("\xc2\xa1"))
|
||||
}
|
||||
ensure
|
||||
$VERBOSE = old_verbose
|
||||
end
|
||||
end
|
||||
|
||||
def test_regexp_ascii
|
||||
assert_regexp_fixed_ascii8bit(/\xc2\xa1/n)
|
||||
assert_regexp_fixed_ascii8bit(eval(a(%{/\xc2\xa1/})))
|
||||
assert_regexp_fixed_ascii8bit(eval(a(%{/\xc2\xa1/n})))
|
||||
assert_regexp_fixed_ascii8bit(eval(a(%q{/\xc2\xa1/})))
|
||||
|
||||
[/\xc2\xa1/n, eval(a(%{/\xc2\xa1/})), eval(a(%{/\xc2\xa1/n}))].each {|r|
|
||||
assert_equal(nil, r =~ a("a"))
|
||||
|
@ -380,7 +390,7 @@ class TestM17N < Test::Unit::TestCase
|
|||
|
||||
def test_union_1_regexp
|
||||
assert_regexp_generic_ascii(Regexp.union(//))
|
||||
assert_regexp_fixed_ascii8bit(Regexp.union(//n))
|
||||
assert_regexp_generic_ascii(Regexp.union(//n))
|
||||
assert_regexp_fixed_eucjp(Regexp.union(//e))
|
||||
assert_regexp_fixed_sjis(Regexp.union(//s))
|
||||
assert_regexp_fixed_utf8(Regexp.union(//u))
|
||||
|
@ -421,7 +431,7 @@ class TestM17N < Test::Unit::TestCase
|
|||
end
|
||||
|
||||
def test_dynamic_ascii_regexp
|
||||
assert_regexp_fixed_ascii8bit(/#{}/n)
|
||||
assert_regexp_generic_ascii(/#{}/n)
|
||||
assert_regexp_fixed_ascii8bit(/#{}\xc2\xa1/n)
|
||||
assert_regexp_fixed_ascii8bit(/\xc2\xa1#{}/n)
|
||||
#assert_raise(SyntaxError) { s1, s2 = s('\xc2'), s('\xa1'); /#{s1}#{s2}/ }
|
||||
|
|
Loading…
Reference in a new issue