From 8ca5c4b4f7c011077751fae685848fc712d00243 Mon Sep 17 00:00:00 2001 From: "Bruno P. Kinoshita" Date: Wed, 11 May 2022 19:32:23 +1200 Subject: [PATCH] Add a conformance test for InlineJavascriptRequirement with an input record --- conformance_tests.yaml | 12 +++++++++++- tests/js-input-record.cwl | 33 +++++++++++++++++++++++++++++++++ tests/js-input-record.json | 7 +++++++ 3 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 tests/js-input-record.cwl create mode 100644 tests/js-input-record.json diff --git a/conformance_tests.yaml b/conformance_tests.yaml index f8e0f975..9fe6245d 100644 --- a/conformance_tests.yaml +++ b/conformance_tests.yaml @@ -3561,4 +3561,14 @@ `echo a && echo b > out.txt`, but instead will produce the correct `echo a && echo b`, and capture the output correctly. tags: [ shell_command, command_line_tool ] - \ No newline at end of file + +- 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 ] 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 + } +} +