Skip to content

Conversation

@herwinw
Copy link
Member

@herwinw herwinw commented Jan 29, 2026

Float::INIFINITY is now supported, but -Float::INFINITY and Float::NAN are other special values.

The negative infinity value overlaps with the regular negative values, but it does cover the scenario where a Ruby implementation would just check for float.infinity? in a boolean context for no timeout.


ruby_version_is "4.0" do
it "raises an ArgumentError when passed negative infinity as timeout" do
-> { IO.select(nil, nil, nil, -Float::INFINITY)}.should raise_error(ArgumentError)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the exception messages are meaningful it seems worth specifying it them here.
It'll also convenient when implementing those semantics, vs having to check what message CRuby uses.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one is the same as the negative finite value. For consistency, I added a check for that case as well.

@eregon
Copy link
Member

eregon commented Jan 30, 2026

Feel free to merge yourself, I won't merge now in case you want to change something re #1338 (comment)

@herwinw herwinw force-pushed the io_select_negative_infinity_timeout branch from c2df414 to c5ad958 Compare February 2, 2026 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants