diff --git a/conformance_tests.yaml b/conformance_tests.yaml index b34a0813..c00da542 100644 --- a/conformance_tests.yaml +++ b/conformance_tests.yaml @@ -3570,6 +3570,17 @@ and capture the output correctly. tags: [ shell_command, command_line_tool ] +- label: js-input-record + # The output does not have the last \n due to the -n passed to echo + output: { + "out": "JS\nwith\nrecord" + } + tool: tests/js-input-record.cwl + job: tests/js-input-record.json + doc: | + A test case for JS with an input record. + tags: [ inline_javascript, command_line_tool ] + - tool: tests/schemadef_types_with_import-wf.cwl job: tests/schemadef_types_with_import-job.json output: { @@ -3579,4 +3590,4 @@ doc: >- Test SchemaDefRequirement with a workflow, with the `$import` under types. It is similar to schemadef-wf, but the `$import` is different. - tags: [ workflow, schema_def ] \ No newline at end of file + tags: [ workflow, schema_def ] diff --git a/tests/js-input-record.cwl b/tests/js-input-record.cwl new file mode 100644 index 00000000..80e13174 --- /dev/null +++ b/tests/js-input-record.cwl @@ -0,0 +1,33 @@ +cwlVersion: v1.0 + +class: CommandLineTool + +requirements: + - class: InlineJavascriptRequirement + +baseCommand: ['echo'] + +inputs: + message: + type: + type: record + name: message_object + fields: + text: + type: string + inputBinding: + position: 1 + newlines: + type: boolean? + inputBinding: + position: 0 + prefix: -n + +outputs: + out: + type: string + outputBinding: + glob: output.txt + loadContents: true + outputEval: $(self[0].contents) +stdout: output.txt diff --git a/tests/js-input-record.json b/tests/js-input-record.json new file mode 100644 index 00000000..c006ead6 --- /dev/null +++ b/tests/js-input-record.json @@ -0,0 +1,7 @@ +{ + "message": { + "text": "JS\nwith\nrecord", + "newlines": true + } +} +