Skip to content

Commit

Permalink
Add test for MultipleInputFeatureRequirement
Browse files Browse the repository at this point in the history
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
  • Loading branch information
michael-kotliar committed Jun 6, 2017
1 parent 09c2d0c commit 1acdac4
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 0 deletions.
6 changes: 6 additions & 0 deletions v1.0/conformance_test_v1.0.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -981,3 +981,9 @@
size: 15
tool: v1.0/imported-hint.cwl
doc: Test hints with $import

- job: v1.0/sum-job.json
output:
result: 12
tool: v1.0/sum-wf.cwl
doc: Test step input with multiple sources with multiple types
4 changes: 4 additions & 0 deletions v1.0/v1.0/sum-job.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"int_1": 5,
"int_2": 7
}
55 changes: 55 additions & 0 deletions v1.0/v1.0/sum-wf.cwl
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
cwlVersion: v1.0
class: Workflow

requirements:
- class: StepInputExpressionRequirement
- class: MultipleInputFeatureRequirement
- class: InlineJavascriptRequirement

inputs:
int_1:
type: int?
int_2:
type: int?

outputs:
result:
type: int
outputSource: sum/result

steps:
sum:
in:
data:
source: [int_1, int_2]
valueFrom: |
${
var sum = 0;
for (var i = 0; i < self.length; i++){
sum += self[i];
};
return sum;
}
out:
- result
run:
class: ExpressionTool
inputs:
data:
type: int
outputs:
result: int
expression: |
${
return {"result": inputs.data};
}










0 comments on commit 1acdac4

Please sign in to comment.