summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/mruby-bin-mruby/bintest/mruby.rb
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2019-01-08 21:42:50 +0900
committerGitHub <[email protected]>2019-01-08 21:42:50 +0900
commit712a8bb1b2afd48a695933a671c118f9dfa372a4 (patch)
tree2b71f09ce2bff059e35d8ca8bf5cd12267944a45 /mrbgems/mruby-bin-mruby/bintest/mruby.rb
parentb575d0c45ef21f0f51fc31be8612333fe16e8a8e (diff)
parent68735d12614ef72b620736a5cd3052fb79445483 (diff)
downloadmruby-712a8bb1b2afd48a695933a671c118f9dfa372a4.tar.gz
mruby-712a8bb1b2afd48a695933a671c118f9dfa372a4.zip
Merge pull request #4219 from shuujii/fix-dump-load-float-literal-evaluate-to-infinity
Fix dump/load float leteral evaluate to infinity
Diffstat (limited to 'mrbgems/mruby-bin-mruby/bintest/mruby.rb')
-rw-r--r--mrbgems/mruby-bin-mruby/bintest/mruby.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/mrbgems/mruby-bin-mruby/bintest/mruby.rb b/mrbgems/mruby-bin-mruby/bintest/mruby.rb
index a7fb63fa2..f3c7d8761 100644
--- a/mrbgems/mruby-bin-mruby/bintest/mruby.rb
+++ b/mrbgems/mruby-bin-mruby/bintest/mruby.rb
@@ -31,6 +31,13 @@ assert '$0 value' do
assert_equal '"-e"', `#{cmd('mruby')} -e #{shellquote('p $0')}`.chomp
end
+assert('float literal') do
+ script, bin = Tempfile.new('test.rb'), Tempfile.new('test.mrb')
+ File.write script.path, 'p [3.21, 2e308.infinite?, -2e308.infinite?]'
+ system "#{cmd('mrbc')} -g -o #{bin.path} #{script.path}"
+ assert_equal "[3.21, 1, -1]", `#{cmd('mruby')} -b #{bin.path}`.chomp!
+end
+
assert '__END__', '8.6' do
script = Tempfile.new('test.rb')