Skip to content

Commit

Permalink
Removed Date.{MIN, MAX}, reverted scalatest to 2.2.6 because of 3.0.0…
Browse files Browse the repository at this point in the history
… is incompatible with scalamock yet - paulbutcher/ScalaMock#147
  • Loading branch information
Entea committed Sep 8, 2016
1 parent f5d47ea commit d741b02
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
5 changes: 1 addition & 4 deletions base/src/main/scala/co/uproot/abandon/Ast.scala
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ class InputFileNotFoundError(fileName:String) extends InputError("File not found
class ConstraintError(msg: String) extends RuntimeException(msg)

object Date {
val MIN: Date = Date(0, 1, 1)
val MAX: Date = Date(9999, 1, 1)

val yearMultiplier = 10000
val monthMultiplier = 100

Expand Down Expand Up @@ -222,4 +219,4 @@ case class Scope(entries: Seq[ASTEntry], parentOpt: Option[Scope]) extends ASTEn
def childScopes = Helper.filterByType[Scope](entries)

def allTransactions:Seq[ScopedTxn] = allLocalTransactions ++ childScopes.flatMap(_.allTransactions)
}
}
4 changes: 1 addition & 3 deletions base/src/main/scala/co/uproot/abandon/Config.scala
Original file line number Diff line number Diff line change
Expand Up @@ -219,11 +219,9 @@ case class NegativeConstraint(val accName: String) extends Constraint with SignC
case class DateConstraint(dateFrom: Option[Date], dateTo: Option[Date]) extends Constraint {
override def check(appState: AppState): Boolean = {
appState.accState.posts.find(post => {
val from = dateFrom.getOrElse(Date.MIN)
val to = dateTo.getOrElse(Date.MAX)
val date = post.date

DateOrdering.compare(from, date) > 0 || DateOrdering.compare(to, date) < 0
dateFrom.map(DateOrdering.compare(_, date) > 0).getOrElse(false) || dateTo.map(DateOrdering.compare(_, date) < 0).getOrElse(false)
}).foreach(post => {
throw new ConstraintError(
s"${post.name} is not in date range of " +
Expand Down
2 changes: 1 addition & 1 deletion project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Keys._

object Dependencies {
// Versions
val scalatestVersion = "3.0.0"
val scalatestVersion = "2.2.6"
val scallopVersion = "2.0.2"
val scalaMockVersion = "3.2.2"
val configVersion = "1.3.0"
Expand Down

0 comments on commit d741b02

Please sign in to comment.