StringIO#rewind doesn't clear EOF flag, fails new rubyspec
----------------------------------------------------------
Key: JRUBY-2362
URL: http://jira.codehaus.org/browse/JRUBY-2362
Project: JRuby
Issue Type: Bug
Affects Versions: JRuby 1.1
Environment: Latest JRuby 1.1
Reporter: Vladimir Sizikov
Assignee: Vladimir Sizikov
Fix For: JRuby 1.1.1
The following example:
{noformat}
require 'stringio'
@io = StringIO.new("hello\nworld")
str = @io.string
p @io.read(@io.string.length + 1)
@io.rewind
p @io.read(@io.string.length + 1)
{noformat}
Returns on MRI:
"hello\nworld"
"hello\nworld"
But on JRuby:
"hello\nworld"
nil
It causes one rubyspec failure too:
{noformat}
#>bin/mspec ci -t j -X /opt/work/jruby.git/test/spec_excludes
spec/ruby/1.8/library/stringio/rewind_spec.rb
..F
1)
StringIO#rewind should make the contents of the stream accessible again when
stream was read beyond its end FAILED
Expected nil
to equal "hello\nworld"
/opt/work/rbx.git/./mspec/expectations.rb:10:in `fail_with'
/opt/work/rbx.git/./mspec/matchers/base.rb:8:in `=='
/opt/work/rbx.git/./spec/ruby/1.8/library/stringio/rewind_spec.rb:28:in
`/opt/work/rbx.git/./spec/ruby/1.8/library/stringio/rewind_spec.rb'
/opt/work/rbx.git/./mspec/runner/mspec.rb:112:in `call'
/opt/work/rbx.git/./mspec/runner/mspec.rb:112:in `protect'
/opt/work/rbx.git/./mspec/runner/state.rb:46:in `each'
/opt/work/rbx.git/./mspec/runner/state.rb:46:in `protect'
/opt/work/rbx.git/./mspec/runner/state.rb:60:in `process'
/opt/work/rbx.git/./mspec/runner/state.rb:56:in `each'
/opt/work/rbx.git/./mspec/runner/state.rb:56:in `process'
/opt/work/rbx.git/./mspec/runner/mspec.rb:19:in `describe'
/opt/work/rbx.git/./mspec/runner/object.rb:11:in `describe'
/opt/work/rbx.git/./spec/ruby/1.8/library/stringio/rewind_spec.rb:4:in
`/opt/work/rbx.git/./spec/ruby/1.8/library/stringio/rewind_spec.rb'
/opt/work/rbx.git/./spec/ruby/1.8/library/stringio/rewind_spec.rb:37:in `load'
/opt/work/rbx.git/./mspec/runner/mspec.rb:37:in `files'
/opt/work/rbx.git/./mspec/runner/mspec.rb:112:in `call'
/opt/work/rbx.git/./mspec/runner/mspec.rb:112:in `protect'
/opt/work/rbx.git/./mspec/runner/mspec.rb:37:in `files'
/opt/work/rbx.git/./mspec/runner/mspec.rb:34:in `each'
/opt/work/rbx.git/./mspec/runner/mspec.rb:34:in `files'
/opt/work/rbx.git/./mspec/runner/mspec.rb:26:in `process'
mspec/bin/mspec-ci:66:in `run'
/opt/work/rbx.git/./mspec/bin/script.rb:65:in `main'
mspec/bin/mspec-ci:71
Finished in 0.234000 seconds
{noformat}
Will fix.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email