Skip to content

Commit

Permalink
Add evaluation log tests
Browse files Browse the repository at this point in the history
  • Loading branch information
adams85 committed Oct 6, 2023
1 parent fc231c4 commit 46804e5
Show file tree
Hide file tree
Showing 3 changed files with 104 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
{
"p": {
"u": "https://cdn-global.configcat.com",
"r": 0,
"s": "test-salt"
},
"f": {
"booleanKey1": {
"t": 0,
"v": {
"b": false
},
"r": [
{
"c": [
{
"t": {
"a": "Identifier",
"c": 2,
"l": [
"1",
"2",
"3",
"4",
"5",
"6",
"7",
"8",
"9",
"10"
]
}
},
{
"t": {
"a": "Identifier",
"c": 2,
"l": [
"1",
"2",
"3",
"4",
"5",
"6",
"7",
"8",
"9",
"10",
"11"
]
}
},
{
"t": {
"a": "Identifier",
"c": 2,
"l": [
"1",
"2",
"3",
"4",
"5",
"6",
"7",
"8",
"9",
"10",
"11",
"12"
]
}
}
],
"s": {
"v": {
"b": true
}
}
}
]
}
}
}
14 changes: 14 additions & 0 deletions src/ConfigCat.Client.Tests/data/evaluationlog/list_truncation.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"jsonOverride": "test_list_truncation.json",
"tests": [
{
"key": "booleanKey1",
"defaultValue": "false",
"user": {
"Identifier": "12"
},
"returnValue": "true",
"expectedLog": "list_truncation.txt"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
INFO [5000] Evaluating 'booleanKey1' for User '{"Identifier":"12"}'
Evaluating targeting rules and applying the first match if any:
- IF User.Identifier CONTAINS ANY OF ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10'] => true
AND User.Identifier CONTAINS ANY OF ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10' ... <1 more value>] => true
AND User.Identifier CONTAINS ANY OF ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10' ... <2 more values>] => true
THEN 'true' => MATCH, applying rule
Returning 'true'.

0 comments on commit 46804e5

Please sign in to comment.