summaryrefslogtreecommitdiffstats
path: root/test/ruby
Commit message (Collapse)AuthorAgeFilesLines
* * string.c (tr_find): returns true if no characters to be removed isnobu2007-12-091-0/+5
| | | | | | | specified. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14151 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (tr_trans): get rid of segfaults when has mulitbytes butnobu2007-12-091-0/+6
| | | | | | | source sets have no mulitbytes. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14148 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * re.c (rb_reg_check_preprocess): new function for validating regexpakr2007-12-081-10/+25
| | | | | | | | | | | fragment. * parse.y (regexp): invoke reg_fragment_check. (reg_fragment_check): defined. (reg_fragment_check_gen): defined. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14133 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* add test for UTF-8 bit pattern.akr2007-12-081-0/+59
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14132 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * encoding.c (rb_enc_mbclen): make it never fail.akr2007-12-082-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (rb_enc_nth): don't check the return value of rb_enc_mbclen. (rb_enc_strlen): ditto. (rb_enc_precise_mbclen): return needmore(1) if e <= p. (rb_enc_get_ascii): new function for extracting ASCII character. * include/ruby/encoding.h (rb_enc_get_ascii): declared. * include/ruby/regex.h (ismbchar): removed. * re.c (rb_reg_expr_str): use rb_enc_get_ascii. (unescape_escaped_nonascii): use rb_enc_precise_mbclen to determine the termination of escaped non-ASCII character. (unescape_nonascii): use rb_enc_precise_mbclen. (rb_reg_quote): use rb_enc_get_ascii. (rb_reg_regsub): use rb_enc_get_ascii. * string.c (rb_str_reverse) don't check the return value of rb_enc_mbclen. (rb_str_split_m): don't call rb_enc_mbclen with e <= p. * parse.y (is_identchar): use ISASCII. (parser_ismbchar): removed. (parser_precise_mbclen): new macro. (parser_isascii): new macro. (parser_tokadd_mbchar): use parser_precise_mbclen to check invalid character precisely. (parser_tokadd_string): use parser_isascii. (parser_yylex): ditto. (is_special_global_name): don't call is_identchar with e <= p. (rb_enc_symname_p): ditto. [ruby-dev:32455] * ext/tk/sample/tkextlib/vu/canvSticker2.rb: remove coding cookie because the encoding is not UTF-8. [ruby-dev:32475] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14131 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * encoding.c (rb_enc_precise_mbclen): new function for mbclen withakr2007-12-061-113/+145
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | validation. * include/ruby/encoding.h (rb_enc_precise_mbclen): declared. (MBCLEN_CHARFOUND): new macro. (MBCLEN_INVALID): new macro. (MBCLEN_NEEDMORE): new macro. * include/ruby/oniguruma.h (OnigEncodingTypeST): replace mbc_enc_len by precise_mbc_enc_len. (ONIGENC_PRECISE_MBC_ENC_LEN): new macro. (ONIGENC_CONSTRUCT_MBCLEN_CHARFOUND): new macro. (ONIGENC_CONSTRUCT_MBCLEN_INVALID): new macro. (ONIGENC_CONSTRUCT_MBCLEN_NEEDMORE): new macro. (ONIGENC_MBCLEN_CHARFOUND): new macro. (ONIGENC_MBCLEN_INVALID): new macro. (ONIGENC_MBCLEN_NEEDMORE): new macro. (ONIGENC_MBC_ENC_LEN): use ONIGENC_PRECISE_MBC_ENC_LEN. * enc/euc_jp.c: validation implemented. * enc/sjis.c: ditto. * enc/utf8.c: ditto. * string.c (rb_str_inspect): use rb_enc_precise_mbclen for invalid encoding. (rb_str_valid_encoding_p): new method String#valid_encoding?. * io.c (rb_io_getc): use rb_enc_precise_mbclen. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14119 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * bignum.c (rb_cstr_to_inum): trailing spaces may exist at sqeezingnobu2007-12-041-0/+3
| | | | | | | preceeding 0s. [ruby-core:13873] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14095 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* check Process.kill instead of Process#kill.akr2007-12-021-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14079 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* s/unicode/Unicode/ in error messages.akr2007-12-021-7/+75
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14078 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (regexp): fix /#{}\xa1\xa2/e to be EUC-JP. akr2007-12-021-0/+8
| | | | | | | (reg_fragment_setenc_gen): extracted from reg_compile_gen. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14075 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/intern.h (rb_uv_to_utf8): declared.akr2007-12-012-39/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * re.c (rb_reg_preprocess): new function for dynamic regexp with \u{} such as Regexp.new("\\u{6666}"). (rb_reg_prepare_re): preprocess regexp for recompiling. (read_escaped_byte): new function. (unescape_escaped_nonascii): new function. (append_utf8): new function. (unescape_unicode_list): new function. (unescape_unicode_bmp): new function. (unescape_nonascii): new function. (rb_reg_initialize): preprocess regexp. * pack.c (rb_uv_to_utf8): renamed from uv_to_utf8. * parse.y (STR_NEW3): take func instead of has8 and hasmb. (parser_str_new): use default coderange mechanism except for regexp. (parser_tokadd_utf8): copy regexp source as-is. (parser_read_escape): UTF-8 stuff removed. (parser_tokadd_escape): has8bit and hasmb removed. (parser_tokadd_string): fix 8-bit single byte character with \u. (parser_parse_string): has8bit and hasmb removed. (parser_here_document): has8bit and hasmb removed. (parser_yylex): call parser_tokadd_utf8 instead of read_escape for UTF-8 character. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14072 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * bootstraptest/test_knownbug.rb: move fixed bugs.ko12007-12-011-0/+4
| | | | | | | | | * test/ruby/test_sprintf.rb: ditto. * test/yaml/test_yaml.rb: ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14065 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* report the reason of process termination.akr2007-11-301-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14048 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* add test for enumerator.akr2007-11-281-1/+10
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14043 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * insnhelper.ci (vm_invoke_block): should splat args.ko12007-11-281-0/+8
| | | | | | | | | [ruby-dev:32392] * test/ruby/test_yield.rb: add tests for above. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14042 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test exceptions.akr2007-11-281-29/+41
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14040 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * compile.c, insns.def: change return value of "defined?"ko12007-11-271-0/+29
| | | | | | | | | | | for $&, $1, ... . If such variables are defined, return "global-variable". * test/ruby/test_defined.rb: add tests. * bootstraptest/test_syntax.rb: fix a test. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14031 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test_beginendblock.rb: add loop to wait signal.ko12007-11-271-2/+4
| | | | | | | | [ruby-dev:32332] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14028 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_method_missing): fix stack trace.ko12007-11-271-0/+12
| | | | | | | | | * bootstraptest/test_knownbug.rb: move solved tests. * bootstraptest/test_method.rb, test/ruby/test_regexp.rb: ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14026 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* more tests.akr2007-11-262-157/+99
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14023 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_eval.rb (TestEval::test_instance_eval_cvar):matz2007-11-261-15/+5
| | | | | | updated not to modify class variable of Object class. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14016 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/encoding.h (rb_enc_str_asciionly_p): declared.akr2007-11-251-21/+189
| | | | | | | | | | | | | | (rb_enc_str_asciicompat_p): defined. * re.c (rb_reg_initialize_str): use rb_enc_str_asciionly_p. (rb_reg_quote): return ascii-8bit string if the argument is ascii-only to generate encoding generic regexp if possible. (rb_reg_s_union): fix encoding handling. [ruby-dev:32094] * string.c (rb_enc_str_asciionly_p): defined. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14013 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_to_s refined.akr2007-11-251-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14012 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* add more roundtrip tests.akr2007-11-251-0/+44
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14010 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* add test for printf format %x, %o and %b.akr2007-11-241-0/+79
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14009 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * bootstraptest/test_knownbug.rb: move solved tests.ko12007-11-232-0/+11
| | | | | | | | | | * bootstraptest/test_io.rb, test_marshal.rb, test_objectspace.rb: ditto. * test/ruby/test_integer.rb, test_regexp.rb: ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14005 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * re.c (REG_CASESTATE): unused macro removed.akr2007-11-231-0/+201
| | | | | | | | | | | | (rb_reg_prepare_re): check encoding difference. (rb_reg_initialize): check 8bit byte. * parse.y (parser_tokadd_escape): fix has8bit. [ruby-dev:32113] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14002 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * compile.c (defined_expr): defined(method(x)) dumped core. amatz2007-11-231-2/+11
| | | | | | patch from Yusuke ENDOH <mame AT tsg.ne.jp>. [ruby-dev:32335] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@13998 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * configure.in: check struct timespec, clock_gettime, utimensat,akr2007-11-191-0/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | struct stat.st_atim, struct stat.st_atimespec, struct stat.st_atimensec, struct stat.st_mtim, struct stat.st_mtimespec, struct stat.st_mtimensec, struct stat.st_ctim, struct stat.st_ctimespec, struct stat.st_ctimensec. * include/ruby/missing.h: provide struct timespec if not available. * time.c: support nanosecond-resolution using struct timespec. * include/ruby/intern.h: provide rb_time_nano_new. * file.c (utime_internal): use utimensat if available. (rb_file_s_utime): refactored. (rb_f_test): use stat_atime, stat_mtime, stat_ctime. (rb_stat_cmp): check tv_nsec. (stat_atimespec): new function. (stat_atime): ditto. (stat_mtimespec): ditto. (stat_mtime): ditto. (stat_ctimespec): ditto. (stat_ctime): ditto. (rb_stat_atime): use stat_atime. (rb_file_s_atime): ditto. (rb_file_atime): ditto. (rb_stat_mtime): use stat_mtime. (rb_file_s_mtime): ditto. (rb_file_mtime): ditto. (rb_file_ctime): use stat_ctime. (rb_file_s_ctime): ditto. (rb_stat_ctime): ditto. * variable.c (rb_copy_generic_ivar): clear clone's instance variables if obj has no instance variable. * marshal.c (w_object): dump instance variables of generated string for TYPE_USERDEF, even if original object has instance variables. * lib/time.rb (Time#xmlschema): use nsec instead of usec. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@13968 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * time.c (time_minus): fix Time.at(2**60+1) - Time.at(2**60).akr2007-11-181-0/+10
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@13960 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* use ML ref. for assertion message.akr2007-11-1813-71/+58
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@13958 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* check class.akr2007-11-171-4/+56
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@13954 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * set eol-style.nobu2007-11-161-47/+47
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@13944 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_settracefunc.rb: fixed tests for set_trace_func.shugo2007-11-121-125/+160
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@13901 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * insnhelper.ci (vm_call_method): pass mn->nd_clss toshugo2007-11-111-1/+1
| | | | | | | | | vm_call_cfunc() instead of klass. * vm.c (rb_thread_method_id_and_klass): traverse parent_iseq. * thread.c (call_trace_proc): use rb_thread_method_id_and_klass(). git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@13877 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_iterator.rb (TestIterator::IterTest::each):matz2007-11-091-6/+3
| | | | | | | | | #each_pair is now alias to #each. [ruby-dev:32192] * test/ruby/test_iterator.rb (TestIterator::test_assoc_yield): ditto git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@13849 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_basicinstructions.rb: updated for new classmatz2007-11-091-6/+6
| | | | | | | | | | | | | | | | | behavior. [ruby-dev:32192] * encoding.c (enc_name): Encoding should not rely on ENCODING in the FL_USERS flags. * encoding.c (rb_enc_from_encoding): do not call rb_enc_associate for encoding itself. * encoding.c (enc_register_at): ditto. * marshal.c (r_ivar): do not set real instance variable for encoding data associated. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@13848 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y: patch, based on Nobu's, work to support \u escapesdavidflanagan2007-11-072-0/+265
| | | | | | | | | | also modifications for better coderange detection * test/ruby/test_unicode_escapes.rb: test cases * test/ruby/test_mixed_unicode_escapes.rb: mixed encoding test cases git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@13836 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_f_send): allow send/__send__ to call methods of allmatz2007-11-044-5/+5
| | | | | | | | | | visibility again. we no longer provide __send, __send!. * eval.c (rb_invoke_method): new method to honor private visibility. if it's invoked in a function call style, it calls private methods as well (previous 1.9 send behavior). git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@13824 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* specify prefix for Dir.mktmpdir.akr2007-10-242-2/+2
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@13765 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* use Dir.mktmpdir.akr2007-10-242-21/+21
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@13761 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * marshal.c (r_bytes0): check if source has enough data.nobu2007-10-151-0/+20
| | | | | | | [ruby-dev:32054] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@13700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * encoding.c (rb_obj_encoding): rdoc update. a patch from Davidnobu2007-10-141-0/+28
| | | | | | | | | | | | | | | | Flanagan <david AT davidflanagan.com>. [ruby-core:12664] * encoding.c (enc_dump, enc_load): marshaling feature. a patch from David Flanagan. [ruby-core:12665] * encoding.c (Init_Encoding): undefine allocator of Encoding. [ruby-core:12665], [ruby-core:12666] * test/ruby/test_encoding.rb: tests for Encoding from David Flanagan [ruby-core:12665] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@13697 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * variable.c (rb_cvar_set): check whether class variable ismatz2007-10-031-7/+7
| | | | | | | | | | defined in superclasses. root classes have higher priority. removes lower class variable entry from IV_TBL (if it's defined in classes, not modules). * variable.c (rb_cvar_get): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@13604 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_product): generalized product, now takesmatz2007-10-021-0/+6
| | | | | | | arbitrary number of arrays. a patch from David Flanagan <david AT davidflanagan.com>. [ruby-core:12346] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@13598 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_permutation): implementation contributed frommatz2007-10-011-8/+16
| | | | | | | | | David Flanagan. [ruby-core:12344] * array.c (rb_ary_combination): RDoc update to clarify. a patch from David Flanagan. [ruby-core:12344] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@13590 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_combination): revisit #combination behavior.matz2007-10-011-2/+2
| | | | | | suggested by David Flanagan. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@13588 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_combination): new method to give all combinationmatz2007-09-291-0/+22
| | | | | | | | | | | | | of elements from an array. [ruby-list:42671] * array.c (rb_ary_product): a new method to get all combinations of elements from two arrays. can be extended to combinations of n-arrays, e.g. a.product(b,c,d). anyone volunteer? * array.c (rb_ary_permutation): empty function body to calculate permutations of array elements. need volunteer. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@13568 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * cont.c: Thread local storage should be fiber local.ko12007-09-281-0/+29
| | | | | | | | | * bootstraptest/test_knownbug.rb, test/ruby/test_fiber.rb: move a fixed test. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@13555 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* refine previous change.akr2007-09-282-87/+91
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@13554 b2dd03c8-39d4-4d8f-98ff-823fe69b080e