diff options
| -rw-r--r-- | e2e-tests/jobs/int-for-float-input.yaml | 3 | ||||
| -rw-r--r-- | e2e-tests/tests.yaml | 4 | ||||
| -rw-r--r-- | e2e-tests/tools/int-for-float-input.scm | 4 | ||||
| -rw-r--r-- | ravanan/work/command-line-tool.scm | 4 | ||||
| -rw-r--r-- | tests/work/command-line-tool.scm | 4 |
5 files changed, 12 insertions, 7 deletions
diff --git a/e2e-tests/jobs/int-for-float-input.yaml b/e2e-tests/jobs/int-for-float-input.yaml index 32a3dc4..0d12299 100644 --- a/e2e-tests/jobs/int-for-float-input.yaml +++ b/e2e-tests/jobs/int-for-float-input.yaml @@ -1 +1,2 @@ -message: 1 +message1: 1 +message2: 1.2 diff --git a/e2e-tests/tests.yaml b/e2e-tests/tests.yaml index e04d4dd..bc4639c 100644 --- a/e2e-tests/tests.yaml +++ b/e2e-tests/tests.yaml @@ -221,5 +221,5 @@ output: output_message: class: File - size: 2 - checksum: sha1$e5fa44f2b31c1fb553b6021e7360d07d5d91ff5e + size: 6 + checksum: sha1$d493abaf2d0ffe0bec8d302fdee38a43e80d2a91 diff --git a/e2e-tests/tools/int-for-float-input.scm b/e2e-tests/tools/int-for-float-input.scm index 18b2f1f..a2f351e 100644 --- a/e2e-tests/tools/int-for-float-input.scm +++ b/e2e-tests/tools/int-for-float-input.scm @@ -1,3 +1,3 @@ -(command #:inputs (message #:type float) - #:run "echo" message +(command #:inputs (message1 #:type float) (message2 #:type float) + #:run "echo" message1 message2 #:outputs (output_message #:type stdout)) diff --git a/ravanan/work/command-line-tool.scm b/ravanan/work/command-line-tool.scm index 74699ed..0157b2c 100644 --- a/ravanan/work/command-line-tool.scm +++ b/ravanan/work/command-line-tool.scm @@ -125,8 +125,8 @@ example, when @var{type} is a union type." (match-type obj 'float)) ;; Accept ints as floats too. ((eq? type 'float) - (and (or (match-type obj 'int) - (match-type obj 'float)) + (and (memq (object-type obj) + (list 'int 'float)) 'float)) ;; Recursively match type of every element of array. ((cwl-array-type? type) diff --git a/tests/work/command-line-tool.scm b/tests/work/command-line-tool.scm index c008412..93b97d4 100644 --- a/tests/work/command-line-tool.scm +++ b/tests/work/command-line-tool.scm @@ -30,4 +30,8 @@ 'float (match-type 1 'float)) +(test-equal "match float to float" + 'float + (match-type 1.3 'float)) + (test-end "work.command-line-tool") |
