Skip to content

Commit

Permalink
test fixes for 2.9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jliszka committed Jan 19, 2012
1 parent 340cf0c commit 41c344b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/test/scala/com/foursquare/rogue/QueryTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,7 @@ class QueryTest extends SpecsMatchers {

// Can't say useIndex and then not use that field.
check("""Venue.useIndex(Venue.idIdx).where(_.legacyid eqs 4)""",
Some("found.*EqClause.*required.*Venue#_id"))
Some("found.*EqClause.*required.*_id"))
// Can't use where with an IndexScan'ing operation.
check("""Venue.useIndex(Venue.idIdx).where(_._id)(_ after new DateTime())""",
Some("do not conform to method where.*com.foursquare.rogue.Indexable"))
Expand All @@ -657,22 +657,22 @@ class QueryTest extends SpecsMatchers {

// Can't skip past the first field in an index.
check("""Venue.useIndex(Venue.idIdx).rangeScan(_._id)""",
Some("could not find implicit value for parameter ev.*com.foursquare.rogue.UsedIndex"))
Some("(could not find implicit value for parameter ev|Cannot prove that).*com.foursquare.rogue.UsedIndex"))

// Can't skip past the first field in an index.
check("""Venue.useIndex(Venue.mayorIdIdx).rangeScan(_.mayor).iscan(_._id)(_ eqs new ObjectId())""",
Some("could not find implicit value for parameter ev.*com.foursquare.rogue.UsedIndex"))
Some("(could not find implicit value for parameter ev|Cannot prove that).*com.foursquare.rogue.UsedIndex"))

// If first column is index-scanned, other fields must be marked as iscan too.
check("""Venue.useIndex(Venue.mayorIdIdx).iscan(_.mayor)(_ lt 10).where(_._id)(_ eqs new ObjectId())""",
Some("could not find implicit value for parameter ev.*com.foursquare.rogue.Indexable"))
Some("(could not find implicit value for parameter ev|Cannot prove that).*com.foursquare.rogue.Indexable"))
// Query should compile fine when the second clause is marked as iscan.
check("""Venue.useIndex(Venue.mayorIdIdx).iscan(_.mayor)(_ lt 10).iscan(_._id)(_ eqs new ObjectId())""",
None)

// If you rangeScan past a column, you must iscan all index fields after.
check("""Venue.useIndex(Venue.mayorIdClosedIdx).where(_.mayor)(_ eqs 10).rangeScan(_._id).where(_.closed)(_ eqs true)""",
Some("could not find implicit value for parameter ev.*com.foursquare.rogue.Indexable"))
Some("(could not find implicit value for parameter ev|Cannot prove that).*com.foursquare.rogue.Indexable"))
// Version of the above with an iscan of later fields.
check("""Venue.useIndex(Venue.mayorIdClosedIdx).where(_.mayor)(_ eqs 10).rangeScan(_._id).iscan(_.closed)(_ eqs true)""",
None)
Expand Down

0 comments on commit 41c344b

Please sign in to comment.