[tx] Convert Clojure tests into Rust tests #103

Open
opened 2020-08-06 16:54:57 +00:00 by gburd · 0 comments
gburd commented 2020-08-06 16:54:57 +00:00 (Migrated from github.com)

The Clojure implementation has an extensive correctness test suite. Most of the tests look like:

  1. install test schema;
  2. transact a few assertions;
  3. assert that datoms, transactions, or fulltext values table has following contents/new rows.
    Since our SQL schema is identical to the Clojure implementation, it should be easy to move the input and output data into .edn files and write a generic test harness to do those steps.

It might be finicky to get the transaction IDs, timestamps, and other ephemeral data correct. I wonder if we can rewrite :db/tx and :db/txInstant in controlled locations to get what we want? (This could require reader syntax like #value [:db/tx] or similar.)

The Clojure implementation has an extensive correctness test suite. Most of the tests look like: 1. install test schema; 1. transact a few assertions; 1. assert that datoms, transactions, or fulltext values table has following contents/new rows. Since our SQL schema is identical to the Clojure implementation, it should be easy to move the input *and* output data into `.edn` files and write a generic test harness to do those steps. It might be finicky to get the transaction IDs, timestamps, and other ephemeral data correct. I wonder if we can rewrite `:db/tx` and `:db/txInstant` in controlled locations to get what we want? (This could require reader syntax like `#value [:db/tx]` or similar.)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: greg/mentat#103
No description provided.