import spock.lang.* class TweakSequenceUtilSpecification extends Specification { @Unroll @TweakSequence def "#iterationCount): sequence using indexReplacements column correctly results as #result"() { expect: sequence == result where: result | sequence | indexReplacements [ 1, 99, 3 ] | [ 1, 2, 3 ] | [ 1: 99 ] [ 1, 99, 3 ] | [ range: [ start: 1, end: 3 ] ] | [ 1: 99 ] } @Unroll @TweakSequence def "#iterationCount): sequence or range specified with tweaks in a single map correctly results in #result"() { expect: sequence == result where: result | sequence [ 1, 2, 3 ] | [ 1, 2, 3 ] [ 1, 2, 3 ] | [ range: [ start: 1, end: 3 ] ] [ 1, 99, 3 ] | [ range: [ start: 1, end: 3 ], indexReplacements: [ 1: 99 ] ] [ 1, 99, 3 ] | [ sequence: [ 1, 2, 3 ], indexReplacements: [ 1: 99 ] ] } @Unroll @TweakSequence def "#iterationCount): sequence using tweak column correctly results as #result"() { expect: sequence == result where: result | sequence | tweaks [ 1, 3 ] | [ 1, 2, 3 ] | [ valueExclusions: [ 2 ] ] [ 1, 3 ] | [ range: [ start: 1, end: 3 ] ] | [ valueExclusions: [ 2 ] ] } @Unroll @TweakSequence( tweaksParameterName = "otherTweaks" ) def "#iterationCount): alternate tweaks column: sequence using tweak column correctly results as #result"() { expect: sequence == result where: result | sequence | otherTweaks [ 1, 3 ] | [ 1, 2, 3 ] | [ valueExclusions: [ 2 ] ] [ 1, 3 ] | [ range: [ start: 1, end: 3 ] ] | [ valueExclusions: [ 2 ] ] } @Unroll @TweakSequence( sequenceParameterName = "A" ) def "#iterationCount): alternate sequence name: sequence #A embedded in map correctly results as #result"() { expect: A == result where: result | A [ 1, 2, 3 ] | [ 1, 2, 3 ] [ 1, 2, 3 ] | [ A: [ 1, 2, 3 ] ] [ 1, 99, 3 ] | [ A: [ 1, 2, 3 ], indexReplacements: [ 1: 99 ] ] } }