@@ -125,6 +125,10 @@ def test_merge():
125125 res = vmerge0 .run ()
126126 yield assert_false , isdefined (res .outputs .out )
127127
128+ vmerge0 .inputs .in_lists = [0 , [1 , 2 ], [3 , 4 , 5 ]]
129+ res = vmerge0 .run ()
130+ yield assert_equal , res .outputs .out , [0 , 1 , 2 , 3 , 4 , 5 ]
131+
128132 hmerge3 = pe .Node (utility .Merge (3 , axis = 'hstack' ), name = 'hmerge3' )
129133 hmerge3 .inputs .in1 = [0 ]
130134 hmerge3 .inputs .in2 = [1 , 2 ]
@@ -136,6 +140,19 @@ def test_merge():
136140 hmerge3 .inputs .in3 = [4 , 5 ]
137141 res = hmerge3 .run ()
138142 yield assert_equal , res .outputs .out , [[0 , 2 , 4 ], [1 , 3 , 5 ]]
143+
144+ hmerge0 = pe .Node (utility .Merge (axis = 'hstack' ), name = 'hmerge0' )
145+ # Note: Merge(0, axis='hstack') would error on run, prior to
146+ # in_lists implementation
147+ res = hmerge0 .run ()
148+ yield assert_false , isdefined (res .outputs .out )
149+
150+ hmerge0 .inputs .in_lists = [[0 ], [1 , 2 ], [3 , 4 , 5 ]]
151+ res = hmerge0 .run ()
152+ yield assert_equal , res .outputs .out , [[0 , 1 , 3 ]]
153+ hmerge0 .inputs .in_lists = [[0 , 1 ], [2 , 3 ], [4 , 5 ]]
154+ res = hmerge0 .run ()
155+ yield assert_equal , res .outputs .out , [[0 , 2 , 4 ], [1 , 3 , 5 ]]
139156 finally :
140157 os .chdir (origdir )
141158 shutil .rmtree (tempdir )
0 commit comments