summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorArun Isaac2023-09-20 09:30:27 +0100
committerArun Isaac2023-09-20 09:30:27 +0100
commitc585ab433e38fb248ef4e0e040ab14f4230d3d2c (patch)
treec8558ba7962f32aaf516424ca5fd7f4c6b9baca9 /tests
parent05f8c9b109146a5647a31cfe4c55661f47ff75f0 (diff)
downloadccwl-c585ab433e38fb248ef4e0e040ab14f4230d3d2c.tar.gz
ccwl-c585ab433e38fb248ef4e0e040ab14f4230d3d2c.tar.lz
ccwl-c585ab433e38fb248ef4e0e040ab14f4230d3d2c.zip
tests: Test that rename works even on a final workflow output.
* tests/ccwl.scm (print): New variable. ("rename should work even on the final output of a workflow"): New test.
Diffstat (limited to 'tests')
-rw-r--r--tests/ccwl.scm19
1 files changed, 18 insertions, 1 deletions
diff --git a/tests/ccwl.scm b/tests/ccwl.scm
index d99650e..f55ef0d 100644
--- a/tests/ccwl.scm
+++ b/tests/ccwl.scm
@@ -1,5 +1,5 @@
;;; ccwl --- Concise Common Workflow Language
-;;; Copyright © 2021, 2022 Arun Isaac <arunisaac@systemreboot.net>
+;;; Copyright © 2021, 2022, 2023 Arun Isaac <arunisaac@systemreboot.net>
;;;
;;; This file is part of ccwl.
;;;
@@ -111,4 +111,21 @@
#:outputs (stdout #:type stdout)
#:stdin "foo" "bar"))))
+;; TODO: Define this in the lexical scope of the test that requires
+;; it.
+(define print
+ (command #:inputs (message #:type string)
+ #:run "echo" message
+ #:outputs (printed-message #:type stdout)))
+
+(test-equal "rename should work even on the final output of a workflow"
+ (map output-id
+ (workflow-outputs
+ (workflow ((message1 #:type string)
+ (message2 #:type string))
+ (tee (pipe (print (print1) #:message message1)
+ (rename #:out1 printed-message))
+ (print (print2) #:message message2)))))
+ (list 'out1 'printed-message))
+
(test-end "ccwl")