diff --git a/.gitignore b/.gitignore index e40e7ec..d6d31cc 100644 --- a/.gitignore +++ b/.gitignore @@ -10,5 +10,6 @@ pom.xml.asc .hgignore .hg/ .eastwood +test/tmp/* example_data/out.json -deploy.tok +deploy.tok \ No newline at end of file diff --git a/example_data/in.json b/test/naga/data/in.json similarity index 100% rename from example_data/in.json rename to test/naga/data/in.json diff --git a/example_data/in.schema b/test/naga/data/in.schema similarity index 100% rename from example_data/in.schema rename to test/naga/data/in.schema diff --git a/test/naga/data/json-family.lg b/test/naga/data/json-family.lg new file mode 100644 index 0000000..8782673 --- /dev/null +++ b/test/naga/data/json-family.lg @@ -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). diff --git a/test/naga/test_integration.clj b/test/naga/test_integration.clj index b09cb5d..471058b 100644 --- a/test/naga/test_integration.clj +++ b/test/naga/test_integration.clj @@ -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)))) diff --git a/test/tmp/.gitkeep b/test/tmp/.gitkeep new file mode 100644 index 0000000..e69de29