From 8a0e1a6c28b63a62f958fd84c975924e14a00950 Mon Sep 17 00:00:00 2001 From: Paula Gearon Date: Wed, 13 Oct 2021 08:35:03 -0400 Subject: [PATCH] Added tests --- test-pod/pod/test_pod.clj | 6 ++++-- test-resources/test_program.clj | 9 ++++++++- test/babashka/pods/test_common.clj | 5 ++++- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/test-pod/pod/test_pod.clj b/test-pod/pod/test_pod.clj index d834de8..cc81ccd 100644 --- a/test-pod/pod/test_pod.clj +++ b/test-pod/pod/test_pod.clj @@ -110,7 +110,8 @@ "my/other-tag" "pod.test-pod/read-other-tag"} "namespaces" [{"name" "pod.test-pod" - "vars" (into [{"name" "add-sync"} + "vars" (into [{"name" "add-sync" + "meta" "{:doc \"add the arguments\"}"} {"name" "range-stream" "async" "true"} {"name" "assoc"} @@ -127,7 +128,8 @@ {"name" "other-tag"} ;; reads thing with other tag {"name" "read-other-tag" - "code" "(defn read-other-tag [x] [x x])"} + "code" "(defn read-other-tag [x] [x x])" + "meta" "{:doc \"unread\"}"} {"name" "-local-date-time"} {"name" "transit-stuff" "code" " diff --git a/test-resources/test_program.clj b/test-resources/test_program.clj index bb728a6..de22ce3 100644 --- a/test-resources/test_program.clj +++ b/test-resources/test_program.clj @@ -55,6 +55,10 @@ (def add-result (pod.test-pod/add-sync 1 2 3)) (def nil-result (pod.test-pod/return-nil)) +(def add-sync-meta (:doc (meta #'pod.test-pod/add-sync))) +(def error-meta (:doc (meta #'pod.test-pod/error))) +(def read-other-tag-meta (:doc (meta #'pod.test-pod/read-other-tag))) + (def x9 pod.test-pod/x9) (def tagged (if (= "edn" fmt) @@ -108,4 +112,7 @@ fn-called local-date-time assoc-string-array - should-be-1] + should-be-1 + add-sync-meta + error-meta + read-other-tag-meta] diff --git a/test/babashka/pods/test_common.clj b/test/babashka/pods/test_common.clj index 760c097..ad4a1eb 100644 --- a/test/babashka/pods/test_common.clj +++ b/test/babashka/pods/test_common.clj @@ -28,7 +28,10 @@ 3 true ;; local-date true ;; roundtrip string array - 1] + 1 + "add the arguments" + nil + nil] (concat ret (repeat ::nil)))] (if (instance? java.util.regex.Pattern expected) (is (re-find expected actual))