You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Michał Gazda (JIRA)" <ji...@apache.org> on 2018/02/01 11:49:00 UTC

[jira] [Updated] (GROOVY-8151) Unreadable assert output

     [ https://issues.apache.org/jira/browse/GROOVY-8151?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michał Gazda updated GROOVY-8151:
---------------------------------
    Attachment: image-2018-02-01-12-48-26-783.png

> Unreadable assert output
> ------------------------
>
>                 Key: GROOVY-8151
>                 URL: https://issues.apache.org/jira/browse/GROOVY-8151
>             Project: Groovy
>          Issue Type: Bug
>    Affects Versions: 2.4.10
>         Environment: Windows 7, JDK 1.8.0_66
>            Reporter: Iurii
>            Priority: Major
>         Attachments: image-2018-02-01-12-48-12-547.png, image-2018-02-01-12-48-26-783.png, image-2018-02-01-12-48-52-359.png
>
>
> {code}
> class Test {
>     static void main(String[] args) {
>         assert 'test' == transform('test')
>     }
>     static String transform(String str) {
>         str + 'aaa'
>     }
> }
> {code}
> Output:
> {code}
> Exception in thread "main" Assertion failed: 
> assert 'test' == transform('test')
> {code}
> It's unclear from the output what was the right hand value.
> E.g. the following code shows readable error message:
> {code}
> class Test {
>     static void main(String[] args) {
>         assert 'test' == transform('test').toString()
>     }
>     static String transform(String str) {
>         str + 'aaa'
>     }
> }
> {code}
> Output:
> {code}
> Exception in thread "main" Assertion failed: 
> assert 'test' == transform('test').toString()
>                                          |
>                                          testaaa
> {code}
> Expected:
> the first code example should show the right hand value in the output



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)