summaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorKOBAYASHI Shuji <[email protected]>2019-07-18 17:51:02 +0900
committerKOBAYASHI Shuji <[email protected]>2019-07-18 17:51:02 +0900
commit9873d5e0b9f1d3be9b2c97a21789ccdbd500e039 (patch)
tree91ae69475e6b232539c9fadad0392e40a0f46781 /test
parent94a1f488a6b7209dc4b70a04df30ad69ebdc00de (diff)
downloadmruby-9873d5e0b9f1d3be9b2c97a21789ccdbd500e039.tar.gz
mruby-9873d5e0b9f1d3be9b2c97a21789ccdbd500e039.zip
Fix `String#*` test with `MRB_WITHOUT_FLOAT`
Diffstat (limited to 'test')
-rw-r--r--test/t/string.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/test/t/string.rb b/test/t/string.rb
index af944b359..46cbe6e2a 100644
--- a/test/t/string.rb
+++ b/test/t/string.rb
@@ -37,13 +37,15 @@ end
assert('String#*', '15.2.10.5.5') do
assert_equal 'aaaaa', 'a' * 5
assert_equal '', 'a' * 0
- assert_equal 'aa', 'a' * 2.1
assert_raise(ArgumentError) { 'a' * -1 }
+ assert_raise(TypeError) { 'a' * '1' }
+ assert_raise(TypeError) { 'a' * nil }
+
+ skip unless Object.const_defined?(:Float)
+ assert_equal 'aa', 'a' * 2.1
assert_raise(RangeError) { '' * 1e30 }
assert_raise(RangeError) { '' * Float::INFINITY }
assert_raise(RangeError) { '' * Float::NAN }
- assert_raise(TypeError) { 'a' * '1' }
- assert_raise(TypeError) { 'a' * nil }
end
assert('String#[]', '15.2.10.5.6') do