Skip to content

Commit d71b2f7

Browse files
authored
Merge pull request #467 from kapilkd13/inlineJS-conformance
added conformance test for InlineJavascriptRequirement
2 parents 8abc3f7 + 1f5f0de commit d71b2f7

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed

v1.0/conformance_test_v1.0.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -981,3 +981,10 @@
981981
size: 15
982982
tool: v1.0/imported-hint.cwl
983983
doc: Test hints with $import
984+
985+
- output:
986+
args: [-A,'2',-B,baz,-C,'10','9','8','7','6','5','4','3','2','1']
987+
job: v1.0/empty.json
988+
tool: v1.0/inline-js.cwl
989+
doc: Test InlineJavascriptRequirement with multiple expressions in the same tool
990+

v1.0/v1.0/inline-js.cwl

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
cwlVersion: v1.0
2+
class: CommandLineTool
3+
baseCommand: echo
4+
5+
requirements:
6+
- class: InlineJavascriptRequirement
7+
8+
inputs:
9+
- id: args.py
10+
type: File
11+
default:
12+
class: File
13+
location: args.py
14+
inputBinding:
15+
position: -1
16+
17+
outputs:
18+
- id: args
19+
type:
20+
type: array
21+
items: string
22+
23+
baseCommand: python
24+
25+
arguments:
26+
- prefix: -A
27+
valueFrom: $(1+1)
28+
- prefix: -B
29+
valueFrom: $("/foo/bar/baz".split('/').slice(-1)[0])
30+
- prefix: -C
31+
valueFrom: |
32+
${
33+
var r = [];
34+
for (var i = 10; i >= 1; i--) {
35+
r.push(i);
36+
}
37+
return r;
38+
}

0 commit comments

Comments
 (0)