diff options
| author | Arun Isaac | 2025-12-18 14:38:09 +0000 |
|---|---|---|
| committer | Arun Isaac | 2025-12-18 14:45:17 +0000 |
| commit | 4ccbbccc51a03887707aa4668c8f6eeec394a757 (patch) | |
| tree | b1ea8abdec2decaca8824e457a40f901b991c05f | |
| parent | 7f3c672999b90c5eb261b3a935fed6bc292eb8d5 (diff) | |
| download | ravanan-4ccbbccc51a03887707aa4668c8f6eeec394a757.tar.gz ravanan-4ccbbccc51a03887707aa4668c8f6eeec394a757.tar.lz ravanan-4ccbbccc51a03887707aa4668c8f6eeec394a757.zip | |
Earlier, we were converting array inputs to a list of bindings. We now use a vector to be consistent with the spirit and letter of the rest of the code.
| -rw-r--r-- | e2e-tests/jobs/command-line-tool-with-array-input.yaml | 3 | ||||
| -rw-r--r-- | e2e-tests/tests.yaml | 9 | ||||
| -rw-r--r-- | e2e-tests/tools/command-line-tool-with-array-input.scm | 3 | ||||
| -rw-r--r-- | ravanan/work/command-line-tool.scm | 17 |
4 files changed, 23 insertions, 9 deletions
diff --git a/e2e-tests/jobs/command-line-tool-with-array-input.yaml b/e2e-tests/jobs/command-line-tool-with-array-input.yaml new file mode 100644 index 0000000..a0fc50c --- /dev/null +++ b/e2e-tests/jobs/command-line-tool-with-array-input.yaml @@ -0,0 +1,3 @@ +messages: + - foo + - bar diff --git a/e2e-tests/tests.yaml b/e2e-tests/tests.yaml index d14b93a..6604e39 100644 --- a/e2e-tests/tests.yaml +++ b/e2e-tests/tests.yaml @@ -241,3 +241,12 @@ class: File size: 13 checksum: sha1$47a013e660d408619d894b20806b1d5086aab03b +- id: command-line-tool-with-array-input + doc: CommandLineTool with array input + tool: tools/command-line-tool-with-array-input.cwl + job: jobs/command-line-tool-with-array-input.yaml + output: + output_message: + class: File + size: 8 + checksum: sha1$d53a205a336e07cf9eac45471b3870f9489288ec diff --git a/e2e-tests/tools/command-line-tool-with-array-input.scm b/e2e-tests/tools/command-line-tool-with-array-input.scm new file mode 100644 index 0000000..38a8722 --- /dev/null +++ b/e2e-tests/tools/command-line-tool-with-array-input.scm @@ -0,0 +1,3 @@ +(command #:inputs (messages #:type (array string)) + #:run "echo" messages + #:outputs (output_message #:type stdout)) diff --git a/ravanan/work/command-line-tool.scm b/ravanan/work/command-line-tool.scm index 29d47c4..95d69f5 100644 --- a/ravanan/work/command-line-tool.scm +++ b/ravanan/work/command-line-tool.scm @@ -408,15 +408,14 @@ be defined in the context in which the G-expressions are inserted." position prefix matched-type - (map (lambda (i input) - (id+input+type-tree+binding->command-line-binding - (list (append id (list i)) - input - (assoc-ref type-tree "items") - (maybe-assoc-ref (just type-tree) - "inputBinding")))) - (iota (vector-length input)) - (vector->list input)) + (vector-map-indexed (lambda (i input) + (id+input+type-tree+binding->command-line-binding + (list (append id (list i)) + input + (assoc-ref type-tree "items") + (maybe-assoc-ref (just type-tree) + "inputBinding")))) + input) (maybe-assoc-ref binding "itemSeparator"))) (else (command-line-binding position |
