Skip to content

Commit 46a4c91

Browse files
author
bogdang989
committed
Add test for optional numeric output returning 0
1 parent 5f4ebe5 commit 46a4c91

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

conformance_tests.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3304,3 +3304,12 @@
33043304
tags: [ required, command_line_tool ]
33053305
id: 252
33063306

3307+
- tool: tests/optional-numerical-output-0.cwl
3308+
job: tests/empty.json
3309+
output:
3310+
{"out": 0}
3311+
label: optional_numerical_output_returns_0_not_null
3312+
doc: |
3313+
Test that optional number output is returned as 0, not null
3314+
tags: [ required, command_line_tool ]
3315+
id: 253

tests/optional-numerical-output-0.cwl

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
cwlVersion: v1.0
2+
class: CommandLineTool
3+
baseCommand:
4+
- echo
5+
- "0"
6+
stdout: a.txt
7+
requirements:
8+
- class: InlineJavascriptRequirement
9+
inputs: []
10+
outputs:
11+
out:
12+
type: float?
13+
outputBinding:
14+
glob: "a.txt"
15+
loadContents: true
16+
outputEval: "${\n return parseFloat(self[0].contents);\n}"

0 commit comments

Comments
 (0)