ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:23267] StringIO: RubySpec violation
@ 2009-04-20 19:56 Hongli Lai
  2009-04-20 20:15 ` [ruby-core:23268] " Urabe Shyouhei
  0 siblings, 1 reply; 5+ messages in thread
From: Hongli Lai @ 2009-04-20 19:56 UTC (permalink / raw
  To: ruby-core

I ran RubySpec against the 1.8.6-p368 release. It seems that 
StringIO#ungetc changed.

p368:
irb(main):001:0> io = StringIO.new("1234")
=> #<StringIO:0x208f14>
irb(main):002:0> io.ungetc(65)
=> nil
irb(main):003:0> io.string
=> "A1234"


p287:
irb(main):001:0> io = StringIO.new("1234")
=> #<StringIO:0x208fa0>
irb(main):002:0> io.ungetc(65)
=> nil
irb(main):003:0> io.string
=> "1234"

1.9:
=> #<StringIO:0x419948>
irb(main):002:0> io.ungetc(65)
=> nil
irb(main):003:0> io.string
=> "A1234"
irb(main):004:0>

Is this intentional?

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [ruby-core:23268] Re: StringIO: RubySpec violation
  2009-04-20 19:56 [ruby-core:23267] StringIO: RubySpec violation Hongli Lai
@ 2009-04-20 20:15 ` Urabe Shyouhei
  2009-04-20 20:29   ` [ruby-core:23269] " Hongli Lai
  0 siblings, 1 reply; 5+ messages in thread
From: Urabe Shyouhei @ 2009-04-20 20:15 UTC (permalink / raw
  To: ruby-core

Hongli Lai wrote:
> Is this intentional?

Yes. http://redmine.ruby-lang.org/issues/show/701

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [ruby-core:23269] Re: StringIO: RubySpec violation
  2009-04-20 20:15 ` [ruby-core:23268] " Urabe Shyouhei
@ 2009-04-20 20:29   ` Hongli Lai
  2009-04-20 20:37     ` [ruby-core:23270] " Urabe Shyouhei
  0 siblings, 1 reply; 5+ messages in thread
From: Hongli Lai @ 2009-04-20 20:29 UTC (permalink / raw
  To: ruby-core

Urabe Shyouhei wrote:
> Hongli Lai wrote:
>> Is this intentional?
> 
> Yes. http://redmine.ruby-lang.org/issues/show/701
> 
> 

But is the backport to the 1.8.6 series intentional as well? I thought 
behavior changes like this are reserved for the 1.8.7 series.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [ruby-core:23270] Re: StringIO: RubySpec violation
  2009-04-20 20:29   ` [ruby-core:23269] " Hongli Lai
@ 2009-04-20 20:37     ` Urabe Shyouhei
  2009-04-20 20:48       ` [ruby-core:23271] " Urabe Shyouhei
  0 siblings, 1 reply; 5+ messages in thread
From: Urabe Shyouhei @ 2009-04-20 20:37 UTC (permalink / raw
  To: ruby-core

Hongli Lai wrote:
> Urabe Shyouhei wrote:
>> Hongli Lai wrote:
>>> Is this intentional?
>>
>> Yes. http://redmine.ruby-lang.org/issues/show/701
>>
>>
> 
> But is the backport to the 1.8.6 series intentional as well? I thought
> behavior changes like this are reserved for the 1.8.7 series.

The answer is yes; it seemed to me a bug anyway for stringio to silently ignore
 a passed argument.  I thought it should accept that (as it does now), or at
least raise an exception such as IndexError.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [ruby-core:23271] Re: StringIO: RubySpec violation
  2009-04-20 20:37     ` [ruby-core:23270] " Urabe Shyouhei
@ 2009-04-20 20:48       ` Urabe Shyouhei
  0 siblings, 0 replies; 5+ messages in thread
From: Urabe Shyouhei @ 2009-04-20 20:48 UTC (permalink / raw
  To: ruby-core

Urabe Shyouhei wrote:
> The answer is yes; it seemed to me a bug anyway for stringio to silently ignore
>  a passed argument.  I thought it should accept that (as it does now), or at
> least raise an exception such as IndexError.

Hmm, maybe IOError is the best exception to raise because IO#ungetc raises it
in case of failures.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-04-20 20:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-20 19:56 [ruby-core:23267] StringIO: RubySpec violation Hongli Lai
2009-04-20 20:15 ` [ruby-core:23268] " Urabe Shyouhei
2009-04-20 20:29   ` [ruby-core:23269] " Hongli Lai
2009-04-20 20:37     ` [ruby-core:23270] " Urabe Shyouhei
2009-04-20 20:48       ` [ruby-core:23271] " Urabe Shyouhei

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).