Skip to content

Commit 1acdac4

Browse files
Add test for MultipleInputFeatureRequirement
If the source has a type set as a list of two or more items, it will be added to the result array exactly the same number of times as the length of its type list
1 parent 09c2d0c commit 1acdac4

File tree

3 files changed

+65
-0
lines changed

3 files changed

+65
-0
lines changed

v1.0/conformance_test_v1.0.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -981,3 +981,9 @@
981981
size: 15
982982
tool: v1.0/imported-hint.cwl
983983
doc: Test hints with $import
984+
985+
- job: v1.0/sum-job.json
986+
output:
987+
result: 12
988+
tool: v1.0/sum-wf.cwl
989+
doc: Test step input with multiple sources with multiple types

v1.0/v1.0/sum-job.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"int_1": 5,
3+
"int_2": 7
4+
}

v1.0/v1.0/sum-wf.cwl

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
cwlVersion: v1.0
2+
class: Workflow
3+
4+
requirements:
5+
- class: StepInputExpressionRequirement
6+
- class: MultipleInputFeatureRequirement
7+
- class: InlineJavascriptRequirement
8+
9+
inputs:
10+
int_1:
11+
type: int?
12+
int_2:
13+
type: int?
14+
15+
outputs:
16+
result:
17+
type: int
18+
outputSource: sum/result
19+
20+
steps:
21+
sum:
22+
in:
23+
data:
24+
source: [int_1, int_2]
25+
valueFrom: |
26+
${
27+
var sum = 0;
28+
for (var i = 0; i < self.length; i++){
29+
sum += self[i];
30+
};
31+
return sum;
32+
}
33+
out:
34+
- result
35+
run:
36+
class: ExpressionTool
37+
inputs:
38+
data:
39+
type: int
40+
outputs:
41+
result: int
42+
expression: |
43+
${
44+
return {"result": inputs.data};
45+
}
46+
47+
48+
49+
50+
51+
52+
53+
54+
55+

0 commit comments

Comments
 (0)