Skip to content

Commit 4f9b346

Browse files
committed
Add tests for decimal representation of very big and very small numbers
Closes: #240
1 parent 63d4784 commit 4f9b346

File tree

3 files changed

+93
-1
lines changed

3 files changed

+93
-1
lines changed

conformance_tests.yaml

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3168,7 +3168,7 @@
31683168

31693169
- job: tests/empty.json
31703170
tool: tests/params_broken_length_of_non_list.cwl
3171-
doc: Test paramer reference that refers to length of non-array input
3171+
doc: Test paramater reference that refers to length of non-array input
31723172
should_fail: true
31733173
tags: [ required, command_line_tool ]
31743174
id: length_for_non_array
@@ -3440,3 +3440,24 @@
34403440
]
34413441
}
34423442
tags: [ required, command_line_tool ]
3443+
3444+
- id: very_big_and_very_floats
3445+
doc: Confirm that very big and very small numbers are represented using decimals, not scientific notation
3446+
tool: tests/floats_small_and_large.cwl
3447+
job: tests/empty.json
3448+
output: { "result": "0.00001 0.0000123 123000 1230000" }
3449+
tags: [ inline_javascript, command_line_tool ]
3450+
3451+
- id: very_big_and_very_floats_nojs
3452+
doc: Confirm that very big and very small numbers are represented using decimals, not scientific notation
3453+
tool: tests/floats_small_and_large_nojs.cwl
3454+
job: tests/empty.json
3455+
output: {
3456+
"result": {
3457+
"basename": "dump",
3458+
"class": "File",
3459+
"checksum": "sha1$8a3913a553b8f29d47b99c1f4b0f6c2ee833cdc2",
3460+
"size": 32
3461+
}
3462+
}
3463+
tags: [ required, command_line_tool ]

tests/floats_small_and_large.cwl

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
cwlVersion: v1.0
2+
class: CommandLineTool
3+
baseCommand: echo
4+
requirements:
5+
InlineJavascriptRequirement: {}
6+
7+
inputs:
8+
annotation_prokka_evalue:
9+
type: float
10+
default: 0.00001
11+
inputBinding: {}
12+
13+
annotation_prokka_evalue2:
14+
type: float
15+
default: 1.23e-05
16+
inputBinding: {}
17+
18+
annotation_prokka_evalue3:
19+
type: float
20+
default: 1.23e5
21+
inputBinding: {}
22+
23+
annotation_prokka_evalue4:
24+
type: float
25+
default: 1230000
26+
inputBinding: {}
27+
28+
29+
arguments: [ -n ]
30+
31+
stdout: dump
32+
33+
outputs:
34+
result:
35+
type: string
36+
outputBinding:
37+
glob: dump
38+
loadContents: true
39+
outputEval: $(self[0].contents)

tests/floats_small_and_large_nojs.cwl

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
cwlVersion: v1.0
2+
class: CommandLineTool
3+
baseCommand: echo
4+
5+
inputs:
6+
annotation_prokka_evalue:
7+
type: float
8+
default: 0.00001
9+
inputBinding: {}
10+
11+
annotation_prokka_evalue2:
12+
type: float
13+
default: 1.23e-05
14+
inputBinding: {}
15+
16+
annotation_prokka_evalue3:
17+
type: float
18+
default: 1.23e5
19+
inputBinding: {}
20+
21+
annotation_prokka_evalue4:
22+
type: float
23+
default: 1230000
24+
inputBinding: {}
25+
26+
27+
arguments: [ -n ]
28+
29+
stdout: dump
30+
31+
outputs:
32+
result: stdout

0 commit comments

Comments
 (0)