@@ -9,13 +9,54 @@ echo '5' > 5 &&
99echo 'p1.forward' > p1.forward &&
1010echo 'p1.reverse' > p1.reverse &&
1111echo 'p2.forward' > p2.forward &&
12- echo 'p2.reverse' > p2.reverse
12+ echo 'p2.reverse' > p2.reverse
13+ #for $r in $repeat
14+ #if $r.cond.select == "a" and $r.cond.inner_cond.inner_select == "2"
15+ && echo "$r.cond.inner_cond.text" >> repeat_cond.txt
16+ #end if
17+ #end for
1318 ]]> </command >
1419 <inputs >
1520 <param name =" produce_out_1" type =" boolean" truevalue =" true" falsevalue =" false" checked =" False" label =" Do Filter 1" />
1621 <param name =" filter_text_1" type =" text" value =" 1" />
1722 <param name =" produce_collection" type =" boolean" truevalue =" true" falsevalue =" false" checked =" False" label =" Collection Filter" />
1823 <param name =" produce_paired_collection" type =" boolean" truevalue =" true" falsevalue =" false" checked =" False" label =" Paired Collection Filter" />
24+ <repeat name =" repeat" title =" repeat" >
25+ <conditional name =" cond" >
26+ <param name =" select" type =" select" label =" select" >
27+ <option value =" a" ></option >
28+ <option value =" b" ></option >
29+ </param >
30+ <when value =" a" >
31+ <conditional name =" inner_cond" >
32+ <param name =" inner_select" type =" select" label =" select" >
33+ <option value =" 1" >1</option >
34+ <option value =" 2" >2</option >
35+ </param >
36+ <when value =" 1" >
37+ <param name =" text" type =" text" value =" " label =" text" />
38+ </when >
39+ <when value =" 2" >
40+ <param name =" text" type =" text" value =" " label =" text" />
41+ </when >
42+ </conditional >
43+ </when >
44+ <when value =" b" >
45+ <conditional name =" inner_cond" >
46+ <param name =" inner_select" type =" select" label =" select" >
47+ <option value =" 1" >1</option >
48+ <option value =" 2" >2</option >
49+ </param >
50+ <when value =" 1" >
51+ <param name =" text" type =" text" value =" " label =" text" />
52+ </when >
53+ <when value =" 2" >
54+ <param name =" text" type =" text" value =" " label =" text" />
55+ </when >
56+ </conditional >
57+ </when >
58+ </conditional >
59+ </repeat >
1960 </inputs >
2061 <outputs >
2162 <data name =" out_1" format =" txt" from_work_dir =" 1" >
@@ -34,6 +75,9 @@ echo 'p2.reverse' > p2.reverse
3475 <discover_datasets pattern =" (?P< identifier_0> p[12])\.(?P< identifier_1> .*)" ext =" txt" visible =" true" />
3576 <filter >produce_paired_collection is True</filter >
3677 </collection >
78+ <data name =" repeat_cond_output" format =" txt" from_work_dir =" repeat_cond.txt" >
79+ <filter >any( [ r["cond"]["select"] == "a" and r["cond"]["inner_cond"]["inner_select"] == "2" for r in repeat ] )</filter >
80+ </data >
3781 </outputs >
3882 <tests >
3983 <test expect_num_outputs =" 2" >
@@ -98,6 +142,15 @@ echo 'p2.reverse' > p2.reverse
98142 <param name =" filter_text_1" value =" foo" />
99143 <param name =" produce_collection" value =" true" />
100144 <param name =" produce_paired_collection" value =" true" />
145+ <repeat name =" repeat" >
146+ <conditional name =" cond" >
147+ <param name =" select" value =" b" />
148+ <conditional name =" inner_cond" >
149+ <param name =" inner_select" value =" 1" />
150+ <param name =" text" value =" b1" />
151+ </conditional >
152+ </conditional >
153+ </repeat >
101154 <output name =" out_1" >
102155 <assert_contents >
103156 <has_line line =" 1" />
@@ -147,5 +200,21 @@ echo 'p2.reverse' > p2.reverse
147200 </element >
148201 </output_collection >
149202 </test >
203+ <test expect_num_outputs =" 1" >
204+ <repeat name =" repeat" >
205+ <conditional name =" cond" >
206+ <param name =" select" value =" a" />
207+ <conditional name =" inner_cond" >
208+ <param name =" inner_select" value =" 2" />
209+ <param name =" text" value =" a2" />
210+ </conditional >
211+ </conditional >
212+ </repeat >
213+ <output name =" repeat_cond_output" >
214+ <assert_contents >
215+ <has_line line =" a2" />
216+ </assert_contents >
217+ </output >
218+ </test >
150219 </tests >
151220</tool >
0 commit comments