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

Add new test case for Dir.glob with sort kwarg [Feature #8709] #894

Merged
merged 1 commit into from
Nov 3, 2021

Conversation

Strech
Copy link
Contributor

@Strech Strech commented Nov 2, 2021

Cover the case when a non false value is given to the Dir.glob. Since we don't have type checks, I think it makes sense to cover that behaviour

@Strech Strech changed the title Add new test case for Dir.glob with sort kwarg Add new test case for Dir.glob with sort kwarg [Feature #8709] Nov 2, 2021
result = Dir.send(@method, '*', sort: 0)
result.should == result.sort

result = Dir.send(@method, '*', sort: nil)
Copy link
Member

@eregon eregon Nov 3, 2021

Choose a reason for hiding this comment

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

This one feels like a bug worth reporting to https://bugs.ruby-lang.org/projects/ruby-master/issues, could you do that?
nil is normally always considered false or have separate (unique to nil) semantics in Ruby.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, was a bit confused that nil doesn't change sorting, but at the same time, false feels like the only correct way to say – don't sort it!

Will report and attach the patch file

@eregon eregon merged commit 293d7e3 into ruby:master Nov 3, 2021
@Strech Strech deleted the add-dir-glob-sort-case branch November 3, 2021 17:39
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.

None yet

2 participants