You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by GitBox <gi...@apache.org> on 2019/08/06 15:54:14 UTC

[GitHub] [groovy] MykolaGolubyev edited a comment on issue #895: GROOVY-7954 Fix equality check in special case

MykolaGolubyev edited a comment on issue #895: GROOVY-7954 Fix equality check in special case
URL: https://github.com/apache/groovy/pull/895#issuecomment-518730902
 
 
   Thank you for working on this. I just hit an example where `lhs` implements `compareTo` in a way that `rhs` doesn't need to be `Comparable`. It is in the context of a testing framework I work on and DSL surrounding it.
   
   https://github.com/twosigma/webtau/blob/e1d20cdaf12df6250c1a86034a3451bb9dc14423/webtau-http-groovy/src/test/groovy/com/twosigma/webtau/http/GroovyDataNodeTest.groovy#L107
   
   ```
   @Test
   void "compare to complex values"() {
       def node = new GroovyDataNode(DataNodeBuilder.fromValue(new DataNodeId('test'), [1, 2, 3]))
   
       if (node == [1, 2, 3]) {
           // TODO
           // https://issues.apache.org/jira/browse/GROOVY-7954
           // this case is still not covered: left side is Comparable and its implementation would return 0 in this case
           // but the compareTo code is not being triggered
           throw new UnsupportedOperationException("once this is fixed in groovy we should update examples and docs")
       }
   }
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services