You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for making this library public. I am currently experimenting with Datascript and came across some strange behaviour. Either I am doing something wrong, or maybe it is a bug in Datascript. The problem is best illustrated with unit test that I wrote:
(defteststrange-test
(let [schema {:db/id {:db/unique:db.unique/identity}
:expr/depends-on {:db/type:db.type/ref:db/cardinality:db.cardinality/many}}
conn (datascript/create-conn schema)]
(datascript/transact!
conn
[{:db/id1}
{:db/id2}
{:db/id3}
[:db/add3:expr/depends-on1]
[:db/add3:expr/depends-on2]
[:db/add2:expr/depends-on2]])
;; Find expressions that depend on themselves.;; This test *fails* but I would expect it to pass. Is it a bug in Datascript?
(is (= #{[2]}
(datascript/q
'[:find ?x
:where
[?x :expr/depends-on ?x]]
@conn)))
;; But this, more bulky version, works. It passes, as I expect.
(is (= #{[2]}
(datascript/q
'[:find ?x
:where
[?x :expr/depends-on ?y]
[(= ?x ?y)]]
@conn)))))
This first is form fails, but I would expect it to pass. The second is form passes, as I would expect. I would expect both to pass.
The Datascript version is 0.16.2.
The error message in the unit test is
Thanks for making this library public. I am currently experimenting with Datascript and came across some strange behaviour. Either I am doing something wrong, or maybe it is a bug in Datascript. The problem is best illustrated with unit test that I wrote:
This first
is
form fails, but I would expect it to pass. The secondis
form passes, as I would expect. I would expect both to pass.The Datascript version is
0.16.2
.The error message in the unit test is
Did I misunderstand something about how Datascript works, or is this a bug? Thank you.
The text was updated successfully, but these errors were encountered: