Skip to content
Permalink
Browse files
GROOVY-10434: ClassNode isSealed() refactoring (additional test)
  • Loading branch information
paulk-asert committed Jan 22, 2022
1 parent 7fb4b98 commit bcfd3ba2dda92b52c634d6aad29da379767961ff
Showing 1 changed file with 15 additions and 0 deletions.
@@ -233,4 +233,19 @@ class SealedTransformTest {
sealed class Other permits Other { }
''').message.contains(expected)
}

@Test
void testClassNodeIsSealed() {
assertScript '''
import groovy.transform.*
import org.codehaus.groovy.control.CompilePhase
@ASTTest(phase = CompilePhase.SEMANTIC_ANALYSIS, value = {
assert node.permittedSubclasses*.name == ['Bar']
assert node.isSealed()
})
sealed class Foo permits Bar {}
final class Bar {}
new Foo()
'''
}
}

0 comments on commit bcfd3ba

Please sign in to comment.