Feature #1193

Justified Error Messages

Added by Simon Chiang about 6 years ago. Updated almost 4 years ago.

[ruby-core:22333]
Status:Closed
Priority:Normal
Assignee:Ryan Davis

Description

=begin
One nice thing about Test::Unit output is that failures are justified making string comparisons easier.

In Test::Unit

<"minitest/unit is a small and fast replacement for ruby's huge and slow test/unit."> expected but was
<"minitest/unit is a small and fast replaecment for ruby's huge and slow test/unit.">.

In MiniTest::Unit

Expected "minitest/unit is a small and fast replacement for ruby's huge and slow test/unit.", not
"minitest/unit is a small and fast replaecment for ruby's huge and slow test/unit.".

The error (replaecment) is harder to find when the output is not justified.

FYI I submitted this as a feature request to Ryan Davis on the Rubyforge site and he rejected the request. I am resubmitting it here because I feel it is quite important and trivial to implement.
=end

History

#1 Updated by Yukihiro Matsumoto about 6 years ago

=begin
Hi,

In message "Re: [Feature #1193] Justified Error Messages"
on Mon, 23 Feb 2009 01:44:46 +0900, Simon Chiang redmine@ruby-lang.org writes:

|One nice thing about Test::Unit output is that failures are justified making string comparisons easier.
|
|In Test::Unit
|
|<"minitest/unit is a small and fast replacement for ruby's huge and slow test/unit."> expected but was
|<"minitest/unit is a small and fast replaecment for ruby's huge and slow test/unit.">.

|FYI I submitted this as a feature request to Ryan Davis on the Rubyforge site and he rejected the request. I am resubmitting it here because I feel it is quite important and trivial to implement.

Your proposal seems reasonable, but since Ryan rejected (and he is the
maintainer), he must have his own reason to reject. You have to
persuade Ryan anyway. Could you show us his reason to reject?

                        matz.

=end

#2 Updated by Ryan Davis about 6 years ago

  • Priority changed from Normal to Low

=begin
Mommy says no so you go ask Daddy? Nice end run. Still no.
=end

#3 Updated by Daniel Berger about 6 years ago

=begin
Instead of relying on whitespace, I recommend a diff style of output. Kouhei implemented this in Test::Unit 2.x and it's great.

diff:
- minitest/unit is a small and fast replaecment for ruby's huge and slow test/unit
? -
+ minitest/unit is a small and fast replacement for ruby's huge and slow test/unit
? +
=end

#4 Updated by Yukihiro Matsumoto about 6 years ago

=begin
Hi,

In message "Re: [Feature #1193] Justified Error Messages"
on Thu, 5 Mar 2009 05:12:09 +0900, Ryan Davis redmine@ruby-lang.org writes:

|Mommy says no so you go ask Daddy? Nice end run. Still no.

But Daddy wants to know the reason. Could you briefly explain please?
For the record, I don't push you in any way, Ryan. I just want to know.

                        matz.

=end

#5 Updated by Simon Chiang about 6 years ago

=begin
Sorry for a long delay in response. Ryan gave me no reason and directed me at his unit_diff utility from ZenTest. The original ticket is here:

http://rubyforge.org/tracker/?func=detail&atid=4097&aid=23842&group_id=1040

As an FYI, I decided to re-post the request here because a response Ryan made to a different ticket made me (apparently mistakenly) believe that Ruby was maintaining a separate fork of MiniTest. The conversation is here:

http://rubyforge.org/tracker/?func=detail&atid=4097&aid=22274&group_id=1040

Thanks for looking at this.
=end

#6 Updated by Marc-Andre Lafortune over 5 years ago

  • Category set to lib
  • Assignee set to Ryan Davis

=begin

=end

#7 Updated by Yusuke Endoh about 5 years ago

  • Priority changed from Low to Normal

=begin
Hi,

One nice thing about Test::Unit output is that failures are justified making string comparisons easier.

You may want to take a look at the thread from .

Anyway, Ryan has a duty to reply this ticket.

--
Yusuke Endoh mame@tsg.ne.jp
=end

#8 Updated by Kazuhiro NISHIYAMA about 5 years ago

  • Status changed from Open to Assigned
  • Target version set to 2.0.0

=begin

=end

#9 Updated by Ryan Davis almost 4 years ago

  • Status changed from Assigned to Closed

The latest minitest's assert_equal uses diff where appropriate.

Also available in: Atom PDF