Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -344,30 +344,10 @@ class Ext <T extends Serializable, V extends Cloneable> {
snapshotter.assertThat(result.source).matchesSnapshot()
}

@Requires({ GroovyRuntimeUtil.groovy4orNewer })
def "Primitive types are used in AST transformation Groovy >= 4"() {
when:
def result = compiler.transpileWithImports('''
class TestSpec extends Specification {
def 'test'() {
expect:
true
when:
true
then:
thrown(RuntimeException)
}
}
''',
EnumSet.of(Show.METHODS),
CompilePhase.OUTPUT)

then:
textSnapshotter.assertThat(result.source).matchesSnapshot()
}
def "Primitive types are used in AST transformation"() {
given:
def snapshotId = GroovyRuntimeUtil.groovy4orNewer ? "groovy4" : ""

@Requires({ GroovyRuntimeUtil.groovy3orOlder })
def "Primitive types are used in AST transformation Groovy <= 3"() {
when:
def result = compiler.transpileWithImports('''
class TestSpec extends Specification {
Expand All @@ -385,6 +365,6 @@ class TestSpec extends Specification {
CompilePhase.OUTPUT)

then:
textSnapshotter.assertThat(result.source).matchesSnapshot()
textSnapshotter.assertThat(result.source).matchesSnapshot(snapshotId)
}
}