-
-
Save bjering/6590b4fd7423d10781a7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns benchmark-chat-server-2 | |
(:use [clojure.test])) | |
(def users (agent {})) | |
(defn create-user | |
[user-name] | |
(let [new-user {:user-name user-name}] | |
(send users conj new-user) | |
new-user)) | |
(deftest test-create-user | |
(is (= 0 (count @users))) | |
(create-user "Jonas") | |
(await users) | |
(is (= 1 (count @users)))) | |
(run-tests 'benchmark-chat-server-2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment