Skip to content

Commit cb1f928

Browse files
authored
Merge pull request #335 from common-workflow-language/output-literals
Add tests for file and directory literals in output
2 parents ee3bb1c + d8b6c8f commit cb1f928

File tree

4 files changed

+63
-1
lines changed

4 files changed

+63
-1
lines changed

v1.0/conformance_test_v1.0.yaml

+35-1
Original file line numberDiff line numberDiff line change
@@ -925,4 +925,38 @@
925925
}
926926
}
927927
tool: v1.0/docker-array-secondaryfiles.cwl
928-
doc: Test secondaryFiles on array of files.
928+
doc: Test secondaryFiles on array of files.
929+
930+
- job: v1.0/dir7.yml
931+
output: {
932+
"dir": {
933+
"location": "a_directory",
934+
"class": "Directory",
935+
"listing": [
936+
{
937+
"class": "File",
938+
"location": "whale.txt",
939+
"checksum": "sha1$327fc7aedf4f6b69a42a7c8b808dc5a7aff61376",
940+
"size": 1111
941+
},
942+
{
943+
"class": "File",
944+
"location": "hello.txt",
945+
"checksum": "sha1$47a013e660d408619d894b20806b1d5086aab03b",
946+
"size": 13
947+
}
948+
]
949+
}
950+
}
951+
tool: v1.0/dir7.cwl
952+
doc: Test directory literal output created by ExpressionTool
953+
954+
- job: v1.0/empty.json
955+
output:
956+
lit:
957+
location: "a_file"
958+
class: "File"
959+
checksum: "sha1$fea23663b9c8ed71968f86415b5ec091bb111448"
960+
size: 19
961+
tool: v1.0/file-literal-ex.cwl
962+
doc: Test file literal output created by ExpressionTool

v1.0/v1.0/dir7.cwl

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
class: ExpressionTool
2+
cwlVersion: v1.0
3+
requirements:
4+
InlineJavascriptRequirement: {}
5+
inputs:
6+
files: File[]
7+
outputs:
8+
dir: Directory
9+
expression: |
10+
${
11+
return {"dir": {"class": "Directory", "basename": "a_directory", "listing": inputs.files}};
12+
}

v1.0/v1.0/dir7.yml

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
files:
2+
- class: File
3+
location: hello.txt
4+
- class: File
5+
location: whale.txt

v1.0/v1.0/file-literal-ex.cwl

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
class: ExpressionTool
2+
cwlVersion: v1.0
3+
requirements:
4+
InlineJavascriptRequirement: {}
5+
inputs: []
6+
outputs:
7+
lit: File
8+
expression: |
9+
${
10+
return {"lit": {"class": "File", "basename": "a_file", "contents": "Hello file literal."}};
11+
}

0 commit comments

Comments
 (0)