summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/mruby-string-ext/test/string.rb
AgeCommit message (Collapse)Author
2019-04-27Remove duplicated `String#each_char`KOBAYASHI Shuji
2019-03-12Fix missing assertions in `mruby-string-ext` testKOBAYASHI Shuji
2018-11-19Removed `String#try_convert` method from `mruby-string-ext` gem.Yukihiro "Matz" Matsumoto
Because `try_convert` method rarely used in production. For mruby users, we have `__to_str` utility method to check string type.
2018-11-19Remove implicit conversion using `to_str` method; fix #3854Yukihiro "Matz" Matsumoto
We have added internal convenience method `__to_str` which does string type check. The issue #3854 was fixed but fundamental flaw of lack of stack depth check along with fibers still remains. Use `MRB_GC_FIXED_ARENA` for workaround.
2018-11-19Remove implicit conversion using `to_int` method.Yukihiro "Matz" Matsumoto
The ISO standard does not include implicit type conversion using `to_int`. This implicit conversion often causes vulnerability. There will be no more attacks like #4120. In addition, we have added internal convenience method `__to_int` which does type check and conversion (from floats).
2018-11-02Add tests for empty patterns for `tr` and `count`; #4156 #4157Yukihiro "Matz" Matsumoto
2018-09-21Implement `String#delete` and `#delete!`; ref #4086Yukihiro "Matz" Matsumoto
mruby restriction: In mruby, `String#delete` only takes single pattern argument.
2018-09-21Implement `String#count`; ref #4086Yukihiro "Matz" Matsumoto
mruby restriction: In mruby, `String#count` does not take multiple pattern arguments, but only one pattern.
2018-09-21Add `String#squeeze` and `#squeeze!`; ref #4086Yukihiro "Matz" Matsumoto
mruby restriction: `String#squeeze` can take more than 1 pattern arguments in CRuby, in that case, the intersection of patterns will be used to match. But in mruby, it doesn't take multiple patterns.
2018-09-21Add `String#tr_s` and `String#tr_s!`; ref #4086Yukihiro "Matz" Matsumoto
2018-09-21Add `String#tr` and `#tr!` to `mruby-string-ext` gem; fix #4086Yukihiro "Matz" Matsumoto
This patch is based on `mruby/c` implementation by Hirohito Higashi. We might need to add `#tr_s`, `#squeeze` and `#delete` as well. Adding them should not be too hard using functions we implemented here.
2017-10-17Add `String#delete_{prefix,suffix}`; CRuby2.5Yukihiro "Matz" Matsumoto
2017-06-14Reimplement String#uptoksss
2017-05-21String#concat: Try to convert when not stringksss
2017-02-11Remove historical comment; ref #3450 #3448Yukihiro "Matz" Matsumoto
2017-02-11remove skip that shouldn't be necessary anymore.robert
the test should pass after https://github.com/mruby/mruby/commit/8f4a929e1a01c8d6176fb53a9ef5dff6de632959.
2017-02-10Tests for UTF-8 String#ljust and String#rjustTomasz Dabrowski
2017-02-10String#ljust and String#rjust reimplementation (fix #3445)Tomasz Dabrowski
- String#ljust and String#rjust are now C functions to improve performance - infinite loop because of an empty padding argument is now prevented (ArgumentError is raised) - extra tests for ljust/rjust added
2016-11-24Read length after args in String#setbyteCraig Lehmann
Prevents RCE Reported by https://hackerone.com/raydot
2016-08-17Fix String#ord failure which return a negative valueHiroshi Mimaki
2016-07-14String#insert should be destructiveksss
2016-01-30Add String#rjust test to mruby-string-extAkira Moroo
2015-11-24add {Array|Hash|String}.try_converttakahashim
2015-09-24UTF-8 string support in coreYukihiro "Matz" Matsumoto
define MRB_UTF8_STRING (in mrbconf.h) to enable UTF-8 support.
2015-08-05add String#setbyte and String#byteslice to mruby-string-extYukihiro "Matz" Matsumoto
2015-01-13Add String#uptoJun Hiroe
2015-01-12add String#ljust into mruby-string-exttakahashim
2014-12-17Add String#prependJun Hiroe
2014-12-13Add String#insertJun Hiroe
2014-08-11"-a-a-".succ should be "-a-b-"mattn
2014-08-11Fix String#succ. "-a-".succ should be "-b-"mattn
2014-08-11Fix String#succ. "-".succ should be "."mattn
2014-08-08remove test for succ on Unicode (non-ASCII) char; #2520Yukihiro "Matz" Matsumoto
2014-08-08Add String#succ, String#succ!, String#next, String#next!mattn
2014-06-19Modify return value of String#slice! if idx == self.sizeAkito Mochizuki
2014-06-15Implement String#slice_bangJun Hiroe
2014-06-07move String#clear to mruby-string-ext; ref #2370Yukihiro "Matz" Matsumoto
2014-06-07remove UTF-8 strings from mruby-string-ext testYukihiro "Matz" Matsumoto
2014-06-04Add String#linesmattn
2014-06-03Implement String#chrJun Hiroe
2014-04-30remove trailing spacesNobuyoshi Nakada
2014-04-20String#casecmp should be call `to_str`ksss
when non String object sent And should be raise TypeError when can not responsed to `to_str`
2014-03-31More tests for String#hex, String#oct as against ↵mattn
9434506035c3fc01de55ac0bc8b75497f8b5df5f
2014-03-27add String#octcubicdaiya
2014-03-27Implement String#hexmattn
2014-01-07mruby-string-utf8: UTF-8 string may contail NUL; #1646Yukihiro "Matz" Matsumoto
2013-12-27add String#partition and String#rpartition.Tomoyuki Sahara
2013-08-26Merge branch 'mruby' into pr-typeerror-string-start-end-withTomoyuki Sahara
Conflicts: mrbgems/mruby-string-ext/src/string.c mrbgems/mruby-string-ext/test/string.rb
2013-08-26Merge pull request #1485 from fjmilens3/string_end_withYukihiro "Matz" Matsumoto
Bug in String#end_with? resulting from incorrect length determination
2013-08-23Check type of arguments for #start_with and #end_with.Tomoyuki Sahara