Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Artem Yankov
committed
Sep 28, 2012
1 parent
4b7e06c
commit dd55599
Showing
2 changed files
with
26 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
#{} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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)))) | ||
|
||
|