Skip to content

Commit

Permalink
added float type to UserMetaCriterionSuite numeric comparison (#871)
Browse files Browse the repository at this point in the history
  • Loading branch information
lofoyet authored Sep 28, 2023
1 parent cbc31e6 commit e15d32f
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ class UserMetaCriterionSuite extends AnyFreeSpec with Matchers {
GreaterOrEqual("f", 1d).eligible(Map("f" -> "2")) shouldBe true
GreaterOrEqual("f", 1d).eligible(Map("f" -> "1")) shouldBe true
GreaterOrEqual("f", 1d).eligible(Map("f" -> "0")) shouldBe false
GreaterOrEqual("f", 1d).eligible(Map("f" -> "2.0")) shouldBe true
GreaterOrEqual("f", 1d).eligible(Map("f" -> "1.0")) shouldBe true
GreaterOrEqual("f", 1d).eligible(Map("f" -> "0.5")) shouldBe false
}
}

Expand All @@ -91,6 +94,9 @@ class UserMetaCriterionSuite extends AnyFreeSpec with Matchers {
Greater("f", 1d).eligible(Map("f" -> "2")) shouldBe true
Greater("f", 1d).eligible(Map("f" -> "1")) shouldBe false
Greater("f", 1d).eligible(Map("f" -> "0")) shouldBe false
Greater("f", 1d).eligible(Map("f" -> "2.0")) shouldBe true
Greater("f", 1d).eligible(Map("f" -> "1.0")) shouldBe false
Greater("f", 1d).eligible(Map("f" -> "0.5")) shouldBe false
}
}

Expand All @@ -103,6 +109,9 @@ class UserMetaCriterionSuite extends AnyFreeSpec with Matchers {
Less("f", 1d).eligible(Map("f" -> "0")) shouldBe true
Less("f", 1d).eligible(Map("f" -> "1")) shouldBe false
Less("f", 1d).eligible(Map("f" -> "2")) shouldBe false
Less("f", 1d).eligible(Map("f" -> "0.5")) shouldBe true
Less("f", 1d).eligible(Map("f" -> "1.0")) shouldBe false
Less("f", 1d).eligible(Map("f" -> "2.0")) shouldBe false
}
}

Expand All @@ -115,6 +124,9 @@ class UserMetaCriterionSuite extends AnyFreeSpec with Matchers {
LessOrEqual("f", 1d).eligible(Map("f" -> "0")) shouldBe true
LessOrEqual("f", 1d).eligible(Map("f" -> "1")) shouldBe true
LessOrEqual("f", 1d).eligible(Map("f" -> "2")) shouldBe false
LessOrEqual("f", 1d).eligible(Map("f" -> "0.5")) shouldBe true
LessOrEqual("f", 1d).eligible(Map("f" -> "1.0")) shouldBe true
LessOrEqual("f", 1d).eligible(Map("f" -> "2.0")) shouldBe false
}
}
}
Expand Down

0 comments on commit e15d32f

Please sign in to comment.