@@ -160,6 +160,10 @@ def test_merge():
160
160
res = vmerge0 .run ()
161
161
yield assert_false , isdefined (res .outputs .out )
162
162
163
+ vmerge0 .inputs .in_lists = [0 , [1 , 2 ], [3 , 4 , 5 ]]
164
+ res = vmerge0 .run ()
165
+ yield assert_equal , res .outputs .out , [0 , 1 , 2 , 3 , 4 , 5 ]
166
+
163
167
hmerge3 = pe .Node (utility .Merge (3 , axis = 'hstack' ), name = 'hmerge3' )
164
168
hmerge3 .inputs .in1 = [0 ]
165
169
hmerge3 .inputs .in2 = [1 , 2 ]
@@ -171,6 +175,19 @@ def test_merge():
171
175
hmerge3 .inputs .in3 = [4 , 5 ]
172
176
res = hmerge3 .run ()
173
177
yield assert_equal , res .outputs .out , [[0 , 2 , 4 ], [1 , 3 , 5 ]]
178
+
179
+ hmerge0 = pe .Node (utility .Merge (axis = 'hstack' ), name = 'hmerge0' )
180
+ # Note: Merge(0, axis='hstack') would error on run, prior to
181
+ # in_lists implementation
182
+ res = hmerge0 .run ()
183
+ yield assert_false , isdefined (res .outputs .out )
184
+
185
+ hmerge0 .inputs .in_lists = [[0 ], [1 , 2 ], [3 , 4 , 5 ]]
186
+ res = hmerge0 .run ()
187
+ yield assert_equal , res .outputs .out , [[0 , 1 , 3 ]]
188
+ hmerge0 .inputs .in_lists = [[0 , 1 ], [2 , 3 ], [4 , 5 ]]
189
+ res = hmerge0 .run ()
190
+ yield assert_equal , res .outputs .out , [[0 , 2 , 4 ], [1 , 3 , 5 ]]
174
191
finally :
175
192
os .chdir (origdir )
176
193
shutil .rmtree (tempdir )
0 commit comments