summaryrefslogtreecommitdiff
path: root/test/ruby/test_regexp.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_regexp.rb')
-rw-r--r--test/ruby/test_regexp.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/ruby/test_regexp.rb b/test/ruby/test_regexp.rb
index 2b10620d6c..9cb8c4ac1e 100644
--- a/test/ruby/test_regexp.rb
+++ b/test/ruby/test_regexp.rb
@@ -37,4 +37,16 @@ class TestRegexp < Test::Unit::TestCase
def test_to_s
assert_equal '(?-mix:\000)', Regexp.new("\0").to_s
end
+
+ def test_union
+ assert_equal :ok, begin
+ Regexp.union(
+ "a",
+ Regexp.new("\x80".force_encoding("euc-jp")),
+ Regexp.new("\x80".force_encoding("utf-8")))
+ :ng
+ rescue ArgumentError
+ :ok
+ end
+ end
end