summaryrefslogtreecommitdiff
path: root/spec/ruby/library
diff options
context:
space:
mode:
authorAlan Wu <[email protected]>2024-07-23 18:14:45 -0400
committerBenoit Daloze <[email protected]>2024-07-24 18:20:30 +0200
commit12e6cf77efae6804063dbebe84e4080ca78958e7 (patch)
tree010d5b0b824fb53722df576de43de8bd80d032cd /spec/ruby/library
parent1a18b03ee7b14771eae9eafa3c85a6bf5ccd9502 (diff)
Add "c_long_size" guard, supplanting "wordsize" and stop using Integer#size
What a "word" is when talking about sizes is confusing because it's a highly overloaded term. Intel, Microsoft, and GDB are just a few vendors that have their own definition of what a "word" is. Specs that used the "wordsize" guard actually were mostly testing for the size of the C `long` fundamental type, so rename the guard for clarity. Also, get the size of `long` directly from RbConfig instead of guessing using Integer#size. Integer#size is not guaranteed to have anything to do with the `long` type.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/11130
Diffstat (limited to 'spec/ruby/library')
-rw-r--r--spec/ruby/library/bigdecimal/sqrt_spec.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/spec/ruby/library/bigdecimal/sqrt_spec.rb b/spec/ruby/library/bigdecimal/sqrt_spec.rb
index 8fd1ec0f39..42cf4545cb 100644
--- a/spec/ruby/library/bigdecimal/sqrt_spec.rb
+++ b/spec/ruby/library/bigdecimal/sqrt_spec.rb
@@ -36,7 +36,7 @@ describe "BigDecimal#sqrt" do
BigDecimal('121').sqrt(5).should be_close(11, 0.00001)
end
- platform_is_not wordsize: 32 do # fails on i686
+ platform_is_not c_long_size: 32 do # fails on i686
it "returns square root of 0.9E-99999 with desired precision" do
@frac_2.sqrt(1).to_s.should =~ /\A0\.3E-49999\z/i
end