diff --git a/tests/test_examples.py b/tests/test_examples.py index c74cae4a12..1e1702b433 100644 --- a/tests/test_examples.py +++ b/tests/test_examples.py @@ -1587,3 +1587,15 @@ def test_custom_type_in_step_process() -> None: ] ) assert err_code == 0 + + +@pytest.mark.parametrize("version", ["1_0", "1_1", "1_2"]) +def test_array_items_typedsl(version: str) -> None: + """Demonstrate that 'type: array, items: SomeType[]' works.""" + err_code, _, stderr = get_main_output( + [ + get_data(f"tests/wf/nested_typedsl_v{version}.cwl"), + get_data("tests/wf/nested_typedsl_job.yml"), + ] + ) + assert err_code == 0 diff --git a/tests/wf/nested_typedsl_job.yml b/tests/wf/nested_typedsl_job.yml new file mode 100644 index 0000000000..4c9c80a2bb --- /dev/null +++ b/tests/wf/nested_typedsl_job.yml @@ -0,0 +1,5 @@ +cat_in: + - - class: File + location: echo.cwl + - class: File + location: cat.cwl diff --git a/tests/wf/nested_typedsl_v1_0.cwl b/tests/wf/nested_typedsl_v1_0.cwl new file mode 100755 index 0000000000..460c977b1f --- /dev/null +++ b/tests/wf/nested_typedsl_v1_0.cwl @@ -0,0 +1,14 @@ +#!/usr/bin/env cwl-runner +cwlVersion: v1.0 +class: CommandLineTool +baseCommand: cat +inputs: + cat_in: + type: + type: array + items: File[] + inputBinding: {} +stdout: all.txt +outputs: + txt: + type: stdout diff --git a/tests/wf/nested_typedsl_v1_1.cwl b/tests/wf/nested_typedsl_v1_1.cwl new file mode 100755 index 0000000000..460c977b1f --- /dev/null +++ b/tests/wf/nested_typedsl_v1_1.cwl @@ -0,0 +1,14 @@ +#!/usr/bin/env cwl-runner +cwlVersion: v1.0 +class: CommandLineTool +baseCommand: cat +inputs: + cat_in: + type: + type: array + items: File[] + inputBinding: {} +stdout: all.txt +outputs: + txt: + type: stdout diff --git a/tests/wf/nested_typedsl_v1_2.cwl b/tests/wf/nested_typedsl_v1_2.cwl new file mode 100755 index 0000000000..460c977b1f --- /dev/null +++ b/tests/wf/nested_typedsl_v1_2.cwl @@ -0,0 +1,14 @@ +#!/usr/bin/env cwl-runner +cwlVersion: v1.0 +class: CommandLineTool +baseCommand: cat +inputs: + cat_in: + type: + type: array + items: File[] + inputBinding: {} +stdout: all.txt +outputs: + txt: + type: stdout