diff options
author | vlad <vlad@driver.xyz> | 2018-01-25 14:12:31 -0800 |
---|---|---|
committer | vlad <vlad@driver.xyz> | 2018-01-25 14:12:31 -0800 |
commit | a0877d81ca2844d75dc361b5ce7c99afacd6e25f (patch) | |
tree | 8fe49f45cbcddbbb9a3d167099abe7aa2625e56b /src/test/scala/xyz/driver/pdsuicommon/db | |
parent | 46a22e9ab324a0068a85952cdc809800f360f445 (diff) | |
download | rest-query-a0877d81ca2844d75dc361b5ce7c99afacd6e25f.tar.gz rest-query-a0877d81ca2844d75dc361b5ce7c99afacd6e25f.tar.bz2 rest-query-a0877d81ca2844d75dc361b5ce7c99afacd6e25f.zip |
Extracting query library
Diffstat (limited to 'src/test/scala/xyz/driver/pdsuicommon/db')
-rw-r--r-- | src/test/scala/xyz/driver/pdsuicommon/db/SearchFilterExprSuite.scala | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/src/test/scala/xyz/driver/pdsuicommon/db/SearchFilterExprSuite.scala b/src/test/scala/xyz/driver/pdsuicommon/db/SearchFilterExprSuite.scala deleted file mode 100644 index 35c8d30..0000000 --- a/src/test/scala/xyz/driver/pdsuicommon/db/SearchFilterExprSuite.scala +++ /dev/null @@ -1,34 +0,0 @@ -package xyz.driver.pdsuicommon.db - -import org.scalatest.{FreeSpecLike, MustMatchers} - -class SearchFilterExprSuite extends FreeSpecLike with MustMatchers { - - "replace" - { - "all entities are changed" in { - val ast = SearchFilterExpr.Union( - Seq( - SearchFilterExpr.Intersection( - Seq( - SearchFilterExpr.Atom.Binary("foo", SearchFilterBinaryOperation.Gt, "10"), - SearchFilterExpr.Atom.Binary("foo", SearchFilterBinaryOperation.Lt, "20") - )), - SearchFilterExpr.Atom.NAry("bar", SearchFilterNAryOperation.In, Seq("x", "y", "z")), - SearchFilterExpr.Atom.Binary("foo", SearchFilterBinaryOperation.Eq, "40") - )) - - val newAst = ast.replace { - case x: SearchFilterExpr.Atom.Binary if x.dimension.name == "foo" => - x.copy(dimension = x.dimension.copy(name = "bar")) - } - - val result = newAst.find { - case x: SearchFilterExpr.Atom.Binary => x.dimension.name == "foo" - case _ => false - } - - result mustBe empty - } - } - -} |