Skip to content

Commit

Permalink
extend tool test for change_format in statically defined collection e…
Browse files Browse the repository at this point in the history
…lements
  • Loading branch information
bernt-matthias committed Jul 29, 2024
1 parent c592ddd commit b9b4a9f
Showing 1 changed file with 42 additions and 2 deletions.
44 changes: 42 additions & 2 deletions test/functional/tools/collection_creates_pair_format.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,28 @@
</command>
<inputs>
<param name="input1" type="data" label="Input" help="Input to be split." />
<param name="out_format" type="select" label="Output data type">
<option value="">do not change</option>
<option value="interval">interval</option>
</param>
</inputs>
<outputs>
<!-- format is specified separately for the elements, i.e. default format (fasta in this case) is ignored -->
<collection name="paired_output" format="fasta" type="paired" label="Split Pair">
<data name="forward" format="txt" />
<data name="forward" format="txt">
<change_format>
<when input="out_format" value="interval" format="interval" />
</change_format>
</data>
<data name="reverse" format_source="input1" from_work_dir="reverse.txt" />
</collection>
<!-- no format is specified separately for the elements, i.e. default format (fasta in this case) is used -->
<collection name="paired_output_default_format" format="fasta" type="paired" label="Split Pair">
<data name="forward" />
<data name="forward">
<change_format>
<when input="out_format" value="interval" format="interval" />
</change_format>
</data>
<data name="reverse" from_work_dir="reverse.txt" />
</collection>
</outputs>
Expand Down Expand Up @@ -48,5 +60,33 @@
</element>
</output_collection>
</test>
<test>
<param name="input1" ftype="bed" value="simple_lines_interleaved.txt" />
<param name="out_format" value="interval"/>
<output_collection name="paired_output" type="paired">
<element name="forward" ftype="interval">
<assert_contents>
<has_text_matching expression="^This is a line of text.\nThis is a line of text.\n$" />
</assert_contents>
</element>
<element name="reverse" ftype="bed">
<assert_contents>
<has_text_matching expression="^This is a different line of text.\nThis is a different line of text.\n$" />
</assert_contents>
</element>
</output_collection>
<output_collection name="paired_output_default_format" type="paired">
<element name="forward" ftype="interval">
<assert_contents>
<has_text_matching expression="^This is a line of text.\nThis is a line of text.\n$" />
</assert_contents>
</element>
<element name="reverse" ftype="fasta">
<assert_contents>
<has_text_matching expression="^This is a different line of text.\nThis is a different line of text.\n$" />
</assert_contents>
</element>
</output_collection>
</test>
</tests>
</tool>

0 comments on commit b9b4a9f

Please sign in to comment.