-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Description
Describe the bug
While using Spock framework in Groovy translations, data-driven tests with @Unroll
-ed titles produce unclosed test group what results in wrong output:
To Reproduce
Run following test suite in Groovy kumite:
import spock.lang.*
class SubmissionTests extends Specification {
def "Fixed tests"(int n, int exp) {
expect:
Kata.nextHigher(n) == exp
where:
n | exp
128 | 256
1 | 2
1022 | 1279
127 | 191
1253343 | 1253359
0x0C000000 | 0x10000001
0x2FFFFFFF | 0x37FFFFFF
}
}
class RandomTests extends Specification {
@Unroll
def "nextHigher(#n) should be #exp"() {
expect:
Kata.nextHigher(n) == exp
where:
[n, exp] << [
[ 128, 256],
[ 1, 2],
[ 1022, 1279],
[ 127, 191],
[ 1253343, 1253359],
[ 0x0C000000, 0x10000001],
[ 0x2FFFFFFF, 0x37FFFFFF]
]
}
}
Additional context
One alternative would be to use JUnit 5, but Groovy setup is missing packages necessary to create parametrized tests (see #301).