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

Dir.glob does not find files if pattern contains some sets #7115

Open
ChristophHartwigOSP opened this issue Feb 23, 2022 · 0 comments
Open

Comments

@ChristophHartwigOSP
Copy link

Dir.glob won't find files if pattern contains sets like [^DONE] or even simpler sets. One character sets seem to work, but not with negation.

Expected Behavior
JRuby should work like cruby variant:
ruby 2.6.9p207 (2021-11-24 revision 67954) [x86_64-linux]
irb
2.6.9 :001 > File.new("test.rb",'w')
=> #File:test.rb
2.6.9 :002 > Dir.glob("test.rb")
=> ["test.rb"]
2.6.9 :003 > Dir.glob("test*[^DONE]")
=> ["test.rb"]
2.6.9 :004 > Dir.glob("test*[b]")
=> ["test.rb"]
2.6.9 :005 > Dir.glob("test*[rb]")
=> ["test.rb"]
2.6.9 :006 > Dir.glob("test*[^r]")
=> ["test.rb"]

Actual Behavior

jruby 9.3.3.0 (2.6.8) 2022-01-19 b26de1f Java HotSpot(TM) 64-Bit Server VM 10.0.1+10 on 10.0.1+10 +jit [linux-x86_64]
irb
jruby-9.3.3.0 :001 > File.new("test.rb",'w')
=> #File:test.rb
jruby-9.3.3.0 :002 > Dir.glob("test.rb")
=> ["test.rb"]
jruby-9.3.3.0 :003 > Dir.glob("test*[^DONE]")
=> []
jruby-9.3.3.0 :004 > Dir.glob("test*[b]")
=> ["test.rb"]
jruby-9.3.3.0 :005 > Dir.glob("test*[rb]")
=> []
jruby-9.3.3.0 :006 > Dir.glob("test*[^r]")
=> []

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

No branches or pull requests

1 participant