-
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/3819
- Loading branch information
Showing
17 changed files
with
148 additions
and
146 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,13 @@ | ||
require_relative '../../spec_helper' | ||
require_relative '../../shared/queue/deque' | ||
require_relative '../../shared/types/rb_num2dbl_fails' | ||
|
||
describe "Queue#deq" do | ||
it_behaves_like :queue_deq, :deq, -> { Queue.new } | ||
end | ||
|
||
describe "Queue operations with timeout" do | ||
ruby_version_is "3.2" do | ||
it_behaves_like :rb_num2dbl_fails, nil, -> v { q = Queue.new; q.push(1); q.deq(timeout: v) } | ||
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,6 +1,13 @@ | ||
require_relative '../../spec_helper' | ||
require_relative '../../shared/queue/deque' | ||
require_relative '../../shared/types/rb_num2dbl_fails' | ||
|
||
describe "Queue#pop" do | ||
it_behaves_like :queue_deq, :pop, -> { Queue.new } | ||
end | ||
|
||
describe "Queue operations with timeout" do | ||
ruby_version_is "3.2" do | ||
it_behaves_like :rb_num2dbl_fails, nil, -> v { q = Queue.new; q.push(1); q.pop(timeout: v) } | ||
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,6 +1,13 @@ | ||
require_relative '../../spec_helper' | ||
require_relative '../../shared/queue/deque' | ||
require_relative '../../shared/types/rb_num2dbl_fails' | ||
|
||
describe "Queue#shift" do | ||
it_behaves_like :queue_deq, :shift, -> { Queue.new } | ||
end | ||
|
||
describe "Queue operations with timeout" do | ||
ruby_version_is "3.2" do | ||
it_behaves_like :rb_num2dbl_fails, nil, -> v { q = Queue.new; q.push(1); q.shift(timeout: v) } | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# | ||
# Shared tests for rb_num2dbl related conversion failures. | ||
# | ||
# Usage example: | ||
# it_behaves_like :rb_num2dbl_fails, nil, -> v { o = A.new; o.foo(v) } | ||
# | ||
|
||
describe :rb_num2dbl_fails, shared: true do | ||
it "fails if string is provided" do | ||
-> { @object.call("123") }.should raise_error(TypeError, "no implicit conversion to float from string") | ||
end | ||
|
||
it "fails if boolean is provided" do | ||
-> { @object.call(true) }.should raise_error(TypeError, "no implicit conversion to float from true") | ||
-> { @object.call(false) }.should raise_error(TypeError, "no implicit conversion to float from false") | ||
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
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
Oops, something went wrong.