[Bug #19087] Merge to "trailing garbage" case

This commit is contained in:
Nobuyoshi Nakada 2022-12-02 01:50:48 +09:00
parent c94cd8534a
commit 9da2a5204f
No known key found for this signature in database
GPG Key ID: 7CD2805BFA3770C6

View File

@ -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)