Skip to content
Browse files

Add tests for the scoretype checking

  • Loading branch information...
1 parent 6f88b03 commit 0b9a837bd2bd011c499b27ab5d69db2dfdac8a1b @holdenk holdenk committed Jun 3, 2012
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

0 comments on commit 0b9a837

Please sign in to comment.
Something went wrong with that request. Please try again.