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

Update getline logic to match C version #61

Merged
merged 2 commits into from
Aug 15, 2023

Conversation

headius
Copy link
Contributor

@headius headius commented Aug 10, 2023

See commits:

headius added a commit to headius/jruby that referenced this pull request Aug 10, 2023
* Adds StringIO::VERSION to the JRuby library (ruby/stringio#57)
* Tags two specs for getline para behavior new after 3.0.6 (ruby/stringio#61)
@headius
Copy link
Contributor Author

headius commented Aug 10, 2023

No rush on this. It fixes two new rubyspecs for altered paragraph behavior:

1)
StringIO#each_line when passed a separator yields each paragraph with all separation characters when passed an empty String as separator FAILED
Expected ["para1\n" + "\n", "para2\n" + "\n", "para3"] == ["para1\n" + "\n", "para2\n" + "\n" + "\n", "para3"]
to be truthy but was false
/Users/headius/work/jruby/spec/ruby/library/stringio/shared/each.rb:53:in `block in <main>'
org/jruby/RubyBasicObject.java:2613:in `instance_exec'
org/jruby/RubyArray.java:4920:in `all?'
org/jruby/RubyArray.java:1989:in `each'
/Users/headius/work/jruby/spec/ruby/library/stringio/each_line_spec.rb:5:in `<main>'
org/jruby/RubyKernel.java:1105:in `load'
org/jruby/RubyBasicObject.java:2613:in `instance_exec'
org/jruby/RubyArray.java:1989:in `each'
                                                                                             
2)
StringIO#each when passed a separator yields each paragraph with all separation characters when passed an empty String as separator FAILED
Expected ["para1\n" + "\n", "para2\n" + "\n", "para3"] == ["para1\n" + "\n", "para2\n" + "\n" + "\n", "para3"]
to be truthy but was false
/Users/headius/work/jruby/spec/ruby/library/stringio/shared/each.rb:53:in `block in <main>'
org/jruby/RubyBasicObject.java:2613:in `instance_exec'
org/jruby/RubyArray.java:4920:in `all?'
org/jruby/RubyArray.java:1989:in `each'
/Users/headius/work/jruby/spec/ruby/library/stringio/each_spec.rb:5:in `<main>'
org/jruby/RubyKernel.java:1105:in `load'
org/jruby/RubyBasicObject.java:2613:in `instance_exec'
org/jruby/RubyArray.java:1989:in `each'

headius added a commit to headius/jruby that referenced this pull request Aug 10, 2023
* Adds StringIO::VERSION to the JRuby library (ruby/stringio#57)
* Tags two specs for getline para behavior new after 3.0.6 (ruby/stringio#61)
@kou
Copy link
Member

kou commented Aug 11, 2023

It seems that this fixes test_each_string_sep but these referred commits update test_gets_chomp, test_gets_chomp_eol and test_each. They are still failing. Is it intentional? (They will be fixed later?)

@headius
Copy link
Contributor Author

headius commented Aug 14, 2023

@kou Oh I will look into that!

@headius
Copy link
Contributor Author

headius commented Aug 14, 2023

@kou Those tests were added with a separate "partial fix" I missed. I've applied the same fix for JRuby and those tests pass now.

See feaa2ec

Copy link
Member

@kou kou left a comment

Choose a reason for hiding this comment

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

+1

@kou kou merged commit e6a85ba into ruby:master Aug 15, 2023
@headius headius deleted the fix_jruby_paragraph_mode branch August 15, 2023 15:35
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