2004-10-29 18:45:13 -04:00
|
|
|
require 'test/unit'
|
|
|
|
|
|
|
|
class TestRegexp < Test::Unit::TestCase
|
2004-10-29 19:22:57 -04:00
|
|
|
def test_ruby_dev_24643
|
2004-10-29 18:45:13 -04:00
|
|
|
assert_nothing_raised("[ruby-dev:24643]") { /(?:(?:[a]*[a])?b)*a*$/ =~ "aabaaca" }
|
|
|
|
end
|
2004-10-29 19:22:57 -04:00
|
|
|
|
|
|
|
def test_ruby_talk_116455
|
|
|
|
assert_match(/^(\w{2,}).* ([A-Za-z\xa2\xc0-\xff]{2,}?)$/, "Hallo Welt")
|
|
|
|
end
|
2004-11-27 22:07:48 -05:00
|
|
|
|
|
|
|
def test_ruby_dev_24887
|
|
|
|
assert_equal("a".gsub(/a\Z/, ""), "")
|
|
|
|
end
|
2004-11-27 22:09:13 -05:00
|
|
|
|
|
|
|
def test_yoshidam_net_20041111_1
|
|
|
|
s = "[\xC2\xA0-\xC3\xBE]"
|
|
|
|
assert_match(Regexp.new(s, nil, "u"), "\xC3\xBE")
|
|
|
|
end
|
|
|
|
|
|
|
|
def test_yoshidam_net_20041111_2
|
|
|
|
assert_raise(RegexpError) do
|
|
|
|
s = "[\xFF-\xFF]"
|
|
|
|
Regexp.new(s, nil, "u")
|
|
|
|
end
|
|
|
|
end
|
2004-10-29 18:45:13 -04:00
|
|
|
end
|