Skip to content

Commit

Permalink
Normalize all issue links
Browse files Browse the repository at this point in the history
  • Loading branch information
tonsky committed Jun 19, 2024
1 parent 76c2510 commit 2094102
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 32 deletions.
2 changes: 1 addition & 1 deletion src/datascript/query.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@
(da/aset tuples-args i (get attrs arg)))
(da/aset static-args i arg))))
;; CLJS `apply` + `vector` will hold onto mutable array of arguments directly
;; https://github.com/tonsky/datascript/issues/262
;; issue-262
(if #?(:clj false
:cljs (identical? f vector))
(fn [tuple]
Expand Down
2 changes: 1 addition & 1 deletion test/datascript/test/explode.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
[{:name "Ivan" :profile {:email "@2"}}]
#{[1 :name "Ivan"] [1 :profile 2] [2 :email "@2"]}

;; https://github.com/tonsky/datascript/issues/59
;; issue-59
[{:profile {:email "@2"}}]
#{[2 :profile 1] [1 :email "@2"]}

Expand Down
2 changes: 1 addition & 1 deletion test/datascript/test/lookup_refs.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@
#{[[:name "Ivan"] [:name "Petr"]]
[[:name "Petr"] [:name "Oleg"]]}))

;; https://github.com/tonsky/datascript/issues/214
;; issue-214
(is (= (d/q '[:find ?e
:in $ [?e ...]
:where [?e :friend 3]]
Expand Down
8 changes: 4 additions & 4 deletions test/datascript/test/pull_api.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
(is (= {:name "Petr" :_father [{:name "David"} {:name "Thomas"}]}
(d/pull test-db '[:name {:_father [:name]}] 1))))

(testing "Multiple reverse refs #412"
(testing "Multiple reverse refs issue-412"
(is (= {:name "Petr" :_father [{:db/id 2} {:db/id 3}]}
(d/pull test-db '[:name :_father :_child] 1)))))

Expand Down Expand Up @@ -144,7 +144,7 @@
(testing "Like explicit recursion, expansion will not allow loops"
(is (= rpart (d/pull recdb '[:name :part] 10))))

(testing "Reverse recursive component #411"
(testing "Reverse recursive component issue-411"
(is (= {:name "Part A.A.A.B" :_part {:name "Part A.A.A" :_part {:name "Part A.A" :_part {:name "Part A"}}}}
(d/pull test-db '[:name {:_part ...}] 14)))
(is (= {:name "Part A.A.A.B" :_part {:name "Part A.A.A" :_part {:name "Part A.A"}}}
Expand Down Expand Up @@ -433,7 +433,7 @@
(is (= (str "Person-" (dec depth))
(:name (get-in pulled path))))))

; https://github.com/tonsky/datascript/issues/430
; issue-430
(deftest test-component-reverse
(let [schema {:ref {:db/valueType :db.type/ref
:db/isComponent true}}
Expand Down Expand Up @@ -474,7 +474,7 @@
{[:child :xform vector] '...}]
1)))

(testing ":xform on cardinality/one ref #455"
(testing ":xform on cardinality/one ref issue-455"
(is (= {:name "David" :father "Petr"}
(d/pull test-db [:name {[:father :xform #(:name %)] ['*]}] 2))))

Expand Down
6 changes: 3 additions & 3 deletions test/datascript/test/query_or.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
[(ground "Ivan") ?n]]
#{2 6})

;; #348
;; issue-348
(is (= #{[1] [3] [4] [5]}
(d/q '[:find ?e
:in $ ?a
Expand All @@ -110,7 +110,7 @@
[?e :name "Oleg"])]
@test-db 10)))

;; #348
;; issue-348
(is (= #{[1] [3] [4] [5]}
(d/q '[:find ?e
:in $ ?a
Expand All @@ -119,7 +119,7 @@
[?e :name "Oleg"])]
@test-db 10)))

;; #348
;; issue-348
(is (= #{[1] [3] [4] [5]}
(d/q '[:find ?e
:in $ ?a
Expand Down
10 changes: 5 additions & 5 deletions test/datascript/test/query_rules.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
[(even? ?e)]
[(even? ?e2)]]])
#{[4 6] [2 4]})))
(testing "Calling rule twice (#44)"
(testing "Calling rule twice (issue-44)"
(d/q '[:find ?p
:in $ % ?fn
:where (rule ?p ?fn "a")
Expand All @@ -159,21 +159,21 @@
[(>= ?a 18)]]])
#{["Oleg"]})))

(testing "Rule name validation #319"
(testing "Rule name validation issue-319"
(is (thrown-msg? "Unknown rule 'wat in (wat ?x)"
(d/q '[:find ?x
:in $ %
:where (wat ?x)]
[] []))))

(testing "Rule vars validation"
(is (thrown-msg? "Cannot parse var, expected symbol starting with ?, got: $e1" ;; #300
(is (thrown-msg? "Cannot parse var, expected symbol starting with ?, got: $e1" ;; issue-300
(d/q '[:find ?e :in $ % :where [?e]]
(d/empty-db)
'[[(rule $e1 ?e2)
[?e1 :ref ?e2]]])))))

;; https://github.com/tonsky/datascript/issues/218
;; issue-218
(deftest test-false-arguments
(let [db (d/db-with (d/empty-db)
[[:db/add 1 :attr true]
Expand All @@ -190,7 +190,7 @@
db rules)))))


; https://github.com/tonsky/datascript/issues/456
; issue-456
; this used to stall for nearly a minute and/or fail with an OOM exception
; due to propagation of a relation with duplicate tuples during rule solving
(deftest test-rule-performance-on-larger-datasets
Expand Down
22 changes: 11 additions & 11 deletions test/datascript/test/transact.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
:where [2 ?a ?v]] db)
#{[:name "Petr"] [:age 37]})))))

(deftest test-retract-without-value-339
(deftest test-retract-without-value-issue-339
(let [db (-> (d/empty-db {:aka {:db/cardinality :db.cardinality/many}
:friend {:db/valueType :db.type/ref}})
(d/db-with [{:db/id 1, :name "Ivan", :age 15, :aka ["X" "Y" "Z"], :friend 2}
Expand Down Expand Up @@ -275,7 +275,7 @@
(is (= #{[1 :name "Ivan"] [2 :ref 1]}
(tdc/all-datoms db'))))

(testing "#363"
(testing "issue-363"
(let [db' (-> db
(d/db-with [[:db/add -1 :name "Ivan"]])
(d/db-with [[:db/add -1 :name "Ivan"]
Expand All @@ -287,7 +287,7 @@
[:db/add -2 :ref -1]]))]
(is (= #{[1 :aka "Batman"] [2 :ref 1]} (tdc/all-datoms db')))))))

(deftest test-tempid-ref-295
(deftest test-tempid-ref-issue-295
(let [db (-> (d/empty-db {:ref {:db/unique :db.unique/identity
:db/valueType :db.type/ref}})
(d/db-with [[:db/add -1 :name "Ivan"]
Expand Down Expand Up @@ -327,15 +327,15 @@
(let [db (d/empty-db {:friend {:db/valueType :db.type/ref}
:comp {:db/valueType :db.type/ref, :db/isComponent true}
:multi {:db/cardinality :db.cardinality/many}})]
(testing "Unused tempid" ;; #304
(testing "Unused tempid" ;; issue-304
(is (thrown-msg? "Tempids used only as value in transaction: (-2)"
(d/db-with db [[:db/add -1 :friend -2]])))
(is (thrown-msg? "Tempids used only as value in transaction: (-2)"
(d/db-with db [{:db/id -1 :friend -2}])))
(is (thrown-msg? "Tempids used only as value in transaction: (-1)"
(d/db-with db [{:db/id -1}
[:db/add -2 :friend -1]])))
; Needs #357
; Needs issue-357
; (is (thrown-msg? "Tempids used only as value in transaction: (-1)"
; (d/db-with db [{:db/id -1 :comp {}}
; [:db/add -2 :friend -1]])))
Expand Down Expand Up @@ -374,8 +374,8 @@
(is (= (into {} (d/entity @conn tx-id))
{:prop4 "prop4"})))))))

(deftest test-transient-294
"db.fn/retractEntity retracts attributes of adjacent entities #294"
(deftest test-transient-issue-294
"db.fn/retractEntity retracts attributes of adjacent entities issue-294"
(let [db (reduce #(d/db-with %1 [{:db/id %2 :a1 1 :a2 2 :a3 3}])
(d/empty-db)
(range 1 10))
Expand All @@ -389,7 +389,7 @@
(d/datom 2 :a3 3)]
(:tx-data report)))))

(deftest test-large-ids-292
(deftest test-large-ids-issue-292
(let [db (d/empty-db {:ref {:db/valueType :db.type/ref}})]
(is (thrown-msg? "Highest supported entity id is 2147483647, got 285873023227265"
(d/with db [[:db/add 285873023227265 :name "Valerii"]])))
Expand All @@ -404,7 +404,7 @@
(is (thrown-msg? "Highest supported entity id is 2147483647, got 285873023227265"
(d/with db [(db/datom 1 :ref 285873023227265)]))))))

(deftest test-uncomparable-356
(deftest test-uncomparable-issue-356
(let [db (d/empty-db {:multi {:db/cardinality :db.cardinality/many}
:index {:db/index true}})]

Expand Down Expand Up @@ -445,12 +445,12 @@
(is (= [(db/datom 1 :index {:map 3})]
(vec (d/datoms db' :avet :index {:map 3} 1)))))))

(deftest test-compare-numbers-js-404
(deftest test-compare-numbers-js-issue-404
(let [db (d/db-with (d/empty-db) [{:num 42.5}])
db' (d/db-with db [[:db/retract 1 :num 42]])]
(is (= #{[1 :num 42.5]} (tdc/all-datoms db')))))

(deftest test-transitive-type-compare-386
(deftest test-transitive-type-compare-issue-386
(let [txs [[{:block/uid "2LB4tlJGy"}]
[{:block/uid "2ON453J0Z"}]
[{:block/uid "2KqLLNbPg"}]
Expand Down
4 changes: 2 additions & 2 deletions test/datascript/test/tuples.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@
[2 :c "c"]}
(tdc/all-datoms (d/db conn))))))

;; https://github.com/tonsky/datascript/issues/473
;; issue-473
(deftest test-upsert-by-tuple-components
(let [db (d/empty-db {:a+b {:db/tupleAttrs [:a :b]
:db/unique :db.unique/identity}})
Expand Down Expand Up @@ -294,7 +294,7 @@
:c "c"}
(d/pull (d/db conn) '[*] [:a+b ["a" "b"]])))))

;; https://github.com/tonsky/datascript/issues/452
;; issue-452
(deftest lookup-refs-in-tuple
(let [schema {:ref {:db/valueType :db.type/ref}
:name {:db/unique :db.unique/identity}
Expand Down
8 changes: 4 additions & 4 deletions test/datascript/test/upsert.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@
(is (= {:db/id 4 :name "Olga" :email "@4" :ref 1 :age 38}
(pull tx 4)))))

;; https://github.com/tonsky/datascript/issues/464
;; issue-464
(testing "not upsert by ref"
(let [tx (d/with db [{:db/id -1 :name "Igor"}
{:db/id -2 :name "Anna" :ref -1}])]
Expand Down Expand Up @@ -211,7 +211,7 @@
(d/with db [{:db/id -1 :name "Ivan" :age 35}
{:db/id -1 :name "Oleg" :age 36}])))))

;; https://github.com/tonsky/datascript/issues/285
;; issue-285
(deftest test-retries-order
(let [db (-> (d/empty-db {:name {:db/unique :db.unique/identity}})
(d/db-with [[:db/add -1 :age 42]
Expand All @@ -229,7 +229,7 @@
(is (= {:db/id 2, :name "Bob", :likes "Pizza", :age 42}
(tdc/entity-map db 2)))))

;; https://github.com/tonsky/datascript/issues/403
;; issue-403
(deftest test-upsert-string-tempid-ref
(let [db (-> (d/empty-db {:name {:db/unique :db.unique/identity}
:ref {:db/valueType :db.type/ref}})
Expand All @@ -250,7 +250,7 @@
(d/db-with db [[:db/add -1, :name "Alice"]
{:age 36, :ref -1}]))))))

;; https://github.com/tonsky/datascript/issues/472
;; issue-472
(deftest test-two-tempids-two-retries
(let [schema {:name {:db/unique :db.unique/identity}
:ref {:db/valueType :db.type/ref}}
Expand Down

0 comments on commit 2094102

Please sign in to comment.