diff --git a/base/src/main/scala/co/uproot/abandon/Ast.scala b/base/src/main/scala/co/uproot/abandon/Ast.scala index 5e453e1e..a7ae186c 100644 --- a/base/src/main/scala/co/uproot/abandon/Ast.scala +++ b/base/src/main/scala/co/uproot/abandon/Ast.scala @@ -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 @@ -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) -} \ No newline at end of file +} diff --git a/base/src/main/scala/co/uproot/abandon/Config.scala b/base/src/main/scala/co/uproot/abandon/Config.scala index 59c33eaf..4bc7cc3d 100644 --- a/base/src/main/scala/co/uproot/abandon/Config.scala +++ b/base/src/main/scala/co/uproot/abandon/Config.scala @@ -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 " + diff --git a/project/Dependencies.scala b/project/Dependencies.scala index f8d6aa33..ce4fe4f4 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -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"