From 1076315c52bd1764f0dc647f26bf89cb62e551e6 Mon Sep 17 00:00:00 2001 From: Bohdan Akimenko Date: Fri, 28 Jun 2024 17:47:29 +0300 Subject: [PATCH] add new test case for 0.6.1 --- .../com/sdk/growthbook/tests/cases.json | 55 ++++++++++++++++++- 1 file changed, 54 insertions(+), 1 deletion(-) diff --git a/GrowthBook/src/commonTest/kotlin/com/sdk/growthbook/tests/cases.json b/GrowthBook/src/commonTest/kotlin/com/sdk/growthbook/tests/cases.json index 3fe02459..8372bbed 100644 --- a/GrowthBook/src/commonTest/kotlin/com/sdk/growthbook/tests/cases.json +++ b/GrowthBook/src/commonTest/kotlin/com/sdk/growthbook/tests/cases.json @@ -1,5 +1,5 @@ { - "specVersion": "0.6.0", + "specVersion": "0.6.1", "evalCondition": [ [ "$not - pass", @@ -2775,6 +2775,59 @@ "version": "1.2.3.4" }, true + ], + [ + "$or pass but second condition fail", + { + "$or": [{ "foo": 1 }, { "bar": 1 }], + "baz": 2 + }, + { + "foo": 1, + "bar": 2, + "baz": 1 + }, + false + ], + [ + "$or and second condition both pass", + { + "$or": [{ "foo": 1 }, { "bar": 1 }], + "baz": 2 + }, + { + "foo": 1, + "bar": 2, + "baz": 2 + }, + true + ], + [ + "$and condition pass but $or fail", + { + "$and": [{ "foo": 1 }, { "bar": 1 }], + "$or": [{ "baz": 1 }, { "empty": 1 }] + }, + { + "foo": 1, + "bar": 1, + "baz": 2 + }, + false + ], + [ + "$and and $or both pass", + { + "$and": [{ "foo": 1 }, { "bar": 1 }], + "$or": [{ "baz": 1 }, { "empty": 1 }] + }, + { + "foo": 1, + "bar": 1, + "baz": 2, + "empty": 1 + }, + true ] ], "hash": [