summaryrefslogtreecommitdiff
path: root/test/ruby/test_string.rb
AgeCommit message (Collapse)Author
2016-01-25* test/ruby/test_string.rb: added testcase for next!, succ and succ!hsbt
[fix GH-1213] Patch by @K0mAtoru git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53649 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-18* test/ruby/test_string.rb: Added extra testcase for test_rstrip_banghsbt
and test_lstrip_bang. [fix GH-1178] Patch by @Matrixbirds git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53572 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-05* test/ruby/test_string.rb(test_chr): added test for String#chrhsbt
[fix GH-1179] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53441 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-30Add test for String#ordnobu
* test/ruby/test_string.rb (test_ord): Add test for String#ord. [Fix GH-1181] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53384 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-28Add test for String#rstrip!nobu
* test/ruby/test_string.rb (TestString#test_rstrip_bang): Add test for String#rstrip!. [Fix GH-1176] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53354 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-28Add test for String#lstrip!nobu
* test/ruby/test_string.rb (TestString#test_lstrip_bang): Add test for String#lstrip!. [Fix GH-1176] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53352 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-27Add tests for String#lstrip and rstripnobu
* test/ruby/test_string.rb (test_rstrip, test_lstrip): Add tests for String#lstrip and rstrip. The test cases are used from string.c ruby-doc comments. [Fix GH-1174] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53328 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-27Add test for String#test_insert.nobu
* test/ruby/test_string.rb (test_insert): The test cases are written in string.c comments as a reference. [Fix GH-1173] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53327 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-16Add frozen_string_literal: false for all filesnaruse
When you change this to true, you may need to add more tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-08* string.c (rb_str_init): now accepts new option parameter `encoding'.usa
[Feature #11785] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52976 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-07* string.c: introduce String#+@ and String#-@ to controlko1
String mutability. [Feature #11782] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52917 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-02* test/ruby/test_string.rb: removed non executing tests.hsbt
[Misc #11757][ruby-dev:49397] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52851 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-23* file.c: fix indent style. [fix GH-977]hsbt
* test/ruby/test_string.rb: indent. [fix GH-975] [ci skip] These patches are contributed from @yui-knk git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52242 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-27* lib/webrick/server.rb: use IO::NULL instead of '/dev/null'hsbt
* test/ruby/test_string.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51709 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-10* string.c (rb_str_crypt): Raise ArgumentError whenglass
string passed to String#crypt contains null. the patch is from jrusnack <jrusnack at redhat.com>. [Bug #10988] [fix GH-853] * test/ruby/test_string.rb: test for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50458 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-23string.c: proper exceptionnobu
* string.c (rb_str_split_m): raise ArgumentError at broken string not RegexpError, as Regexp is not involved in. [ruby-core:68229] [Bug #10886] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49695 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-12string.c: check arguments for cryptnobu
* string.c (rb_str_crypt): check arguments more strictly. * crypt() is not for wide char strings * salt bytes should not be NUL git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48779 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-23string.c: preserve encoding of global variablenobu
* string.c (rb_str_setter): preserve encoding of global variable name in error message. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48549 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-13* test/lib/envutil.rb: Moved from test/ruby/.akr
* test/lib/find_executable.rb: Ditto. * test/lib/memory_status.rb: Ditto. * test/lib/test/unit.rb: require envutil. * test/: Don't require envutil in test files. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48409 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-17* Avoid undefined behaviors found by gcc -fsanitize=undefined.akr
gcc (Debian 4.9.1-16) 4.9.1 * string.c (rb_str_sum): Avoid undefined behavior. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47997 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-06test_string.rb: enable huge test only on possible platformsnobu
* test/ruby/test_string.rb (test_LSHIFT_neary_long_max): enable only on platforms where string size range is smaller than memory space. this test does not make sense but just wastes memory and time on other platforms, as it is hardly possible that a string size becomes neary LONG_MAX if long size equals pointer size. [ruby-core:65410] [Bug #10325] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47817 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-30test_string.rb: move and add assertionsnobu
* test/ruby/test_string.rb (test_slice): move the assertion for [Bug #9882], and more assertion for `ascii_only?` too, as pointed out by Heesob Park in [ruby-core:62846]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46244 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-30string.c: reset code rangenobu
* string.c (rb_str_substr): need to reset code range for shared string too, not only copied string. [ruby-core:62842] [Bug #9882] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46243 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-20more insrease timeout of test_LSHIFT_neary_long_maxnaruse
http://chkbuild002.hsbt.org/chkbuild/ruby-trunk/log/20140520T060016Z.fail.html.gz git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46028 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-19string.c: byte offsetnobu
* string.c (rb_pat_search): advance by byte offset but not by char offset. [ruby-core:62669] [Bug #9849] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46013 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-18increase timeout 10 to 15 on test_LSHIFT_neary_long_maxnaruse
http://chkbuild002.hsbt.org/chkbuild/ruby-trunk/log/20140517T160021Z.fail.html.gz http://chkbuild002.hsbt.org/chkbuild/ruby-trunk/log/20140517T200036Z.fail.html.gz git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45994 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-04-09string.c: fix capacitynobu
* string.c (str_buf_cat): should round up the capacity by 4KiB, but not number of rooms. [ruby-core:61886] [Bug #9709] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45534 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-03-28string.c: infect match resultnobu
* string.c (rb_pat_search): match result should be infected by the pattern. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45460 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-03-28string.c: backref substitutionnobu
* re.c (rb_reg_regsub): allow nil regexp for string matching. * string.c (rb_str_sub_bang, str_gsub): make substitution if replacement string has backref escapes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45459 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-03-28string.c: unset $~ if unmatchnobu
* string.c (rb_pat_search): unset $~ if the last match failed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45458 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-03-27string.c: search by rb_str_indexnobu
* re.c (match_regexp): set regexp for MatchData from string. * re.c (rb_backref_set_string): create MatchData from string and set backref. * string.c (rb_pat_search, rb_str_sub, rb_str_sub_bang, str_gsub), (scan_once, rb_str_scan, rb_str_partition): use rb_str_index instead of rb_reg_search() when pattern is a String. based on the patch by Sam Rawlins <sam.rawlins@gmail.com> [Fixes GH-579] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45451 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-03-11insns.def (opt_regexpmatch2): respect redefined match opnormal
* insns.def (opt_regexpmatch2): respect redefined match op Thanks to Sam Rawlins for the fix. * test/ruby/test_string.rb: test based on Tsuyoshi Sawada's report [Bug #9581] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45318 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-30siphash.c: fix missing conditionnobu
* siphash.c (sip_hash24): fix for aligned word access little endian platforms. [ruby-core:58658] [Bug #9172] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43928 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-27* test/ruby/test_string.rb: Add test for error when appending aheadius
Symbol into a String. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43869 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-22test_string.rb: refine assertionsnobu
* test/ruby/test_string.rb: refine assertions, instead of mere assert. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43792 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-10parse.y: remove "f" suffix [ruby-core:57966] [Feature #9042]nobu
revert r42847 "test_string.rb: add test string encoding" revert r42846 "parse.y: freeze in advance to reduce objects" revert r42843 "parse.y: deduplicate frozen string literals" revert r42780 "test_string.rb: yet another test" revert r42779 "parse.y: valid suffix word only" revert r42778 "test_string.rb: remove duplicated code" revert r42775 "parse.y: force_encoding" This reverts commit 93ea04ecec7639ca8d0e58948e78461434782ecc. revert r42773 "Add frozen string literals" git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43634 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_regexpmatch2): Check String#=~ hasn't overriddensorah
before calling rb_reg_match(). * test/ruby/test_string.rb: Test for above. * vm.c (vm_init_redefined_flag): Add BOP flag for String#=~ [ruby-core:57385] [Bug #8953] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43052 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-05* string.c (fstring_cmp): take string encoding into account whencharliesome
comparing fstrings [ruby-core:57037] [Bug #8866] * test/ruby/test_string.rb: add test git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42847 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-05* include/ruby/ruby.h: add RSTRING_FSTR flagcharliesome
* internal.h: add rb_fstring() prototype * parse.y (str_suffix_gen): deduplicate frozen string literals * string.c (rb_fstring): deduplicate frozen string literals * string.c (rb_str_free): delete fstrings from frozen_strings table when they are GC'd * string.c (Init_String): initialize frozen_strings table * test/ruby/test_string.rb: test frozen strings are deduplicated git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42843 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-02test_string.rb: yet another testnobu
* test/ruby/test_string.rb (TestString#test_frozen_string_adjacent): option is allowed after the last string. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42780 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-02parse.y: valid suffix word onlynobu
* parse.y (parser_str_options): use valid suffix word only, as well as numeric literal, for the backward comatibility. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42779 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-02test_string.rb: remove duplicated codenobu
* test/ruby/test_string.rb (TestString#test_frozen_dstring): remove duplicated assertion. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42778 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-02* NEWS: Add note about frozen string literalscharliesome
* compile.c (case_when_optimizable_literal): optimize NODE_LIT strings in when clauses of case statements * ext/ripper/eventids2.c: add tSTRING_SUFFIX * parse.y: add 'f' suffix on string literals for frozen strings * test/ripper/test_scanner_events.rb: add scanner tests * test/ruby/test_string.rb: add frozen string tests [Feature #8579] [ruby-core:55699] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42773 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-16test_string.rb: Bug #8642nobu
* test/ruby/test_string.rb (test_split): test for r41994. [ruby-core:56036] [Bug #8642] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42002 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-13* test/-ext-/test_printf.rb, test/rss/test_parser.rb,shugo
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
2013-04-23* string.c (rb_str_inspect): refix r40413, on Ruby 1.9 usual characternaruse
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
2013-04-23* string.c (rb_str_inspect): NUL should not be represented asknu
"\0" when octal digits may follow. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40413 b2dd03c8-39d4-4d8f-98ff-823fe69b080e