From 74ef39824b6eb0f8f69720e2f6209ec3de0cefbe Mon Sep 17 00:00:00 2001 From: Ivar Refsdal Date: Thu, 23 Sep 2021 14:33:09 +0200 Subject: Document ordering and depends on as well as add license --- test/com/github/ivarref/yoltq/virtual_test.clj | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'test/com') diff --git a/test/com/github/ivarref/yoltq/virtual_test.clj b/test/com/github/ivarref/yoltq/virtual_test.clj index 789e5b4..93ad0b6 100644 --- a/test/com/github/ivarref/yoltq/virtual_test.clj +++ b/test/com/github/ivarref/yoltq/virtual_test.clj @@ -299,15 +299,11 @@ (yq/init! {:conn conn}) (yq/add-consumer! :a identity) (yq/add-consumer! :b identity) - @(d/transact conn [(yq/put :a "a" {:id "1"})]) - (is (thrown? Exception @(d/transact conn [(yq/put :b "b" {:depends-on [:a "0"]})]))) - @(d/transact conn [(yq/put :b "b" {:depends-on [:a "1"]})]) + @(d/transact conn [(yq/put :a {:id "a1"} {:id "a1"})]) + @(d/transact conn [(yq/put :b {:id "b1"} {:depends-on [:a "a1"]})]) ; can't consume :b yet: - (is (= {:depends-on [:a "1"]} (tq/consume! :b))) - (is (= {:depends-on [:a "1"]} (tq/consume! :b))) - - (is (= "a" (tq/consume! :a))) - (is (= "b" (tq/consume! :b))) - (is (= "b" (tq/force-retry! :b))))) + (is (= {:depends-on [:a "a1"]} (tq/consume! :b))) + (is (= {:id "a1"} (tq/consume! :a))) + (is (= {:id "b1"} (tq/consume! :b))))) -- cgit v1.2.3