-
Notifications
You must be signed in to change notification settings - Fork 185
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PullRequest: truffleruby/4423
- Loading branch information
Showing
40 changed files
with
764 additions
and
260 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,35 @@ | ||
require_relative '../../../spec_helper' | ||
|
||
describe "Process::Status#&" do | ||
it "needs to be reviewed for spec completeness" | ||
it "returns a bitwise and of the integer status of an exited child" do | ||
suppress_warning do | ||
ruby_exe("exit(29)", exit_status: 29) | ||
($? & 0).should == 0 | ||
($? & $?.to_i).should == $?.to_i | ||
|
||
# Actual value is implementation specific | ||
platform_is :linux do | ||
# 29 == 0b11101 | ||
($? & 0b1011100000000).should == 0b1010100000000 | ||
end | ||
end | ||
end | ||
|
||
ruby_version_is "3.3" do | ||
it "raises an ArgumentError if mask is negative" do | ||
suppress_warning do | ||
ruby_exe("exit(0)") | ||
-> { | ||
$? & -1 | ||
}.should raise_error(ArgumentError, 'negative mask value: -1') | ||
end | ||
end | ||
|
||
it "shows a deprecation warning" do | ||
ruby_exe("exit(0)") | ||
-> { | ||
$? & 0 | ||
}.should complain(/warning: Process::Status#& is deprecated and will be removed .*use other Process::Status predicates instead/) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,34 @@ | ||
require_relative '../../../spec_helper' | ||
|
||
describe "Process::Status#>>" do | ||
it "needs to be reviewed for spec completeness" | ||
it "returns a right shift of the integer status of an exited child" do | ||
suppress_warning do | ||
ruby_exe("exit(29)", exit_status: 29) | ||
($? >> 0).should == $?.to_i | ||
($? >> 1).should == $?.to_i >> 1 | ||
|
||
# Actual value is implementation specific | ||
platform_is :linux do | ||
($? >> 8).should == 29 | ||
end | ||
end | ||
end | ||
|
||
ruby_version_is "3.3" do | ||
it "raises an ArgumentError if shift value is negative" do | ||
suppress_warning do | ||
ruby_exe("exit(0)") | ||
-> { | ||
$? >> -1 | ||
}.should raise_error(ArgumentError, 'negative shift value: -1') | ||
end | ||
end | ||
|
||
it "shows a deprecation warning" do | ||
ruby_exe("exit(0)") | ||
-> { | ||
$? >> 0 | ||
}.should complain(/warning: Process::Status#>> is deprecated and will be removed .*use other Process::Status attributes instead/) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
describe :refinement_target, shared: true do | ||
it "returns the class refined by the receiver" do | ||
refinement_int = nil | ||
|
||
Module.new do | ||
refine Integer do | ||
refinement_int = self | ||
end | ||
end | ||
|
||
refinement_int.send(@method).should == Integer | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
require_relative "../../spec_helper" | ||
require_relative 'shared/target' | ||
|
||
describe "Refinement#target" do | ||
ruby_version_is "3.3" do | ||
it_behaves_like :refinement_target, :target | ||
end | ||
end |
Oops, something went wrong.