From 1f97d48800a1bc4f4831036100857b491d36680c Mon Sep 17 00:00:00 2001 From: mame Date: Thu, 29 May 2008 16:00:49 +0000 Subject: [PATCH] * test/ruby/test_regexp.rb: add tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16687 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 4 ++++ test/ruby/test_regexp.rb | 26 ++++++++++++++++++++++++++ version.h | 6 +++--- 3 files changed, 33 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2dc39c5f9f..3e6148d726 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Fri May 30 00:59:47 2008 Yusuke Endoh + + * test/ruby/test_regexp.rb: add tests. + Thu May 29 22:51:05 2008 Yusuke Endoh * test/ruby/test_require.rb: add a test for load with wrap flag, to diff --git a/test/ruby/test_regexp.rb b/test/ruby/test_regexp.rb index 17fe9fa45f..9a56ca07c9 100644 --- a/test/ruby/test_regexp.rb +++ b/test/ruby/test_regexp.rb @@ -512,6 +512,17 @@ class TestRegexp < Test::Unit::TestCase check(/\A\a\z/, "\007") check(/\A\e\z/, "\033") check(/\A\v\z/, "\v") + failcheck('(') + failcheck('(?foo)') + end + + def test_parse_look_behind + check(/(?<=A)B(?=C)/, [%w(B ABC)], %w(aBC ABc aBc)) + check(/(?') check(/\A(?.)(?.)\k\z/, %w(aba abb), %w(abc .. ....)) check(/\k\g/, "kg") + failcheck('(.\g<1>)') + failcheck('(.\g<2>)') + failcheck('(?=\g<1>)') + failcheck('((?=\g<1>))') + failcheck('(\g<1>|.)') + failcheck('(.|\g<1>)') + check(/A*B/, %w(B AB AAB AAAB), %w(A)) + check(/\w*!/, %w(! a! ab! abc!), %w(abc)) + check(/\w*\W/, %w(! a" ab# abc$), %w(abc)) + check(/\w*\w/, %w(z az abz abcz), %w(!)) + check(/[a-z]*\w/, %w(z az abz abcz), %w(!)) + check(/[a-z]*\W/, %w(! a" ab# abc$), %w(A)) + check(/(!)(?<=(a)|\g<1>)/, ["!"], %w(a)) + check(/((a|bb|ccc|dddd)(1|22|333|4444))/i, %w(a1 bb1 a22), %w(a2 b1)) end def test_parse_curly_brace @@ -595,6 +620,7 @@ class TestRegexp < Test::Unit::TestCase check(/\A[a-f&&[^b-c]&&[^e]]\z/, %w(a d f), %w(b c e g 0)) check(/\A[[^b-c]&&[^e]&&a-f]\z/, %w(a d f), %w(b c e g 0)) check(/\A[\n\r\t]\z/, ["\n", "\r", "\t"]) + failcheck('[9-1]') end def test_posix_bracket diff --git a/version.h b/version.h index a0454b91e7..dddda0bf31 100644 --- a/version.h +++ b/version.h @@ -1,7 +1,7 @@ #define RUBY_VERSION "1.9.0" -#define RUBY_RELEASE_DATE "2008-05-28" +#define RUBY_RELEASE_DATE "2008-05-30" #define RUBY_VERSION_CODE 190 -#define RUBY_RELEASE_CODE 20080528 +#define RUBY_RELEASE_CODE 20080530 #define RUBY_PATCHLEVEL 0 #define RUBY_VERSION_MAJOR 1 @@ -9,7 +9,7 @@ #define RUBY_VERSION_TEENY 0 #define RUBY_RELEASE_YEAR 2008 #define RUBY_RELEASE_MONTH 5 -#define RUBY_RELEASE_DAY 28 +#define RUBY_RELEASE_DAY 30 #ifdef RUBY_EXTERN RUBY_EXTERN const char ruby_version[];