2017-02-08 22:04:32 +00:00
|
|
|
[{:test/label ":db.cardinality/one, insert"
|
|
|
|
:test/assertions
|
|
|
|
[[:db/add 100 :db/ident :keyword/value1]
|
|
|
|
[:db/add 101 :db/ident :keyword/value2]]
|
2017-02-11 20:06:09 +00:00
|
|
|
:test/expected-transaction
|
2017-02-08 22:04:32 +00:00
|
|
|
#{[100 :db/ident :keyword/value1 ?tx1 true]
|
|
|
|
[101 :db/ident :keyword/value2 ?tx1 true]
|
|
|
|
[?tx1 :db/txInstant ?ms1 ?tx1 true]}
|
2017-02-11 20:06:09 +00:00
|
|
|
:test/expected-datoms
|
2017-02-08 22:04:32 +00:00
|
|
|
#{[100 :db/ident :keyword/value1]
|
|
|
|
[101 :db/ident :keyword/value2]}}
|
|
|
|
|
|
|
|
{:test/label ":db.cardinality/many, insert"
|
|
|
|
:test/assertions
|
|
|
|
[[:db/add 200 :db.schema/attribute 100]
|
|
|
|
[:db/add 200 :db.schema/attribute 101]]
|
2017-02-11 20:06:09 +00:00
|
|
|
:test/expected-transaction
|
2017-02-08 22:04:32 +00:00
|
|
|
#{[200 :db.schema/attribute 100 ?tx2 true]
|
|
|
|
[200 :db.schema/attribute 101 ?tx2 true]
|
|
|
|
[?tx2 :db/txInstant ?ms2 ?tx2 true]}
|
2017-02-11 20:06:09 +00:00
|
|
|
:test/expected-datoms
|
2017-02-08 22:04:32 +00:00
|
|
|
#{[100 :db/ident :keyword/value1]
|
|
|
|
[101 :db/ident :keyword/value2]
|
|
|
|
[200 :db.schema/attribute 100]
|
|
|
|
[200 :db.schema/attribute 101]}}
|
|
|
|
|
|
|
|
{:test/label ":db.cardinality/one, retract"
|
|
|
|
:test/assertions
|
|
|
|
[[:db/retract 100 :db/ident :keyword/value1]]
|
2017-02-11 20:06:09 +00:00
|
|
|
:test/expected-transaction
|
2017-02-08 22:04:32 +00:00
|
|
|
#{[100 :db/ident :keyword/value1 ?tx3 false]
|
|
|
|
[?tx3 :db/txInstant ?ms3 ?tx3 true]}
|
2017-02-11 20:06:09 +00:00
|
|
|
:test/expected-datoms
|
2017-02-08 22:04:32 +00:00
|
|
|
#{[101 :db/ident :keyword/value2]
|
|
|
|
[200 :db.schema/attribute 100]
|
|
|
|
[200 :db.schema/attribute 101]}}
|
|
|
|
|
|
|
|
{:test/label ":db.cardinality/many, retract"
|
|
|
|
:test/assertions
|
|
|
|
[[:db/retract 200 :db.schema/attribute 100]]
|
2017-02-11 20:06:09 +00:00
|
|
|
:test/expected-transaction
|
2017-02-08 22:04:32 +00:00
|
|
|
#{[200 :db.schema/attribute 100 ?tx4 false]
|
|
|
|
[?tx4 :db/txInstant ?ms4 ?tx4 true]}
|
2017-02-11 20:06:09 +00:00
|
|
|
:test/expected-datoms
|
2017-02-08 22:04:32 +00:00
|
|
|
#{[101 :db/ident :keyword/value2]
|
|
|
|
[200 :db.schema/attribute 101]}
|
|
|
|
}
|
|
|
|
|
|
|
|
{:test/label ":db.cardinality/{one,many}, not present."
|
|
|
|
:test/assertions
|
|
|
|
[[:db/retract 100 :db/ident :keyword/value1]
|
|
|
|
[:db/retract 200 :db.schema/attribute 100]]
|
2017-02-11 20:06:09 +00:00
|
|
|
:test/expected-transaction
|
2017-02-08 22:04:32 +00:00
|
|
|
#{[?tx5 :db/txInstant ?ms5 ?tx5 true]}
|
2017-02-11 20:06:09 +00:00
|
|
|
:test/expected-datoms
|
2017-02-08 22:04:32 +00:00
|
|
|
#{[101 :db/ident :keyword/value2]
|
|
|
|
[200 :db.schema/attribute 101]}
|
|
|
|
}
|
|
|
|
]
|