diff options
author | vlad <vlad@driver.xyz> | 2017-06-13 16:15:07 -0700 |
---|---|---|
committer | vlad <vlad@driver.xyz> | 2017-06-13 16:15:07 -0700 |
commit | 91a4120b4253dc4a1e9552ec39fcb25c303a21e1 (patch) | |
tree | 9173797ed8e3d780f98ac8d0f85507eeb10c8016 /src/test/scala/xyz/driver/pdsuicommon/db/SearchFilterExprSuite.scala | |
parent | cd1b635b2ae90d9ac2d8b1779183a1fbd8c5fd5c (diff) | |
download | rest-query-d55b202095f733138d5583966984c22e102c08f8.tar.gz rest-query-d55b202095f733138d5583966984c22e102c08f8.tar.bz2 rest-query-d55b202095f733138d5583966984c22e102c08f8.zip |
Diffstat (limited to 'src/test/scala/xyz/driver/pdsuicommon/db/SearchFilterExprSuite.scala')
-rw-r--r-- | src/test/scala/xyz/driver/pdsuicommon/db/SearchFilterExprSuite.scala | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/test/scala/xyz/driver/pdsuicommon/db/SearchFilterExprSuite.scala b/src/test/scala/xyz/driver/pdsuicommon/db/SearchFilterExprSuite.scala index ee467af..35c8d30 100644 --- a/src/test/scala/xyz/driver/pdsuicommon/db/SearchFilterExprSuite.scala +++ b/src/test/scala/xyz/driver/pdsuicommon/db/SearchFilterExprSuite.scala @@ -6,14 +6,16 @@ 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 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" => @@ -22,7 +24,7 @@ class SearchFilterExprSuite extends FreeSpecLike with MustMatchers { val result = newAst.find { case x: SearchFilterExpr.Atom.Binary => x.dimension.name == "foo" - case _ => false + case _ => false } result mustBe empty |