diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2018-09-20 10:13:36 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2018-09-20 10:13:36 +0900 |
| commit | 8e91316bd64aa39b3afeffb0ade5eb38b05d3953 (patch) | |
| tree | fabce96f895417c6d2252860211aeb7b4df97a31 /mrbgems/mruby-string-ext/test | |
| parent | 3820ef791f3ccb766956d12534ae519f4923ac7e (diff) | |
| parent | cb85fa6787ea9467f81be41570a36b475b7ef061 (diff) | |
| download | mruby2-draft.tar.gz mruby2-draft.zip | |
Merge branch 'no-implicit-conversion' into mruby2-draftmruby2-draft
Diffstat (limited to 'mrbgems/mruby-string-ext/test')
| -rw-r--r-- | mrbgems/mruby-string-ext/test/string.rb | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/mrbgems/mruby-string-ext/test/string.rb b/mrbgems/mruby-string-ext/test/string.rb index b6146fb90..b44e8181a 100644 --- a/mrbgems/mruby-string-ext/test/string.rb +++ b/mrbgems/mruby-string-ext/test/string.rb @@ -4,13 +4,6 @@ UTF8STRING = ("\343\201\202".size == 1) -assert('String.try_convert') do - assert_nil String.try_convert(nil) - assert_nil String.try_convert(:foo) - assert_equal "", String.try_convert("") - assert_equal "1,2,3", String.try_convert("1,2,3") -end - assert('String#getbyte') do str1 = "hello" bytes1 = [104, 101, 108, 108, 111] @@ -31,18 +24,6 @@ assert('String#setbyte') do assert_equal("Hello", str1) end -assert("String#setbyte raises IndexError if arg conversion resizes String") do - $s = "01234\n" - class Tmp - def to_i - $s.chomp! '' - 95 - end - end - tmp = Tmp.new - assert_raise(IndexError) { $s.setbyte(5, tmp) } -end - assert('String#byteslice') do str1 = "hello" assert_equal("e", str1.byteslice(1)) @@ -126,12 +107,6 @@ assert('String#concat') do assert_equal "Hello World!", "Hello " << "World" << 33 assert_equal "Hello World!", "Hello ".concat("World").concat(33) - o = Object.new - def o.to_str - "to_str" - end - assert_equal "hi to_str", "hi " << o - assert_raise(TypeError) { "".concat(Object.new) } end @@ -140,11 +115,6 @@ assert('String#casecmp') do assert_equal 0, "aBcDeF".casecmp("abcdef") assert_equal(-1, "abcdef".casecmp("abcdefg")) assert_equal 0, "abcdef".casecmp("ABCDEF") - o = Object.new - def o.to_str - "ABCDEF" - end - assert_equal 0, "abcdef".casecmp(o) end assert('String#start_with?') do |
