Skip to content

Commit

Permalink
Merge pull request common-workflow-language#335 from common-workflow-…
Browse files Browse the repository at this point in the history
…language/output-literals

Add tests for file and directory literals in output
  • Loading branch information
tetron committed Nov 8, 2016
2 parents ee3bb1c + d8b6c8f commit cb1f928
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 1 deletion.
36 changes: 35 additions & 1 deletion v1.0/conformance_test_v1.0.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -925,4 +925,38 @@
}
}
tool: v1.0/docker-array-secondaryfiles.cwl
doc: Test secondaryFiles on array of files.
doc: Test secondaryFiles on array of files.

- job: v1.0/dir7.yml
output: {
"dir": {
"location": "a_directory",
"class": "Directory",
"listing": [
{
"class": "File",
"location": "whale.txt",
"checksum": "sha1$327fc7aedf4f6b69a42a7c8b808dc5a7aff61376",
"size": 1111
},
{
"class": "File",
"location": "hello.txt",
"checksum": "sha1$47a013e660d408619d894b20806b1d5086aab03b",
"size": 13
}
]
}
}
tool: v1.0/dir7.cwl
doc: Test directory literal output created by ExpressionTool

- job: v1.0/empty.json
output:
lit:
location: "a_file"
class: "File"
checksum: "sha1$fea23663b9c8ed71968f86415b5ec091bb111448"
size: 19
tool: v1.0/file-literal-ex.cwl
doc: Test file literal output created by ExpressionTool
12 changes: 12 additions & 0 deletions v1.0/v1.0/dir7.cwl
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
class: ExpressionTool
cwlVersion: v1.0
requirements:
InlineJavascriptRequirement: {}
inputs:
files: File[]
outputs:
dir: Directory
expression: |
${
return {"dir": {"class": "Directory", "basename": "a_directory", "listing": inputs.files}};
}
5 changes: 5 additions & 0 deletions v1.0/v1.0/dir7.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
files:
- class: File
location: hello.txt
- class: File
location: whale.txt
11 changes: 11 additions & 0 deletions v1.0/v1.0/file-literal-ex.cwl
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
class: ExpressionTool
cwlVersion: v1.0
requirements:
InlineJavascriptRequirement: {}
inputs: []
outputs:
lit: File
expression: |
${
return {"lit": {"class": "File", "basename": "a_file", "contents": "Hello file literal."}};
}

0 comments on commit cb1f928

Please sign in to comment.