diff --git a/src/babashka/impl/tasks.clj b/src/babashka/impl/tasks.clj index d8245b4f..290a8151 100644 --- a/src/babashka/impl/tasks.clj +++ b/src/babashka/impl/tasks.clj @@ -289,7 +289,7 @@ (:children forms)) loc (zip/edn the-map) loc (zip/down loc) - loc (zip/find-next-value loc :tasks) + loc (zip/find-value loc :tasks) loc (zip/right loc) loc (zip/down loc)] (filter symbol? diff --git a/test/babashka/bb_edn_test.clj b/test/babashka/bb_edn_test.clj index 816b4008..8a664737 100644 --- a/test/babashka/bb_edn_test.clj +++ b/test/babashka/bb_edn_test.clj @@ -152,7 +152,14 @@ :task t2/foo}}}" (let [res (test-utils/bb nil "tasks")] (is (= "The following tasks are available:\n\ntask1 task1 doc\ntask2 task2 doc\nfoo Foo docstring\nbar Foo docstring\nbaz \nquux Foo docstring\n" - res))))) + res)))) + (testing ":tasks is the first node" + (test-utils/with-config "{:tasks {task1 + {:doc \"task1 doc\" + :task (+ 1 2 3)}}}" + (let [res (test-utils/bb nil "tasks")] + (is (= "The following tasks are available:\n\ntask1 task1 doc\n" + res)))))) (deftest task-priority-test (when-not test-utils/native?