From 9da2a5204f32a4f2ce135fddde2abb6e07d647e9 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Fri, 2 Dec 2022 01:50:48 +0900 Subject: [PATCH] [Bug #19087] Merge to "trailing garbage" case --- spec/ruby/core/string/to_c_spec.rb | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/spec/ruby/core/string/to_c_spec.rb b/spec/ruby/core/string/to_c_spec.rb index 489af56a30..edc8a4f14f 100644 --- a/spec/ruby/core/string/to_c_spec.rb +++ b/spec/ruby/core/string/to_c_spec.rb @@ -13,6 +13,9 @@ describe "String#to_c" do it "ignores trailing garbage" do '79+4iruby'.to_c.should == Complex(79, 4) + ruby_bug "[Bug #19087]", ""..."3.2" do + '7__9+4__0i'.to_c.should == Complex(7, 0) + end end it "understands Float::INFINITY" do @@ -24,12 +27,6 @@ describe "String#to_c" do 'NaN'.to_c.should == Complex(0, 0) end - ruby_bug "[Bug #19087]", ""..."3.2" do - it "disallows a sequence of _" do - '7__9+4__0i'.to_c.should == 7 - end - end - it "allows null-byte" do "1-2i\0".to_c.should == Complex(1, -2) "1\0-2i".to_c.should == Complex(1, 0)