diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/integration.clj | 3 | ||||
| -rw-r--r-- | tests/unit.clj | 16 |
2 files changed, 12 insertions, 7 deletions
diff --git a/tests/integration.clj b/tests/integration.clj index ed70e4e..b92f85d 100644 --- a/tests/integration.clj +++ b/tests/integration.clj @@ -44,7 +44,8 @@ :net-id net-id :clients (atom {}) :channels (atom {}) - :ops (atom {})})) + :ops (atom {}) + :chan-modes (atom {})})) (defn- make-client "Creates a simulated client connection using piped streams. diff --git a/tests/unit.clj b/tests/unit.clj index f6a74de..d172e2a 100644 --- a/tests/unit.clj +++ b/tests/unit.clj @@ -111,7 +111,7 @@ :papod.process/started-at (java.util.Date.)}]) {:conn conn :cracha cracha-state :process-id proc-id :clients (atom {}) :channels (atom {}) - :ops (atom {})}))) + :ops (atom {}) :chan-modes (atom {})}))) (defn test-network! [conn] @@ -1472,11 +1472,15 @@ alice components) (replies-for! {:command "PRIVMSG" :params ["" "#test" ":msg2"]} alice components) - (let [replies (handle-chathistory ["#test" "1" "10"] alice components)] - (is (= 2 (count replies))) - (is (string/includes? (first replies) "msg1")) - (is (string/includes? (second replies) "msg2")) - (is (every? #(string/includes? % "@msgid=") replies))))) + (let [replies (handle-chathistory + ["LATEST" "#test" "*" "10"] + alice components)] + ;; BATCH +id chathistory #test ... BATCH -id + (is (string/includes? (first replies) "BATCH +")) + (is (string/includes? (first replies) "chathistory")) + (is (some #(string/includes? % "msg1") replies)) + (is (some #(string/includes? % "msg2") replies)) + (is (string/includes? (last replies) "BATCH -"))))) (testing "EDIT persists and notifies (draft/message-editing)" (let [alice-out (java.io.ByteArrayOutputStream.) bob-out (java.io.ByteArrayOutputStream.) |
