unit testing - Create a combination on input in Spock test -


in spock test current block

where:         [a,b,c] <<          [             ["a1","b1","c1"],             ["a1","b1","c2"],         ] 

i trying simplify since input , b same. trying use combinations() have been unsuccessful.

i want same job code above.

where:         [[a,b],[c]] <<                 // incorrect         [             [["a1","b1"],["c1","c2"]].combinations()  // incorrect         ]    

currently npe

here 1 solution:

where: [a, b, c] << [[["a1","b1"]],["c1","c2"]].combinations()*.flatten() 

Comments

Popular posts from this blog

c# - How Configure Devart dotConnect for SQLite Code First? -

c++ - Clear the memory after returning a vector in a function -

erlang - Saving a digraph to mnesia is hindered because of its side-effects -