Skip to content
Browse files

fix tests

  • Loading branch information...
1 parent 7758e6b commit 1ee8aa415808d5e7ab8fc0b17c0b584fdec35397 @ninjudd committed Jun 9, 2011
Showing with 11 additions and 10 deletions.
  1. +8 −7 proto/jiraph/test.proto
  2. +3 −3 test/jiraph/graph_test.clj
View
15 proto/jiraph/test.proto
@@ -28,17 +28,18 @@ message Entry {
}
message Edge {
- required string to_id = 1;
+ optional string id = 1;
optional string a = 2;
optional string b = 3;
optional bool deleted = 4;
}
message Node {
- optional string id = 1;
- repeated Edge edges = 2 [(map_by) = "to_id"];
- optional int32 rev = 3;
- optional int32 foo = 4;
- optional string bar = 5;
- repeated int32 baz = 6;
+ optional string id = 1;
+ repeated Edge edges = 2 [(map_by) = "id"];
+ optional Edge edge = 3;
+ optional int32 rev = 5;
+ optional int32 foo = 6;
+ optional string bar = 7;
+ repeated int32 baz = 8;
}
View
6 test/jiraph/graph_test.clj
@@ -128,7 +128,7 @@
(is (= #{"4"} (get-incoming layer-name "1")))
(is (update-node! layer-name "4" (constantly {:edge {:id "2"}})))
(is (= #{"4"} (get-incoming layer-name "2")))
- (is (update-node! layer-name "4" (constantly {:edge {:id "2" :deleted true}})))
+ (is (update-node! layer-name "4" (constantly {:edge {:deleted true}})))
(is (compact-node! layer-name "4"))
(is (= #{} (get-incoming layer-name "2")))))))
@@ -170,7 +170,7 @@
(add-node! layer-name "8" {:foo 9})))
(is (= 8 (:foo (get-node layer-name "8")))))
-
+
(testing "keeps track of incoming edges inside at-revision"
(at-revision 199 (is (= nil (get-incoming layer-name "11"))))
@@ -220,7 +220,7 @@
(is (add-node! layer-name "1" old))
(is (= [old new] (assoc-node! layer-name "1" {:foo 54 :baz [1 2 3]})))
(is (= (assoc new :id "1") (get-node layer-name "1")))))
-
+
(testing "assoc-node! creates node if it doesn't exist"
(let [node {:foo 9 :bar "the answer"}]
(is (= [nil node] (assoc-node! layer-name "2" {:foo 9 :bar "the answer"})))

0 comments on commit 1ee8aa4

Please sign in to comment.
Something went wrong with that request. Please try again.