Skip to content

Commit

Permalink
make non-indy test more lenient
Browse files Browse the repository at this point in the history
  • Loading branch information
paulk-asert committed Mar 3, 2024
1 parent 61279a2 commit 4b4a464
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import org.codehaus.groovy.control.MultipleCompilationErrorsException
import org.junit.Test

import static groovy.test.GroovyAssert.assertScript
import static groovy.test.GroovyAssert.isAtLeastJdk
import static groovy.test.GroovyAssert.shouldFail

/**
Expand Down Expand Up @@ -108,7 +109,10 @@ final class ImmutableTransformTest {

@Test
void testCloneableFieldNotCloneableObject() {
shouldFail CloneNotSupportedException, '''import groovy.transform.*
// attempting to access the protected clone() method is illegal from JDK16
def expectedException = isAtLeastJdk('16.0') ? IllegalAccessException : CloneNotSupportedException
shouldFail expectedException, '''
import groovy.transform.*
class Dolly {
String name
}
Expand All @@ -125,7 +129,8 @@ final class ImmutableTransformTest {

@Test
void testImmutableListProp() {
def objects = new GroovyShell().evaluate '''import groovy.transform.*
def objects = new GroovyShell().evaluate '''
import groovy.transform.*
@Immutable class HasList {
char[] letters
List numbers
Expand Down

0 comments on commit 4b4a464

Please sign in to comment.