pull/1396/head
Tienson Qin 2021-03-01 21:27:14 +08:00
parent fe663cc858
commit 2071de2a91
1 changed files with 11 additions and 11 deletions

View File

@ -129,7 +129,7 @@ parent: child page 2
" " empty-result))
(testing "Non exists page should be ignored"
(are [x y] (= (q x) y)
(are [x y] (nil? (:result (q x)))
"[[page-not-exist]]" empty-result
"[[another-page-not-exist]]" empty-result))
@ -259,32 +259,32 @@ parent: child page 2
(are [x y] (= (q-count x) y)
"(page-tags [[page-tag-1]])"
{:query '[[?p :page/tags ?t]
[?t :page/name ?tag]
[(contains? #{"page-tag-1"} ?tag)]]
[?t :page/name ?tag1]
[(contains? #{"page-tag-1"} ?tag1)]]
:count 1}
"(page-tags page-tag-2)"
{:query '[[?p :page/tags ?t]
[?t :page/name ?tag]
[(contains? #{"page-tag-2"} ?tag)]]
[?t :page/name ?tag1]
[(contains? #{"page-tag-2"} ?tag1)]]
:count 2}
"(page-tags page-tag-1 page-tag-2)"
{:query '[[?p :page/tags ?t]
[?t :page/name ?tag]
[(contains? #{"page-tag-1" "page-tag-2"} ?tag)]]
[?t :page/name ?tag1]
[(contains? #{"page-tag-1" "page-tag-2"} ?tag1)]]
:count 2}
"(page-tags page-TAG-1 page-tag-2)"
{:query '[[?p :page/tags ?t]
[?t :page/name ?tag]
[(contains? #{"page-tag-1" "page-tag-2"} ?tag)]]
[?t :page/name ?tag1]
[(contains? #{"page-tag-1" "page-tag-2"} ?tag1)]]
:count 2}
"(page-tags [page-tag-1 page-tag-2])"
{:query '[[?p :page/tags ?t]
[?t :page/name ?tag]
[(contains? #{"page-tag-1" "page-tag-2"} ?tag)]]
[?t :page/name ?tag1]
[(contains? #{"page-tag-1" "page-tag-2"} ?tag1)]]
:count 2}))
(testing "page-property queries"