From e15d32fbdd81a354a67ef3fcb67e900749d0fb20 Mon Sep 17 00:00:00 2001 From: Tony <43834836+lofoyet@users.noreply.github.com> Date: Thu, 28 Sep 2023 11:38:44 -0700 Subject: [PATCH] added float type to UserMetaCriterionSuite numeric comparison (#871) --- .../thomas/abtest/UserMetaCriterionSuite.scala | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/src/test/scala/com/iheart/thomas/abtest/UserMetaCriterionSuite.scala b/tests/src/test/scala/com/iheart/thomas/abtest/UserMetaCriterionSuite.scala index 15f5455e..a1f11faa 100644 --- a/tests/src/test/scala/com/iheart/thomas/abtest/UserMetaCriterionSuite.scala +++ b/tests/src/test/scala/com/iheart/thomas/abtest/UserMetaCriterionSuite.scala @@ -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 } } @@ -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 } } @@ -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 } } @@ -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 } } }