aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_string.rb
Commit message (Collapse)AuthorAgeFilesLines
...
* * test/-ext-/test_printf.rb, test/rss/test_parser.rb,shugo2013-06-131-40/+20
| | | | | | | | | | test/ruby/test_array.rb, test/ruby/test_hash.rb, test/ruby/test_m17n.rb, test/ruby/test_marshal.rb, test/ruby/test_object.rb, test/ruby/test_string.rb: don't use untrusted?, untrust, and trust to avoid warnings in case $VERBOSE is true. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41271 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_inspect): refix r40413, on Ruby 1.9 usual characternaruse2013-04-231-2/+4
| | | | | | | escape uses hex/Unicode escapes, so fix to use Unicode escape on Unicode strings and hex on others. [ruby-core:54458] [Bug #8290] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40423 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_inspect): NUL should not be represented asknu2013-04-231-0/+6
| | | | | | "\0" when octal digits may follow. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40413 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Fix String#rpartition(/re/) against a multibyte string.knu2013-03-241-0/+7
| | | | | | | * string.c (rb_str_rpartition): Fix String#rpartition(/re/) against a multibyte string. [Bug #8138] [ruby-dev:47183] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39903 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (str_byte_substr): don't set coderange if it's not known.naruse2013-02-251-0/+4
| | | | | | [Bug #7954] [ruby-dev:47108] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39495 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_string.rb: defer ENUMERATORS_WANTARRAY to next majornobu2013-02-251-1/+1
| | | | | | | * test/ruby/test_string.rb (TestString::ENUMERATOR_WANTARRAY): defer new behavior to next major. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39494 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_string.rb: ENUMERATORS_WANTARRAYnobu2013-02-251-4/+5
| | | | | | | * test/ruby/test_string.rb (TestString::ENUMERATOR_WANTARRAY): name test branching codition. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39493 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_enumerate_lines): fix invalid byte sequence errorglass2013-01-051-0/+5
| | | | | | | | | | when a separator is passed. The patch is from yoshidam (Yoshida Masato). [Bug #7646] [ruby-dev:46827] * test/ruby/test_string.rb: a test for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38704 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* string.c: compare with to_strnobu2012-11-301-1/+2
| | | | | | | | * string.c (rb_str_cmp_m): try to compare with to_str result if possible before calling <=> method. [ruby-core:49279] [Bug #7342] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38044 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* string.c: always fixed valuenobu2012-11-301-1/+1
| | | | | | | * string.c (rb_str_cmp_m): return fixed value, one of -1,0,+1 always. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38042 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* String#{lines,chars,codepoints,bytes} now return an array.knu2012-11-241-6/+113
| | | | | | | | | | | | | | | | | | | | * string.c (rb_str_each_line, rb_str_lines): String#lines now returns an array instead of an enumerator. Passing a block is deprecated but still supported for backwards compatibility. Based on the patch by yhara. [Feature #6670] * string.c (rb_str_each_char, rb_str_chars): Ditto for String#chars. * string.c (rb_str_each_codepoint, rb_str_codepoints): Ditto for String#codepoints. * string.c (rb_str_each_byte, rb_str_bytes): Ditto for String#bytes. * NEWS: Add notes for the above changes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37838 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Apply performance improvement to short byte array search.knu2012-11-221-0/+7
| | | | | | | | * re.c (rb_memsearch_ss): Apply performance improvement to short byte array search for platforms without memmem(3). [Feature #6311] [ruby-dev:45530] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37793 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add some corner cases to tests for String#index.knu2012-11-221-0/+7
| | | | | | | | * test/ruby/test_string.rb (TestString#test_index): Add some corner cases to tests for String#index, which might fail if ruby directly used a buggy memmem(3) implementation. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37792 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* revert r37710, requested by Tadayoshi Funaba [ruby-dev:46575]shyouhei2012-11-211-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37776 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * bignum.c (rb_cstr_to_inum): should accept underscores oftadf2012-11-181-1/+1
| | | | | | | sequence of two or more when unchecked mode. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37710 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_string.rb: missing testnobu2012-10-111-0/+6
| | | | | | * test/ruby/test_string.rb (test_each_codepoint): missing test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37142 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_string.rb: suppress warningsnobu2012-10-111-1/+5
| | | | | | | | | | * test/ruby/test_string.rb (test_match_method): use unique objects in TestString and TestString2. * test/ruby/test_string.rb (test_ascii_incomat_inspect): suppress warnings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_string.rb: highlightingnobu2012-10-111-2/+2
| | | | | | | * test/ruby/test_string.rb (test_LSHIFT, test_succ): get rid of ruby-mode.el confusion. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37140 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_concat): use memcpy to copy a string which containsnaruse2012-09-301-0/+6
| | | | | | NUL characters. [ruby-core:47751] [Bug #7090] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37058 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test String#each_line when separator is longer than string.tenderlove2012-08-071-0/+7
| | | | | | Thanks Charles Nutter. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36648 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_start_with, rb_str_end_with): raise an error ifnobu2012-04-021-4/+18
| | | | | | | an argument is not convertible to a String. [ruby-core:40623][Bug #5536] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35213 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (str_new_empty): should copy also the encoding as annobu2012-03-271-0/+20
| | | | | | empty substring. [ruby-dev:45441][Bug #6206] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35146 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (tr_setup_table): fix multiple non latin argument fornaruse2012-03-251-0/+7
| | | | | | | non latin (over 256 characters) tr-like methods. [ruby-core:43371] [Bug #6167] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35127 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * bignum.c (rb_str_to_inum): must be ASCII compatible encoding asnobu2012-03-231-0/+7
| | | | | | | well as String#hex and String#oct. [ruby-core:43566][Bug #6192] * string.c (rb_must_asciicompat): check if ASCII compatible. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35120 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (trnext): fix bug with string ending with '\\'.kazu2012-03-161-0/+3
| | | | | | | | | [ruby-dev:45374][Bug #6160] * test/ruby/test_string.rb (TestString#test_delete): test for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35073 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (trnext): should advance char-wise.nobu2012-03-161-0/+4
| | | | | | [ruby-core:43335][Bug #6156] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35069 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* subclass of Stringnobu2012-03-021-0/+7
| | | | | | | * test/ruby/test_string.rb (TestString2): tests for subclass of String. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34876 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* cancel subversion backfire. sorrymatz2011-03-071-0/+32
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31046 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (rb_gc_set_params): allow GC parameter configuration bymatz2011-03-071-32/+0
| | | | | | | environment variables. based on a patch from funny-falcon at https://gist.github.com/856296, but honors safe level. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31044 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (str_byte_substr): return nil for negative length.nobu2011-03-021-0/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31007 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_byteslice): the resulted encoding should keepnaruse2011-03-011-17/+19
| | | | | | | original encoding. this also fixes the encoding when the result shares internal string. [ruby-core:35376] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30994 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_byteslice): Add String#byteslice. [ruby-core:35376]naruse2011-03-011-0/+29
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30991 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (inspect_ary): don't taint the inspected result of anaruse2011-02-151-8/+0
| | | | | | recursive array. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30878 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Ensure result encoding is the same as input encoding for String#gsub. [Bug ↵drbrain2011-02-061-0/+15
| | | | | | #4340]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30806 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_inspect): fix: extra back slash is added whennaruse2010-12-111-0/+5
| | | | | | the string is dummy encoding and includes \x22 or \x5C. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30180 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_string.rb (TestString#test_scan): add a test forkazu2010-12-061-0/+8
| | | | | | [ruby-core:33338] #4087. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30094 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_memhash): zero-filled strings should returnnobu2010-12-011-0/+2
| | | | | | different values. [ruby-core:33500] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29991 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_inspect): fix for ascii-compatible externalnobu2010-11-221-0/+8
| | | | | | | encoding and different encoding string. [ruby-core:33283] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29872 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_inspect): append for each chars instead of bulknobu2010-11-221-0/+2
| | | | | | | copy if encoding conversion is needed. [ruby-core:33283] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29868 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * numeric.c (ruby_float_step): fix Numeric#step with infinity unitnaruse2010-10-131-4/+4
| | | | | | doesn't works well. [ruby-core:32779] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29490 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Fix style for ruby-mode.el.naruse2010-10-131-4/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29475 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Clean warnings.naruse2010-10-121-2/+9
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29474 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (tr_setup_table): optimized. don't create hash objectsnaruse2010-09-011-0/+1
| | | | | | | | when given pattern is ASCII only. * string.c (tr_find): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29158 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (tr_setup_table): fix bug in r29146.naruse2010-08-301-0/+1
| | | | | | | | | | Initialize table even if cflag is 0; tr_find see whether del is empty or not. * string.c (tr_find): nodel can't be NULL; if NULL, it means it is not specified. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29148 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (tr_setup_table): initialize negating table whennaruse2010-08-301-0/+5
| | | | | | | | | | | negating string is given. [ruby-core:31851] * string.c (tr_find): add a sentence for the time when target characters include negating one. * string.c (rb_str_count): move definition. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29146 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_prepend): new method by Sora Harakamishyouhei2010-08-271-0/+16
| | | | | | | [Feature #3765] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29120 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_{string,symbol}.rb (test_ascii_incomat_inspect):nobu2010-06-021-1/+2
| | | | | | ASCII range characters are no longer escaped. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28128 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_inspect): escape ASCII-compatible strings.nobu2010-05-281-0/+7
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28051 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Remove hexadecimal-floating-point tests for String#to_f.naruse2010-04-011-10/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27150 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c (rb_cstr_to_dbl): return 0.0 if hexadecimal andnaruse2010-04-011-0/+3
| | | | | | | | | baccheck is FALSE: Float("0x1p+0") works, but "0x1p+0".to_f doesn't. [ruby-dev:40650] * util.c (ruby_strtod): allow hexdecimal integers. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27140 b2dd03c8-39d4-4d8f-98ff-823fe69b080e