Skip to content

Commit b37e3fc

Browse files
committed
This commit tests the output when is an array of records
1 parent 07b52f8 commit b37e3fc

File tree

3 files changed

+49
-0
lines changed

3 files changed

+49
-0
lines changed

conformance_tests.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3618,4 +3618,25 @@
36183618
an_array_of_trues: [ true, true, true ]
36193619
an_int: 42
36203620

3621+
- job: tests/out_array_records.json
3622+
tool: tests/out_array_records.cwl
3623+
id: out_array_records
3624+
output:
3625+
result: [
3626+
{
3627+
"f_a": "az",
3628+
"f_b": "bz"
3629+
},
3630+
{
3631+
"f_a": "cz",
3632+
"f_b": "dz"
3633+
},
3634+
{
3635+
"f_a": "ez",
3636+
"f_b": "fz"
3637+
}
3638+
]
3639+
doc: The input and output of the step when they are arrays of records
3640+
tags: [ command_line_tool, required ]
3641+
36213642
- $import: tests/loop/test-index.yaml

tests/out_array_records.cwl

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
cwlVersion: v1.3.0-dev1
2+
class: CommandLineTool
3+
requirements:
4+
InlineJavascriptRequirement: {}
5+
SchemaDefRequirement:
6+
types:
7+
- name: custom
8+
type: record
9+
fields:
10+
f_a: string
11+
f_b: string
12+
InitialWorkDirRequirement:
13+
listing:
14+
- entryname: script.sh
15+
entry: |
16+
echo '$(inputs.in1)' | sed -E 's/": "([^"]*)"/": "\1z"/g' > cwl.output.json
17+
inputs:
18+
in1:
19+
type:
20+
type: array
21+
items: custom
22+
baseCommand: ["bash", "script.sh"]
23+
outputs:
24+
result:
25+
type:
26+
type: array
27+
items: custom

tests/out_array_records.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"in1": [{"f_a": "a", "f_b": "b"}, {"f_a": "c", "f_b": "d"}, {"f_a": "e", "f_b": "f"}]}

0 commit comments

Comments
 (0)