Skip to content

Commit

Permalink
Merge branch 'main' of github.com:threatgrid/naga into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Paula Gearon committed Aug 6, 2020
2 parents efaced5 + db8c436 commit ea19cab
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ pom.xml.asc
.hgignore
.hg/
.eastwood
test/tmp/*
example_data/out.json
deploy.tok
deploy.tok
File renamed without changes.
File renamed without changes.
9 changes: 9 additions & 0 deletions test/naga/data/json-family.lg
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
jn:SymmetricProperty(sibling).

parent(B,Cid) :- sibling(A,Bid), id(B,Bid), parent(A,Cid), id(C,Cid) .

brother(A,Bid) :- sibling(A,Bid), id(B,Bid), type(B,"male") .

uncle(A,Cid) :- parent(A,Bid), id(B,Bid), brother(B,Cid).

P(B,Aid) :- P(A,Bid), id(A,Aid), id(B,Bid), jn:SymmetricProperty(P).
5 changes: 2 additions & 3 deletions test/naga/test_integration.clj
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,8 @@
{:id "mary", :sibling "george", :brother "george"}])

(deftest test-json-flow
(let [[out err] (capture-output -main "--json example_data/in.json --out example_data/out.json example_data/json-family.lg")
json-result (json/parse-string (slurp "example_data/out.json") keyword)]

(let [[out err] (capture-output -main "--json test/naga/data/in.json --out test/tmp/out.json test/naga/data/json-family.lg")
json-result (json/parse-string (slurp "test/tmp/out.json") keyword)]
(is (empty? out))
(is (empty? err))
(is (= (sort-by :id json-result) json-out))))
Empty file added test/tmp/.gitkeep
Empty file.

0 comments on commit ea19cab

Please sign in to comment.