Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add tests for the scoretype checking

  • Loading branch information...
commit 0b9a837bd2bd011c499b27ab5d69db2dfdac8a1b 1 parent 6f88b03
@holdenk holdenk authored
Showing with 14 additions and 0 deletions.
  1. +14 −0 src/test/scala/com/foursquare/slashem/TypeCheckTests.scala
View
14 src/test/scala/com/foursquare/slashem/TypeCheckTests.scala
@@ -46,6 +46,20 @@ class TypeCheckTests extends SpecsMatchers with ScalaCheckMatchers {
SVenueTest where (_.name eqs "test") selectCase(_.name,((x: Option[String]) => TestPirate(x))) selectCase(_.name,((x: Option[String]) => TestPirate(x)))
""",shouldTypeCheck=false)
+ check("""
+ val params: Map[String, Any] = Map("lat" -> -31.1, "lon" -> 74.0, "weight" -> 2000, "weight2" -> 0.03)
+ ESimpleGeoPanda where (_.name eqs "test") scoreBoostField(_.point recipSqeGeoDistance(40, -74, 1, 5000, 1))
+ """,shouldTypeCheck=true)
+
+ check("""
+ val params: Map[String, Any] = Map("lat" -> -31.1, "lon" -> 74.0, "weight" -> 2000, "weight2" -> 0.03)
+ ESimpleGeoPanda where (_.name eqs "test") customScore("distance_score_magic", params)
+ """,shouldTypeCheck=true)
+
+ check("""
+ val params: Map[String, Any] = Map("lat" -> -31.1, "lon" -> 74.0, "weight" -> 2000, "weight2" -> 0.03)
+ ESimpleGeoPanda where (_.name eqs "test") scoreBoostField(_.point recipSqeGeoDistance(40, -74, 1, 5000, 1)) customScore("distance_score_magic", params)
+ """,shouldTypeCheck=false)
}
//Stolen from Rogue
Please sign in to comment.
Something went wrong with that request. Please try again.