GroovyInAction icon indicating copy to clipboard operation
GroovyInAction copied to clipboard

Grammar wrong in GroovyInAction/listings/appD/Listing_D_02_Lists.groovy

Open gengjiawen opened this issue 8 years ago • 2 comments

Grammar wrong in GroovyInAction/listings/appD/Listing_D_02_Lists.groovy

Caught: Assertion failed: 

assert [1,2,3].permutations().toList() == [ [1, 2, 3], [2, 3, 1], [3, 2, 1], [3, 1, 2], [2, 1, 3], [1, 3, 2] ]
               |              |        |
               |              |        false
               |              [[1, 2, 3], [3, 2, 1], [2, 1, 3], [3, 1, 2], [1, 3, 2], [2, 3, 1]]
               [[1, 2, 3], [3, 2, 1], [2, 1, 3], [3, 1, 2], [1, 3, 2], [2, 3, 1]]

Assertion failed: 

assert [1,2,3].permutations().toList() == [ [1, 2, 3], [2, 3, 1], [3, 2, 1], [3, 1, 2], [2, 1, 3], [1, 3, 2] ]
               |              |        |
               |              |        false
               |              [[1, 2, 3], [3, 2, 1], [2, 1, 3], [3, 1, 2], [1, 3, 2], [2, 3, 1]]
               [[1, 2, 3], [3, 2, 1], [2, 1, 3], [3, 1, 2], [1, 3, 2], [2, 3, 1]]

    at Lists.run(Lists.groovy:38)

gengjiawen avatar Jul 23 '16 03:07 gengjiawen

Ok, thanks. I will investigate. What Groovy/Java version did you run it with?

Dierk

sent from:mobile

Am 23.07.2016 um 05:49 schrieb Jiawen Geng [email protected]:

Grammar wrong in GroovyInAction/listings/appD/Listing_D_02_Lists.groovy

Caught: Assertion failed:

assert [1,2,3].permutations().toList() == [ [1, 2, 3], [2, 3, 1], [3, 2, 1], [3, 1, 2], [2, 1, 3], [1, 3, 2] ] | | | | | false | [[1, 2, 3], [3, 2, 1], [2, 1, 3], [3, 1, 2], [1, 3, 2], [2, 3, 1]] [[1, 2, 3], [3, 2, 1], [2, 1, 3], [3, 1, 2], [1, 3, 2], [2, 3, 1]]

Assertion failed:

assert [1,2,3].permutations().toList() == [ [1, 2, 3], [2, 3, 1], [3, 2, 1], [3, 1, 2], [2, 1, 3], [1, 3, 2] ] | | | | | false | [[1, 2, 3], [3, 2, 1], [2, 1, 3], [3, 1, 2], [1, 3, 2], [2, 3, 1]] [[1, 2, 3], [3, 2, 1], [2, 1, 3], [3, 1, 2], [1, 3, 2], [2, 3, 1]]

at Lists.run(Lists.groovy:38)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

Dierk avatar Jul 23 '16 07:07 Dierk

Java 8 Groovy 2.4.7

gengjiawen avatar Jul 23 '16 07:07 gengjiawen