diff --git a/test_cases/test_in_condition_float_context_comma_delimited_floats__should_match.jsonc b/test_cases/test_in_condition_float_context_comma_delimited_floats__should_match.jsonc new file mode 100644 index 0000000..962b07a --- /dev/null +++ b/test_cases/test_in_condition_float_context_comma_delimited_floats__should_match.jsonc @@ -0,0 +1,45 @@ +{ + // Given: A segment with IN condition using comma-delimited floats + // When: An evaluation context with an identity that has a float trait matching one of the comma-delimited float values + // Then: The context should be considered part of the segment + "$schema": "https://raw.githubusercontent.com/Flagsmith/engine-test-data/refs/tags/v2.0.0/schema.json", + "context": { + "environment": { + "key": "key", + "name": "Environment" + }, + "identity": { + "identifier": "float_comma_delim_user", + "key": "key_float_comma_delim_user", + "traits": { + "score": 2.0 + } + }, + "segments": { + "34": { + "key": "34", + "name": "segment_float_comma_delimited", + "rules": [ + { + "type": "ALL", + "conditions": [ + { + "operator": "IN", + "property": "score", + "value": "1.0,2.0,3.0,4.0" + } + ] + } + ] + } + } + }, + "result": { + "flags": {}, + "segments": [ + { + "name": "segment_float_comma_delimited" + } + ] + } +} diff --git a/test_cases/test_in_condition_float_context_comma_delimited_ints__should_not_match.jsonc b/test_cases/test_in_condition_float_context_comma_delimited_ints__should_not_match.jsonc new file mode 100644 index 0000000..f9719e4 --- /dev/null +++ b/test_cases/test_in_condition_float_context_comma_delimited_ints__should_not_match.jsonc @@ -0,0 +1,41 @@ +{ + // Given: A segment with IN condition using comma-delimited integers + // When: An evaluation context with an identity that has a float trait that does not match any of the comma-delimited integer values + // Then: The context should not be considered part of the segment + "$schema": "https://raw.githubusercontent.com/Flagsmith/engine-test-data/refs/tags/v2.0.0/schema.json", + "context": { + "environment": { + "key": "key", + "name": "Environment" + }, + "identity": { + "identifier": "float_comma_delim_int_user", + "key": "key_float_comma_delim_int_user", + "traits": { + "score": 2.0 + } + }, + "segments": { + "36": { + "key": "36", + "name": "segment_float_comma_delimited_int_mismatch", + "rules": [ + { + "type": "ALL", + "conditions": [ + { + "operator": "IN", + "property": "score", + "value": "1,2,3,4" + } + ] + } + ] + } + } + }, + "result": { + "flags": {}, + "segments": [] + } +} diff --git a/test_cases/test_in_condition_float_context_float_array__should_match.jsonc b/test_cases/test_in_condition_float_context_float_array__should_match.jsonc new file mode 100644 index 0000000..37ce54a --- /dev/null +++ b/test_cases/test_in_condition_float_context_float_array__should_match.jsonc @@ -0,0 +1,50 @@ +{ + // Given: A segment with IN condition using an array of floats + // When: An evaluation context with an identity that has a float trait matching one of the array values + // Then: The context should be considered part of the segment + "$schema": "https://raw.githubusercontent.com/Flagsmith/engine-test-data/refs/tags/v2.0.0/schema.json", + "context": { + "environment": { + "key": "key", + "name": "Environment" + }, + "identity": { + "identifier": "float_array_user", + "key": "key_float_array_user", + "traits": { + "score": 2.0 + } + }, + "segments": { + "30": { + "key": "30", + "name": "segment_float_array", + "rules": [ + { + "type": "ALL", + "conditions": [ + { + "operator": "IN", + "property": "score", + "value": [ + "1.0", + "2.0", + "3.0", + "4.0" + ] + } + ] + } + ] + } + } + }, + "result": { + "flags": {}, + "segments": [ + { + "name": "segment_float_array" + } + ] + } +} diff --git a/test_cases/test_in_condition_float_context_int_array__should_not_match.jsonc b/test_cases/test_in_condition_float_context_int_array__should_not_match.jsonc new file mode 100644 index 0000000..3233edf --- /dev/null +++ b/test_cases/test_in_condition_float_context_int_array__should_not_match.jsonc @@ -0,0 +1,46 @@ +{ + // Given: A segment with IN condition using an array of integers + // When: An evaluation context with an identity that has a float trait that does not match any of the integer array values + // Then: The context should not be considered part of the segment + "$schema": "https://raw.githubusercontent.com/Flagsmith/engine-test-data/refs/tags/v2.0.0/schema.json", + "context": { + "environment": { + "key": "key", + "name": "Environment" + }, + "identity": { + "identifier": "float_int_array_user", + "key": "key_float_int_array_user", + "traits": { + "score": 2.0 + } + }, + "segments": { + "32": { + "key": "32", + "name": "segment_float_int_array_mismatch", + "rules": [ + { + "type": "ALL", + "conditions": [ + { + "operator": "IN", + "property": "score", + "value": [ + "1", + "2", + "3", + "4" + ] + } + ] + } + ] + } + } + }, + "result": { + "flags": {}, + "segments": [] + } +} diff --git a/test_cases/test_in_condition_float_context_json_encoded_floats__should_match.jsonc b/test_cases/test_in_condition_float_context_json_encoded_floats__should_match.jsonc new file mode 100644 index 0000000..60e395b --- /dev/null +++ b/test_cases/test_in_condition_float_context_json_encoded_floats__should_match.jsonc @@ -0,0 +1,45 @@ +{ + // Given: A segment with IN condition using JSON-encoded array of floats + // When: An evaluation context with an identity that has a float trait matching one of the JSON-encoded float values + // Then: The context should be considered part of the segment + "$schema": "https://raw.githubusercontent.com/Flagsmith/engine-test-data/refs/tags/v2.0.0/schema.json", + "context": { + "environment": { + "key": "key", + "name": "Environment" + }, + "identity": { + "identifier": "float_json_array_user", + "key": "key_float_json_array_user", + "traits": { + "score": 2.0 + } + }, + "segments": { + "38": { + "key": "38", + "name": "segment_float_json_encoded", + "rules": [ + { + "type": "ALL", + "conditions": [ + { + "operator": "IN", + "property": "score", + "value": "[1.0,2.0,3.0,4.0]" + } + ] + } + ] + } + } + }, + "result": { + "flags": {}, + "segments": [ + { + "name": "segment_float_json_encoded" + } + ] + } +} diff --git a/test_cases/test_in_condition_float_context_json_encoded_ints__should_not_match.jsonc b/test_cases/test_in_condition_float_context_json_encoded_ints__should_not_match.jsonc new file mode 100644 index 0000000..1afd68e --- /dev/null +++ b/test_cases/test_in_condition_float_context_json_encoded_ints__should_not_match.jsonc @@ -0,0 +1,41 @@ +{ + // Given: A segment with IN condition using JSON-encoded array of integers + // When: An evaluation context with an identity that has a float trait that does not match any of the JSON-encoded integer values + // Then: The context should not be considered part of the segment + "$schema": "https://raw.githubusercontent.com/Flagsmith/engine-test-data/refs/tags/v2.0.0/schema.json", + "context": { + "environment": { + "key": "key", + "name": "Environment" + }, + "identity": { + "identifier": "float_json_int_array_user", + "key": "key_float_json_int_array_user", + "traits": { + "score": 2.0 + } + }, + "segments": { + "40": { + "key": "40", + "name": "segment_float_json_encoded_int_mismatch", + "rules": [ + { + "type": "ALL", + "conditions": [ + { + "operator": "IN", + "property": "score", + "value": "[1,2,3,4]" + } + ] + } + ] + } + } + }, + "result": { + "flags": {}, + "segments": [] + } +} diff --git a/test_cases/test_in_condition_int_context_comma_delimited_floats__should_not_match.jsonc b/test_cases/test_in_condition_int_context_comma_delimited_floats__should_not_match.jsonc new file mode 100644 index 0000000..5074878 --- /dev/null +++ b/test_cases/test_in_condition_int_context_comma_delimited_floats__should_not_match.jsonc @@ -0,0 +1,41 @@ +{ + // Given: A segment with IN condition using comma-delimited floats + // When: An evaluation context with an identity that has an integer trait that does not match any of the comma-delimited float values + // Then: The context should not be considered part of the segment + "$schema": "https://raw.githubusercontent.com/Flagsmith/engine-test-data/refs/tags/v2.0.0/schema.json", + "context": { + "environment": { + "key": "key", + "name": "Environment" + }, + "identity": { + "identifier": "int_comma_delim_float_user", + "key": "key_int_comma_delim_float_user", + "traits": { + "level": 2 + } + }, + "segments": { + "37": { + "key": "37", + "name": "segment_int_comma_delimited_float_mismatch", + "rules": [ + { + "type": "ALL", + "conditions": [ + { + "operator": "IN", + "property": "level", + "value": "1.0,2.0,3.0,4.0" + } + ] + } + ] + } + } + }, + "result": { + "flags": {}, + "segments": [] + } +} diff --git a/test_cases/test_in_condition_int_context_comma_delimited_ints__should_match.jsonc b/test_cases/test_in_condition_int_context_comma_delimited_ints__should_match.jsonc new file mode 100644 index 0000000..87ed357 --- /dev/null +++ b/test_cases/test_in_condition_int_context_comma_delimited_ints__should_match.jsonc @@ -0,0 +1,45 @@ +{ + // Given: A segment with IN condition using comma-delimited integers + // When: An evaluation context with an identity that has an integer trait matching one of the comma-delimited integer values + // Then: The context should be considered part of the segment + "$schema": "https://raw.githubusercontent.com/Flagsmith/engine-test-data/refs/tags/v2.0.0/schema.json", + "context": { + "environment": { + "key": "key", + "name": "Environment" + }, + "identity": { + "identifier": "int_comma_delim_user", + "key": "key_int_comma_delim_user", + "traits": { + "level": 2 + } + }, + "segments": { + "35": { + "key": "35", + "name": "segment_int_comma_delimited", + "rules": [ + { + "type": "ALL", + "conditions": [ + { + "operator": "IN", + "property": "level", + "value": "1,2,3,4" + } + ] + } + ] + } + } + }, + "result": { + "flags": {}, + "segments": [ + { + "name": "segment_int_comma_delimited" + } + ] + } +} diff --git a/test_cases/test_in_condition_int_context_float_array__should_not_match.jsonc b/test_cases/test_in_condition_int_context_float_array__should_not_match.jsonc new file mode 100644 index 0000000..427853a --- /dev/null +++ b/test_cases/test_in_condition_int_context_float_array__should_not_match.jsonc @@ -0,0 +1,46 @@ +{ + // Given: A segment with IN condition using an array of floats + // When: An evaluation context with an identity that has an integer trait that does not match any of the float array values + // Then: The context should not be considered part of the segment + "$schema": "https://raw.githubusercontent.com/Flagsmith/engine-test-data/refs/tags/v2.0.0/schema.json", + "context": { + "environment": { + "key": "key", + "name": "Environment" + }, + "identity": { + "identifier": "int_float_array_user", + "key": "key_int_float_array_user", + "traits": { + "level": 2 + } + }, + "segments": { + "33": { + "key": "33", + "name": "segment_int_float_array_mismatch", + "rules": [ + { + "type": "ALL", + "conditions": [ + { + "operator": "IN", + "property": "level", + "value": [ + "1.0", + "2.0", + "3.0", + "4.0" + ] + } + ] + } + ] + } + } + }, + "result": { + "flags": {}, + "segments": [] + } +} diff --git a/test_cases/test_in_condition_int_context_int_array__should_match.jsonc b/test_cases/test_in_condition_int_context_int_array__should_match.jsonc new file mode 100644 index 0000000..cf582c1 --- /dev/null +++ b/test_cases/test_in_condition_int_context_int_array__should_match.jsonc @@ -0,0 +1,50 @@ +{ + // Given: A segment with IN condition using an array of integers + // When: An evaluation context with an identity that has an integer trait matching one of the array values + // Then: The context should be considered part of the segment + "$schema": "https://raw.githubusercontent.com/Flagsmith/engine-test-data/refs/tags/v2.0.0/schema.json", + "context": { + "environment": { + "key": "key", + "name": "Environment" + }, + "identity": { + "identifier": "int_array_user", + "key": "key_int_array_user", + "traits": { + "level": 2 + } + }, + "segments": { + "31": { + "key": "31", + "name": "segment_int_array", + "rules": [ + { + "type": "ALL", + "conditions": [ + { + "operator": "IN", + "property": "level", + "value": [ + "1", + "2", + "3", + "4" + ] + } + ] + } + ] + } + } + }, + "result": { + "flags": {}, + "segments": [ + { + "name": "segment_int_array" + } + ] + } +} diff --git a/test_cases/test_in_condition_int_context_json_encoded_floats__should_not_match.jsonc b/test_cases/test_in_condition_int_context_json_encoded_floats__should_not_match.jsonc new file mode 100644 index 0000000..f900c6b --- /dev/null +++ b/test_cases/test_in_condition_int_context_json_encoded_floats__should_not_match.jsonc @@ -0,0 +1,41 @@ +{ + // Given: A segment with IN condition using JSON-encoded array of floats + // When: An evaluation context with an identity that has an integer trait that does not match any of the JSON-encoded float values + // Then: The context should not be considered part of the segment + "$schema": "https://raw.githubusercontent.com/Flagsmith/engine-test-data/refs/tags/v2.0.0/schema.json", + "context": { + "environment": { + "key": "key", + "name": "Environment" + }, + "identity": { + "identifier": "int_json_float_array_user", + "key": "key_int_json_float_array_user", + "traits": { + "level": 2 + } + }, + "segments": { + "41": { + "key": "41", + "name": "segment_int_json_encoded_float_mismatch", + "rules": [ + { + "type": "ALL", + "conditions": [ + { + "operator": "IN", + "property": "level", + "value": "[1.0,2.0,3.0,4.0]" + } + ] + } + ] + } + } + }, + "result": { + "flags": {}, + "segments": [] + } +} diff --git a/test_cases/test_in_condition_int_context_json_encoded_ints__should_match.jsonc b/test_cases/test_in_condition_int_context_json_encoded_ints__should_match.jsonc new file mode 100644 index 0000000..b02d3e0 --- /dev/null +++ b/test_cases/test_in_condition_int_context_json_encoded_ints__should_match.jsonc @@ -0,0 +1,45 @@ +{ + // Given: A segment with IN condition using JSON-encoded array of integers + // When: An evaluation context with an identity that has an integer trait matching one of the JSON-encoded integer values + // Then: The context should be considered part of the segment + "$schema": "https://raw.githubusercontent.com/Flagsmith/engine-test-data/refs/tags/v2.0.0/schema.json", + "context": { + "environment": { + "key": "key", + "name": "Environment" + }, + "identity": { + "identifier": "int_json_array_user", + "key": "key_int_json_array_user", + "traits": { + "level": 2 + } + }, + "segments": { + "39": { + "key": "39", + "name": "segment_int_json_encoded", + "rules": [ + { + "type": "ALL", + "conditions": [ + { + "operator": "IN", + "property": "level", + "value": "[1,2,3,4]" + } + ] + } + ] + } + } + }, + "result": { + "flags": {}, + "segments": [ + { + "name": "segment_int_json_encoded" + } + ] + } +}