You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Henrik (Jira)" <ji...@apache.org> on 2020/07/24 08:42:00 UTC

[jira] [Updated] (GROOVY-9655) Groovy 3.0.5 regression with the "with" keyword

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

Henrik updated GROOVY-9655:
---------------------------
    Description: 
Since GROOVY-7701 was the only issue relating to {{with}} in Groovy 3.0.5, I think that fix might have broken behaviour in Spock (using 2.0-M3):

This works in 3.0.4:
{code:java}
static BOOKING = 123
def 'get stuff'() {
  given:
  def stuff = [ booking: 123 ]

  expect:
    with(stuff) {
      booking == BOOKING
    }
 }
{code}
But fails in 3.0.5 with:
{code:java}
Condition not satisfied:
booking == BOOKING
|       |  |
123     |  null
        false

{code}
 

  was:
Since GROOVY-7701 was the only issue relating to with in Groovy 3.0.5, I think that fix might have broken behaviour in Spock (using 2.0-M3):

This works in 3.0.4:

 
{code:java}
static BOOKING = 123
def 'get stuff'() {
  given:
  def stuff = [ booking: 123 ]

  expect:
    with(stuff) {
      booking == BOOKING
    }
 }
{code}
But fails in 3.0.5 with:

 
{code:java}
Condition not satisfied:
booking == BOOKING
|       |  |
123     |  null
        false
 
{code}
 


> Groovy 3.0.5 regression with the "with" keyword
> -----------------------------------------------
>
>                 Key: GROOVY-9655
>                 URL: https://issues.apache.org/jira/browse/GROOVY-9655
>             Project: Groovy
>          Issue Type: Bug
>    Affects Versions: 3.0.5
>            Reporter: Henrik
>            Priority: Critical
>              Labels: regression
>
> Since GROOVY-7701 was the only issue relating to {{with}} in Groovy 3.0.5, I think that fix might have broken behaviour in Spock (using 2.0-M3):
> This works in 3.0.4:
> {code:java}
> static BOOKING = 123
> def 'get stuff'() {
>   given:
>   def stuff = [ booking: 123 ]
>   expect:
>     with(stuff) {
>       booking == BOOKING
>     }
>  }
> {code}
> But fails in 3.0.5 with:
> {code:java}
> Condition not satisfied:
> booking == BOOKING
> |       |  |
> 123     |  null
>         false
> {code}
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)