Skip to content
Snippets Groups Projects
Commit 33a68e8b authored by Régis Blanc's avatar Régis Blanc
Browse files

unit test to make sure contract of Extractors is clear

parent fd2c6cec
No related branches found
No related tags found
No related merge requests found
......@@ -25,6 +25,27 @@ class ExtractorsSuite extends FunSuite with ExpressionsDSL {
assert(e3 === e4)
}
test("Extractors do not magically change the syntax") {
val e1 = Equals(bi(1), bi(1))
val e2 = e1 match {
case Operator(es, builder) => builder(es)
}
assert(e1 === e2)
val e3 = Equals(BooleanLiteral(true), BooleanLiteral(false))
val e4 = e3 match {
case Operator(es, builder) => builder(es)
}
assert(e3 === e4)
val e5 = TupleSelect(Tuple(Seq(bi(1), bi(2))), 2)
val e6 = e5 match {
case Operator(es, builder) => builder(es)
}
assert(e5 === e6)
}
test("Extractors of NonemptyArray with sparse elements") {
val a1 = NonemptyArray(Map(0 -> x, 3 -> y, 5 -> z), Some((BigInt(0), BigInt(10))))
val a2 = a1 match {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment