[ 
https://issues.apache.org/jira/browse/GROOVY-8159?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15970511#comment-15970511
 ] 

Iurii commented on GROOVY-8159:
-------------------------------

Good question.
I don't see reason to use "Click to see difference" features for:
"assert variable" - it's just a boolean that is easy to see in output, there is 
no need to compare it with another value
"assert a > b" - in 99% it will be simple number, that is easy to see in output.

In my case, we often compare multiline strings (e.g. to test that generated 
code/sql/json/xml is the same as expected).
Does it worth to change output for "assert a ==b"?
As I can see, there are 214K asserts in Groovy code in all Github projects.
133K of them use "assert ... == ..."
It means that the change can be useful for 62% of asserts (see attachments, 
data 
generated based on 
http://glaforge.appspot.com/article/what-can-we-learn-from-million-lines-of-groovy-code-on-github
 )

I see this as "slightly different output" for "assert ... == ..." case only, 
that includes output for left and right expression in the same format as JUnit 
assertEquals provides.
"Evaluation result tracing" can be added later as "details".
What do you think about this?



> Make assert output easy to parse
> --------------------------------
>
>                 Key: GROOVY-8159
>                 URL: https://issues.apache.org/jira/browse/GROOVY-8159
>             Project: Groovy
>          Issue Type: Improvement
>          Components: groovy-runtime
>    Affects Versions: 2.4.10
>            Reporter: Iurii
>
> Based on https://youtrack.jetbrains.com/issue/IDEA-171275
> IntelliJ IDEA provides great feature: "Click to see difference" in test 
> console.
> It's very useful because it opens comparison windows where differences are 
> highlighted.
> It's supported for JUnit assertXXX but not for Groovy assert because: 
> "JUnit's ComparisonFailure contains all necessary data which can be rendered 
> later while Groovy's PowerAssertionError contains already rendered message 
> which is hard to parse (if it's even possible)"
> Can assert output be improved so that IDE can parse it?



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to