Navigation Menu

Skip to content

Commit

Permalink
add tests for strings
Browse files Browse the repository at this point in the history
  • Loading branch information
Artem Yankov committed Sep 28, 2012
1 parent 4b7e06c commit dd55599
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
1 change: 1 addition & 0 deletions .lein-failures
@@ -0,0 +1 @@
#{}
25 changes: 25 additions & 0 deletions test/memobot/test/strings.clj
@@ -0,0 +1,25 @@
(ns memobot.test.strings
(:use [memobot core strings redis db])
(:use [clojure.test]))

(deftest strings-test
(testing "set"
(is (= (set-cmd 'k 10) 10)))
(testing "setnx"
(testing "when key doesn't exist"
(is (= (setnx-cmd :new 10) 10)))
(testing "when key exists"
(is (= (setnx-cmd 'k 10) 'k))))
(testing "strlen"
(is (= (strlen-cmd "robot") 5)))
(is (= (strlen-cmd 6) 1))
(testing "incr"
(is (= (incr-cmd 10) 11)))
(testing "decr"
(is (= (decr-cmd 10) 9)))
(testing "incrby"
(is (= (incrby-cmd 10 5) 15)))
(testing "decrby"
(is (= (decrby-cmd 10 5) 5))))


0 comments on commit dd55599

Please sign in to comment.