Hi

the #assert:equals method is often used in Test cases: we have 2491 senders in 
recent Pharo5.0 Latest update: #50487.

Anytime I have to debug a failing test using it I find it hard to compare the
expected and actual value when it is a string in the debugger panes.

Pharo tools come to the rescue because we already have a differ inside the 
image.

I would therefore propose to add the following comment into 
TAssertable>>#assert:equals: 

  assert: actual equals: expected
        " DiffModel new
                showOptions: true;
                leftText: actual;
                rightText: expected;
                contextClass: nil;
                openWithSpec "

        ^ self
                assert: expected = actual
                description: [self comparingStringBetween: actual and: expected]

With this additional comment one can quickly open the diff tool and check the 
differences in the 
expected vs. actual string. Directly by evaluating the commented expression in 
the debugger.

What do you think? Should we add it? Are there any other solutions to quicly 
find the differences?

Thanks
T. 

Reply via email to