Skip to content

Commit 717036d

Browse files
authored
Add spec for passing String argument with Float number to Math.log10 (#1322)
This test was present with log2 and log1p, but missing in log10. Co-authored-by: Herwin <[email protected]>
1 parent b092a48 commit 717036d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

core/math/log10_spec.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@
2323
-> { Math.log10("test") }.should raise_error(TypeError)
2424
end
2525

26+
it "raises a TypeError if passed a numerical argument as a string" do
27+
-> { Math.log10("1.0") }.should raise_error(TypeError)
28+
end
29+
2630
it "returns NaN given NaN" do
2731
Math.log10(nan_value).nan?.should be_true
2832
end

0 commit comments

Comments
 (0)