Skip to content
This repository
Browse code

fix tests

  • Loading branch information...
commit 1ee8aa415808d5e7ab8fc0b17c0b584fdec35397 1 parent 7758e6b
Justin Balthrop authored

Showing 2 changed files with 11 additions and 10 deletions. Show diff stats Hide diff stats

  1. +8 7 proto/jiraph/test.proto
  2. +3 3 test/jiraph/graph_test.clj
15 proto/jiraph/test.proto
@@ -28,17 +28,18 @@ message Entry {
28 28 }
29 29
30 30 message Edge {
31   - required string to_id = 1;
  31 + optional string id = 1;
32 32 optional string a = 2;
33 33 optional string b = 3;
34 34 optional bool deleted = 4;
35 35 }
36 36
37 37 message Node {
38   - optional string id = 1;
39   - repeated Edge edges = 2 [(map_by) = "to_id"];
40   - optional int32 rev = 3;
41   - optional int32 foo = 4;
42   - optional string bar = 5;
43   - repeated int32 baz = 6;
  38 + optional string id = 1;
  39 + repeated Edge edges = 2 [(map_by) = "id"];
  40 + optional Edge edge = 3;
  41 + optional int32 rev = 5;
  42 + optional int32 foo = 6;
  43 + optional string bar = 7;
  44 + repeated int32 baz = 8;
44 45 }
6 test/jiraph/graph_test.clj
@@ -128,7 +128,7 @@
128 128 (is (= #{"4"} (get-incoming layer-name "1")))
129 129 (is (update-node! layer-name "4" (constantly {:edge {:id "2"}})))
130 130 (is (= #{"4"} (get-incoming layer-name "2")))
131   - (is (update-node! layer-name "4" (constantly {:edge {:id "2" :deleted true}})))
  131 + (is (update-node! layer-name "4" (constantly {:edge {:deleted true}})))
132 132 (is (compact-node! layer-name "4"))
133 133 (is (= #{} (get-incoming layer-name "2")))))))
134 134
@@ -170,7 +170,7 @@
170 170 (add-node! layer-name "8" {:foo 9})))
171 171 (is (= 8 (:foo (get-node layer-name "8")))))
172 172
173   -
  173 +
174 174
175 175 (testing "keeps track of incoming edges inside at-revision"
176 176 (at-revision 199 (is (= nil (get-incoming layer-name "11"))))
@@ -220,7 +220,7 @@
220 220 (is (add-node! layer-name "1" old))
221 221 (is (= [old new] (assoc-node! layer-name "1" {:foo 54 :baz [1 2 3]})))
222 222 (is (= (assoc new :id "1") (get-node layer-name "1")))))
223   -
  223 +
224 224 (testing "assoc-node! creates node if it doesn't exist"
225 225 (let [node {:foo 9 :bar "the answer"}]
226 226 (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.