summaryrefslogtreecommitdiff
path: root/test/ruby/test_regexp.rb
AgeCommit message (Collapse)Author
2014-03-27re.c: class name encodingnobu
* re.c (match_inspect): preserve class name encoding by PRIsVALUE. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45449 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-13test/ruby: better assertionsnobu
* test/ruby: use better assertions instead of mere assert. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44173 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-09test/unit/assertions.rb: return exceptionnobu
* lib/test/unit/assertions.rb (assert_raise_with_message): return raised exception same as assert_raise. * test/ruby, test/-ext-: use assert_raise_with_message. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43212 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-01test_regexp.rb, test_string.rb: suppress warningsnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43105 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-01test_regexp.rb, test_string.rb: use assert_separatelynobu
* test/ruby/test_regexp.rb (test_eq_tilde_can_be_overridden): use assert_separately to suppress a warning. * test/ruby/test_string.rb (test_eq_tilde_can_be_overridden): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43104 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-01test_regexp.rb, test_string.rb: suppress warningsnobu
* test/ruby/test_regexp.rb (test_eq_tilde_can_be_overridden): suppress a warning. * test/ruby/test_string.rb (test_eq_tilde_can_be_overridden): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43101 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-26* insns.def (opt_regexpmatch1): check Regexp#=~ is not defined beforecharliesome
calling rb_reg_match() * test/ruby/test_regexp.rb: add test * vm.c (ruby_vm_redefined_flag): change type to short[] * vm.c (vm_redefinition_check_flag): return REGEXP_REDEFINED_OP_FLAG if klass == rb_cRegexp * vm.c (vm_init_redefined_flag): setup BOP flag for Regexp#=~ * vm_insnhelper.h: add REGEXP_REDEFINED_OP_FLAG [ruby-core:57385] [Bug #8953] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43050 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-04string.c: fix for \Knobu
* string.c (str_gsub): use BEG(0) for whole matched position not return value from rb_reg_search(), for \K matching. [ruby-dev:47694] [Bug #8856] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42820 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-20* insns.def: fix regexp's once option behavior.ko1
fix [ruby-trunk - Bug #6701] * insns.def: remove `onceinlinecache' and introduce `once' instruction. `once' doesn't use `setinlinecache' insn any more. * vm_core.h: `union iseq_inline_storage_entry' to store once data. * compile.c: catch up above changes. * iseq.c: ditto. * vm.c, vm_insnhelper.c: ditto. fix `m_core_set_postexe()' which is depend on `onceinlinecache' insn. * test/ruby/test_regexp.rb: add tests. * iseq.c: ISEQ_MINOR_VERSION to 1 (should increment major?) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42637 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-25* re.c (rb_reg_to_s): convert closing parenthes to the target encodingnaruse
if it is ASCII incompatible encoding. [ruby-core:56063] [Bug #8650] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42167 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-05* test/ruby/test_regexp.rbknu
(TestRegexp#test_options_in_look_behind) (TestRegexp#assert_match_at): Parse regexps in run time rather than in compile time. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41793 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-05* test/ruby/test_regexp.rbknu
(TestRegexp#test_options_in_look_behind) (TestRegexp#assert_match_at): Add tests for another problem fixed in Onigmo 5.13.5. Previously Onigmo did not allow option enclosures in look-behind, which makes it impossible to interpolate a regexp into another in the middle of a look-behind pattern. cf. https://github.com/k-takata/Onigmo/pull/17 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41792 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-04test_regexp.rb: test for conditional expressionnobu
* test/ruby/test_regexp.rb (TestRegexp#test_conditional_expression): test for [Bug #8583] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41767 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-12* safe.c (rb_set_safe_level, safe_setter): raise an ArgumentErrorshugo
when $SAFE is set to 4. $SAFE=4 is now obsolete. [ruby-core:55222] [Feature #8468] * object.c (rb_obj_untrusted, rb_obj_untrust, rb_obj_trust): Kernel#untrusted?, untrust, and trust are now deprecated. Their behavior is same as tainted?, taint, and untaint, respectively. * include/ruby/ruby.h (OBJ_UNTRUSTED, OBJ_UNTRUST): OBJ_UNTRUSTED() and OBJ_UNTRUST() are aliases of OBJ_TAINTED() and OBJ_TAINT(), respectively. * array.c, class.c, debug.c, dir.c, encoding.c, error.c, eval.c, ext/curses/curses.c, ext/dbm/dbm.c, ext/dl/cfunc.c, ext/dl/cptr.c, ext/dl/dl.c, ext/etc/etc.c, ext/fiddle/fiddle.c, ext/fiddle/pointer.c, ext/gdbm/gdbm.c, ext/readline/readline.c, ext/sdbm/init.c, ext/socket/ancdata.c, ext/socket/basicsocket.c, ext/socket/socket.c, ext/socket/udpsocket.c, ext/stringio/stringio.c, ext/syslog/syslog.c, ext/tk/tcltklib.c, ext/win32ole/win32ole.c, file.c, gc.c, hash.c, io.c, iseq.c, load.c, marshal.c, object.c, proc.c, process.c, random.c, re.c, safe.c, string.c, thread.c, transcode.c, variable.c, vm_insnhelper.c, vm_method.c, vm_trace.c: remove code for $SAFE=4. * test/dl/test_dl2.rb, test/erb/test_erb.rb, test/readline/test_readline.rb, test/readline/test_readline_history.rb, test/ruby/test_alias.rb, test/ruby/test_array.rb, test/ruby/test_dir.rb, test/ruby/test_encoding.rb, test/ruby/test_env.rb, test/ruby/test_eval.rb, test/ruby/test_exception.rb, test/ruby/test_file_exhaustive.rb, test/ruby/test_hash.rb, test/ruby/test_io.rb, test/ruby/test_method.rb, test/ruby/test_module.rb, test/ruby/test_object.rb, test/ruby/test_pack.rb, test/ruby/test_rand.rb, test/ruby/test_regexp.rb, test/ruby/test_settracefunc.rb, test/ruby/test_struct.rb, test/ruby/test_thread.rb, test/ruby/test_time.rb: remove tests for $SAFE=4. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41259 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-11* test/ruby/test_regexp.rb: use require_relative to require local libraryxibbar
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40241 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-02* re.c (rb_reg_to_s): suppress duplicated charclass warning.naruse
Regexp#to_s suppress extra its whole regexp options by calling onig_new with its source, but it doesn't call rb_reg_preprocess. Therefore its Unicode escapes (\u{XXXX}) are given as is, and it may cause duplicated charclass warning for example "[\u{33}]" (3 is duplicated) or "[\u{a}\u{b}]" (u is duplicated). [ruby-core:53649] [Bug #8151] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40063 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-03-30* test/ruby/test_class.rb: Simplify warning checksmarcandre
* test/ruby/test_io.rb: ditto * test/ruby/test_module.rb: ditto * test/ruby/test_regexp.rb: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40005 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-03-21parse.y: escape all closing parensnobu
* parse.y (simple_re_meta): escape all closing characters, not only round parenthesis. [ruby-core:53578] [Bug #8133] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39858 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-29* re.c (reg_operand): Simplify and reuse error handling [Bug #7539]marcandre
* test/ruby/test_regexp.rb: Test for above git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38980 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-13* regparse.c (add_ctype_to_cc): don't check dup warn on addingnaruse
negative ctype to cclass. [Bug #7471] [ruby-core:50344] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38805 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-30parse.y: escaped closing parenthsisnobu
* parse.y (simple_re_meta): escaped closing parenthsis has different meaning. [Bug #7610] [ruby-core:51088] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38663 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-24Fix tests of rb_warning().knu
* test/ruby/envutil.rb (Test::Unit::Assertions#assert_warning) (Test::Unit::Assertions#assert_warn), test/ruby/envutil.rb, test/ruby/test_enumerator.rb, test/ruby/test_io_m17n.rb, test/ruby/test_regexp.rb, test/ruby/test_syntax.rb: assert_warn() and assert_warning() are reversed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37836 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-06* ruby.c (load_file_internal): set default source encoding asnaruse
UTF-8 instead of US-ASCII. [ruby-core:46021] [Feature #6679] * parse.y (parser_initialize): set default parser encoding as UTF-8 instead of US-ASCII. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37485 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-16* test/ruby/test_regexp.rbusa
(TextRegexp#test_raw_hyphen_and_tk_char_type_after_range): use Regexp.new instead of literal to ignore a parser warning. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37202 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-16* test/ruby/test_regexp.rbusa
(TextRegexp#test_raw_hyphen_and_tk_char_type_after_range): ignoring warnings are already set in setup method. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37201 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-13* regparse.c (parse_char_class): should match with a hyphen after ausa
range in a character class. * test/ruby/test_regexp.rb (TestRegexp#test_char_class): fixed wrong test. * test/ruby/test_regexp.rb (TestRegexp#check): now can accept the error message. * test/ruby/test_regexp.rb (TextRegexp#test_raw_hyphen_and_tk_char_type_after_range): renamed because the previous name was wrong. * test/ruby/test_regexp.rb (TextRegexp#test_raw_hyphen_and_tk_char_type_after_range): added more test pattern. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37175 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-12* test/ruby/test_regexp.rbusa
(TestRegexp#test_raw_hyphen_and_type_char_after_range): added new test. ref [ruby-core:47115] [Backport #6853] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37171 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-06* parse.y (parser_tokadd_string): escape simple regexp metanobu
character termninators. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34929 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-05fix typoskazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34909 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-04* parse.y (parser_tokadd_string): regexp engine doesn't neednobu
terminators to be escaped. [ruby-core:40364][Bug #5484] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34896 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-26* regparse.c (add_code_range_to_buf0): wrong condition of duplicatednaruse
warnings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34821 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-01-08* numeric.c (rb_enc_uint_char): raise RangeError when added codepointnaruse
is invalid. [Feature #5855] [Bug #5863] [Bug #5864] * string.c (rb_str_concat): ditto. * string.c (rb_str_concat): set encoding as ASCII-8BIT when the string is US-ASCII and the argument is an integer greater than 127. * regenc.c (onigenc_mb2_code_to_mbclen): rearrange error code. * enc/euc_jp.c (code_to_mbclen): ditto. * enc/shift_jis.c (code_to_mbclen): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34236 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-01-07Add test for word boundary.naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34228 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-02-02* re.c (Init_Regexp): added a constant for ARG_ENCODING_NONEtenderlove
[ruby-core:35054] * test/ruby/test_regexp.rb: corresponding test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30765 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-11-26* regcomp.c (setup_tree): restart setup_tree() for a node whosenaruse
AnchorNode's type is ANCHOR_PREC_BEHIND or ANCHOR_PREC_BEHIND_NOT and divide_look_behind_alternatives() divided it to NT_ALT or NT_LIST. [ruby-core:33370] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29939 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-11-19Remove a test for reverted feature r26701.naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29831 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-11-08* tool/enc-unicode.rb,naruse
enc/unicode/name2ctype.h, enc/unicode/name2ctype.h.blt, enc/unicode/name2ctype.kwd, enc/unicode/name2ctype.src: Add Age property to regexp. [ruby-core:33019] patched by Ammar Ali, tested by Run Paint Run Run git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29717 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-08-17* regcomp.c: revert r26701; it introduces Bug #3681.naruse
[ruby-core:31677] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29023 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-08-08* parse.y (parser_tokadd_escape): no similar messages twice.nobu
[ruby-core:31048] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28917 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-22* re.c (rb_reg_expr_str): fix broken Regexp#inspect when itnaruse
is ASCII-8BIT and non-ASCII character. The length of character should be from original byte string. [ruby-core:31431] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28715 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-15* regexec.c (onig_search): don't skip non-ANYCHARs whennaruse
.* fails to match. This causes to fail matching ANYCHAR_STAR with LOOK_BEHIND. This fix is workaround and disable the optimization. [ruby-dev:41851] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28648 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-23* test/ruby/test_regexp.rb (test_dup_warn): read in UTF-8nobu
encoding regardless environment. * test/ruby/envutil.rb (invoke_ruby): add encoding option. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28397 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-16* test/ruby/test_{regexp,rubyoptions}.rb: trivial change.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28338 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-15Refix test_regexp.naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28328 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-15Refix for test_dup_warn.naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28326 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-13retry to fix test.naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28313 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-13try to fix test for boron.naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28311 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-05* re.c (rb_reg_expr_str): ASCII incompatible stringsnaruse
must always escape or converted. * re.c (rb_reg_expr_str): use rb_str_buf_cat_escaped_char when resenc is given: for Regexp#inspect or error message. * re.c (rb_reg_desc): add 'n' for ENCODING_NONE. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28177 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-31* regparse.c (onig_syntax_warn): do not use external strings asnobu
printf format. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28108 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-25* regparse.c (add_code_range_to_buf0): fix false negativenaruse
warning when given range is just before previous range. [ruby-dev:41406] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28013 b2dd03c8-39d4-4d8f-98ff-823fe69b080e