From 73f72eeec2d0cc689735f52de4a5c3c80c4c1e85 Mon Sep 17 00:00:00 2001 From: Michael Koziarski Date: Sun, 5 Aug 2007 00:51:16 +0000 Subject: Make the utf-handler return the correct value for non-matching regular expressions. Closes #9049 [manfred] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7273 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activesupport/test/multibyte_chars_test.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'activesupport/test/multibyte_chars_test.rb') diff --git a/activesupport/test/multibyte_chars_test.rb b/activesupport/test/multibyte_chars_test.rb index d8766af3b8..6e87ea8851 100644 --- a/activesupport/test/multibyte_chars_test.rb +++ b/activesupport/test/multibyte_chars_test.rb @@ -81,6 +81,8 @@ class CharsTest < Test::Unit::TestCase with_kcode('UTF8') do assert_equal 9, (@s[:utf8].chars =~ /ffi/), "Regex matching should be unicode aware" + assert_nil((''.chars =~ /\d+/), + "Non-matching regular expressions should return nil") end end @@ -118,7 +120,7 @@ class CharsTest < Test::Unit::TestCase def test_passthrough_on_kcode # The easiest way to check if the passthrough is in place is through #size - with_kcode('nonce') do + with_kcode('none') do assert_equal 26, @s[:utf8].chars.size end with_kcode('UTF8') do -- cgit v1.2.3