Inherits whatever limitations are in repr-test-util, namely that support for different types of Datums is incomplete. Follow the documentation for test_spec_to_row to see which types of Datums are currently supported.
See the README for the lowertest crate for the standard syntax.
The following variants of MirScalarExpr
have non-standard syntax:
- Literal -> the syntax is
(<literal> <scalar type>)
or<literal>
. If<scalar type>
is not specified, then literals will be assigned default types:- true/false become Bool
- numbers become Int64
- strings become String
- Column -> the syntax is
#n
, where n is the column number.
The following variants of MirRelationExpr
have non-standard syntax:
- Let -> the syntax is
(let x <value> <body>)
where x is an ident that should not match any existing ident in any Let statement in<value>
. - Get -> the syntax is
(get x)
, where x is an ident that refers to a pre-defined source or an ident defined in a let. - Union -> the syntax is
(union <input1> .. <inputn>)
. - Constant -> the syntax is
(constant [[<row1literal1>..<row1literaln>]..[<rowiliteral1>..<rowiliteraln>]] <RelationType> )
The TestCatalog
has following commands.
(defsource <name> <RelationType>)
- defines source<name>
with schema<RelationType>
The tests in this crate are meant to:
- Test that arbitrary MIR creation works.
- Give examples for how unit testing with MIRs work.
To create arbitrary MIRs in unit tests of functions on MIRs, import this crate as a dev dependency to the crate you are testing.