Some metacharacters(\k, \g, \p, \P) crashed on some invalid examples
- 
valid examples not crashed
 - 
invalid examples show warnings on YARV
 
ruby 1.9.3p448 (2013-06-27 revision 41675) [i686-linux]
>  ~  ruby -e '/\k/'
| # https://twitter.com/yuroyoro/status/365050923237638144 | |
| class Array | |
| def ^(other) | |
| (self | other) - (self & other) | |
| end | |
| end | |
| [1, 2, 3] ^ [3, 4] #=> [1, 2, 4] | 
| # https://github.com/rubinius/rubinius/blob/7866fbd80db7fe6e1de2627f5442c8abe6ce51ad/kernel/common/enumerable.rb#L113 | |
| # https://github.com/rubinius/rubinius/blob/7866fbd80db7fe6e1de2627f5442c8abe6ce51ad/kernel/common/enumerable.rb#L428 | |
| class Foo | |
| def each | |
| yield false | |
| yield nil | |
| end | |
| end | 
| class Time | |
| def jason? | |
| day == 13 && friday? | |
| end | |
| end | 
Some metacharacters(\k, \g, \p, \P) crashed on some invalid examples
valid examples not crashed
invalid examples show warnings on YARV
ruby 1.9.3p448 (2013-06-27 revision 41675) [i686-linux]
>  ~  ruby -e '/\k/'
| #!/usr/local/env ruby | |
| # coding: us-ascii | |
| # RLEs in Ruby | |
| # Tested Ruby 2.0 | |
| # 2013 - Kenichi Kamiya | |
| $VERBOSE = true | |
| example = 'AABBCCC'.freeze #from http://d.hatena.ne.jp/notogawa/20121201/1354389374 | 
Uninitialized regexp crashes on some methods
MRI
uninitialized = Regexp.allocate
uninitialized.options #=> in `options': uninitialized Regexp (TypeError)| # coding: us-ascii | |
| # webricksample base from: http://doc.ruby-lang.org/ja/2.0.0/library/webrick.html | |
| $VERBOSE = true | |
| require 'webrick' | |
| srv = WEBrick::HTTPServer.new({ :DocumentRoot => './', | |
| :BindAddress => '127.0.0.1', | |
| :Port => 20080}) | |
| srv.mount('/view.cgi', WEBrick::HTTPServlet::CGIHandler, 'view.rb') | 
| # I've written at this commit. | |
| # https://github.com/KitaitiMakoto/pathname-common_prefix/commit/904420faed7f73a758a35eafa74151fd7724918f | |
| class Pathname | |
| def start_with?(other) | |
| to_enum(:descend).include?(Pathname(other)) | |
| end | |
| end |