Last active
August 29, 2015 13:59
-
-
Save mperry/10692600 to your computer and use it in GitHub Desktop.
Example of found defect in Groovy 2.3.0-beta-2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* This scripts runs successfully with Groovy 2.2.2, but not with Groovy 2.3.0-beta-2 | |
*/ | |
@Grab('junit:junit:4.11') | |
import groovy.transform.TypeChecked | |
import org.junit.Test | |
import static org.junit.Assert.assertTrue | |
/** | |
* Created by MarkPerry on 15/04/2014. | |
*/ | |
@TypeChecked | |
class TestEquals { | |
static <A> Set<List<A>> create(List<A> list) { | |
[list].toSet() | |
} | |
@Test | |
void test1() { | |
assertTrue(true) | |
def expected = [[1, 2]].toSet() | |
def s = create([1, 2]) | |
assertTrue(expected == [[1, 2]].toSet()) | |
assertTrue(expected == expected) | |
assertTrue(expected == create([1, 2])) | |
assertTrue(expected == s) | |
// type check fails next 2 lines | |
assertTrue(s == expected) | |
assertTrue(create([1, 2]) == expected) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment