Skip to content

Commit 6edb7a9

Browse files
authored
Add a conformance test for InlineJavascriptRequirement with an input record (#170)
1 parent 86972f0 commit 6edb7a9

File tree

3 files changed

+52
-1
lines changed

3 files changed

+52
-1
lines changed

conformance_tests.yaml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3570,6 +3570,17 @@
35703570
and capture the output correctly.
35713571
tags: [ shell_command, command_line_tool ]
35723572

3573+
- label: js-input-record
3574+
# The output does not have the last \n due to the -n passed to echo
3575+
output: {
3576+
"out": "JS\nwith\nrecord"
3577+
}
3578+
tool: tests/js-input-record.cwl
3579+
job: tests/js-input-record.json
3580+
doc: |
3581+
A test case for JS with an input record.
3582+
tags: [ inline_javascript, command_line_tool ]
3583+
35733584
- tool: tests/schemadef_types_with_import-wf.cwl
35743585
job: tests/schemadef_types_with_import-job.json
35753586
output: {
@@ -3579,4 +3590,4 @@
35793590
doc: >-
35803591
Test SchemaDefRequirement with a workflow, with the `$import` under types.
35813592
It is similar to schemadef-wf, but the `$import` is different.
3582-
tags: [ workflow, schema_def ]
3593+
tags: [ workflow, schema_def ]

tests/js-input-record.cwl

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
cwlVersion: v1.0
2+
3+
class: CommandLineTool
4+
5+
requirements:
6+
- class: InlineJavascriptRequirement
7+
8+
baseCommand: ['echo']
9+
10+
inputs:
11+
message:
12+
type:
13+
type: record
14+
name: message_object
15+
fields:
16+
text:
17+
type: string
18+
inputBinding:
19+
position: 1
20+
newlines:
21+
type: boolean?
22+
inputBinding:
23+
position: 0
24+
prefix: -n
25+
26+
outputs:
27+
out:
28+
type: string
29+
outputBinding:
30+
glob: output.txt
31+
loadContents: true
32+
outputEval: $(self[0].contents)
33+
stdout: output.txt

tests/js-input-record.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"message": {
3+
"text": "JS\nwith\nrecord",
4+
"newlines": true
5+
}
6+
}
7+

0 commit comments

Comments
 (0)