diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2023-09-07 11:47:43 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2023-09-14 14:57:57 +0900 |
commit | b6de0a6c69a4857ca4347f65d7c9a5cb6e52c5bd (patch) | |
tree | 6b90f30c0c988ce997c204d478e3074fb05845ba /test/ruby/test_process.rb | |
parent | efe5e6e8d05d607dde38ece66e035b8e746e65fb (diff) |
[Bug #19868] Suggest other Process::Status method for `&` and `>>`
`Process::Status#&` and `Process::Status#>>` are provided only for
the backward compatibility with older Ruby than 1.8 where `$?` was
a `Fixnum`, and the knowledge about internals of system dependent
macros is necessary to use them. Modern programs and libraries
should not need these methods.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/8392
Diffstat (limited to 'test/ruby/test_process.rb')
-rw-r--r-- | test/ruby/test_process.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/test/ruby/test_process.rb b/test/ruby/test_process.rb index 341bbebb35..d1fb8d366a 100644 --- a/test/ruby/test_process.rb +++ b/test/ruby/test_process.rb @@ -1451,8 +1451,12 @@ class TestProcess < Test::Unit::TestCase assert_equal(s, s) assert_equal(s, s.to_i) - assert_equal(s.to_i & 0x55555555, s & 0x55555555) - assert_equal(s.to_i >> 1, s >> 1) + assert_warn(/\bUse .*Process::Status/) do + assert_equal(s.to_i & 0x55555555, s & 0x55555555) + end + assert_warn(/\bUse .*Process::Status/) do + assert_equal(s.to_i >> 1, s >> 1) + end assert_raise(ArgumentError) do s >> -1 end |