mentat/tx/fixtures/test_add.edn
Nick Alexander afafcd64a0 [tx] Start implementing bulk SQL insertion algorithms (#214). r=rnewman,jsantell
* Pre: Add some value conversion tests.

This is follow-up to earlier work.  Turn TypedValue::Keyword into
edn::Value::NamespacedKeyword.  Don't take a reference to
value_type_tag.

* Pre: Add repeat_values.

Requires itertools, so this commit is not stand-alone.

* Pre: Expose the first transaction ID as bootstrap::TX0.

This is handy for testing.

* Pre: Improve debug module.

* Pre: Bump rusqlite version for https://github.com/jgallagher/rusqlite/issues/211.

* Pre: Use itertools.

* Start implementing bulk SQL insertion algorithms. (#214)

This is slightly simpler re-expression of the existing Clojure
implementation.

* Post: Start generic data-driven transaction testing. (#188)

* Review comment: `use ::{SYMBOL}` instead of `use {SYMBOL}`.

* Review comment: Prefer bindings_per_statement to values_per_statement.
2017-02-08 14:04:32 -08:00

66 lines
2.2 KiB
Clojure

[{:test/label ":db.cardinality/one, insert"
:test/assertions
[[:db/add 100 :db/ident :keyword/value1]
[:db/add 101 :db/ident :keyword/value2]]
:test/expectedtransaction
#{[100 :db/ident :keyword/value1 ?tx1 true]
[101 :db/ident :keyword/value2 ?tx1 true]
[?tx1 :db/txInstant ?ms1 ?tx1 true]}
:test/expecteddatoms
#{[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]]
:test/expectedtransaction
#{[200 :db.schema/attribute 100 ?tx2 true]
[200 :db.schema/attribute 101 ?tx2 true]
[?tx2 :db/txInstant ?ms2 ?tx2 true]}
:test/expecteddatoms
#{[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, replace"
:test/assertions
[[:db/add 100 :db/ident :keyword/value11]
[:db/add 101 :db/ident :keyword/value22]]
:test/expectedtransaction
#{[100 :db/ident :keyword/value1 ?tx3 false]
[100 :db/ident :keyword/value11 ?tx3 true]
[101 :db/ident :keyword/value2 ?tx3 false]
[101 :db/ident :keyword/value22 ?tx3 true]
[?tx3 :db/txInstant ?ms3 ?tx3 true]}
:test/expecteddatoms
#{[100 :db/ident :keyword/value11]
[101 :db/ident :keyword/value22]
[200 :db.schema/attribute 100]
[200 :db.schema/attribute 101]}}
{:test/label ":db.cardinality/one, already present"
:test/assertions
[[:db/add 100 :db/ident :keyword/value11]
[:db/add 101 :db/ident :keyword/value22]]
:test/expectedtransaction
#{[?tx4 :db/txInstant ?ms4 ?tx4 true]}
:test/expecteddatoms
#{[100 :db/ident :keyword/value11]
[101 :db/ident :keyword/value22]
[200 :db.schema/attribute 100]
[200 :db.schema/attribute 101]}}
{:test/label ":db.cardinality/many, already present"
:test/assertions
[[:db/add 200 :db.schema/attribute 100]
[:db/add 200 :db.schema/attribute 101]]
:test/expectedtransaction
#{[?tx5 :db/txInstant ?ms5 ?tx5 true]}
:test/expecteddatoms
#{[100 :db/ident :keyword/value11]
[101 :db/ident :keyword/value22]
[200 :db.schema/attribute 100]
[200 :db.schema/attribute 101]}}
]