Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Print beginless ranges properly #21

Merged
merged 1 commit into from
Jan 15, 2024

Conversation

segiddins
Copy link
Contributor

Instead of displaying the start of the range as nil

Instead of displaying the start of the range as nil
@segiddins
Copy link
Contributor Author

cc @eregon / @hsbt

Copy link
Member

@eregon eregon left a comment

Choose a reason for hiding this comment

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

Looks good, thanks!

assert_equal("0..1\n", PP.pp(0..1, "".dup))
assert_equal("0...1\n", PP.pp(0...1, "".dup))
assert_equal("0...\n", PP.pp(0..., "".dup))
assert_equal("...1\n", PP.pp(...1, "".dup))
Copy link
Member

Choose a reason for hiding this comment

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

It might be wroth to test a beginless endless range too

@eregon eregon merged commit f96c02c into ruby:master Jan 15, 2024
18 checks passed
@segiddins segiddins deleted the segiddins/fix-beginless-ranges branch September 12, 2024 00:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants