Spock Web Console

subscribe to the feed Subscribe
Testing max() function (via #spockwebconsole)
tweet this script Tweet

Testing max() function

Published 1 year ago by mmelnik with tags array parametrized unroll
Actions  ➤ Edit In Console Back To Console Show/Hide Line Numbers View Recent Scripts
import spock.lang.*

class MyFirstSpec extends Specification {

@Unroll("max(#a,#b) = #c")  
def "max function returns correct maximum"() {
    Math.max(a, b) == c
    a << [2,0,4]
    b << [1,1,3]
    c << [2,1,4]