Skip to content

Commit

Permalink
Include test case for special characters (#103)
Browse files Browse the repository at this point in the history
* test case for special characters

* update obfuscated config

* update names in description

* include unevaluated allocation

* update cyrillic language example

* fix reason
  • Loading branch information
aarsilv authored Jan 2, 2025
1 parent fe0d818 commit 2eea02c
Show file tree
Hide file tree
Showing 3 changed files with 339 additions and 0 deletions.
98 changes: 98 additions & 0 deletions ufc/flags-v1-obfuscated.json
Original file line number Diff line number Diff line change
Expand Up @@ -1186,6 +1186,104 @@
]
}
]
},
"eab426e60c686e18da04981a4d53c837": {
"allocations": [
{
"doLog": true,
"key": "YWxsb2NhdGlvbi10ZXN0",
"splits": [
{
"shards": [
{
"ranges": [
{
"end": 2500,
"start": 0
}
],
"salt": "c3BsaXQtanNvbi1mbGFn"
}
],
"variationKey": "ZGU="
},
{
"shards": [
{
"ranges": [
{
"end": 5000,
"start": 2500
}
],
"salt": "c3BsaXQtanNvbi1mbGFn"
}
],
"variationKey": "dWE="
},
{
"shards": [
{
"ranges": [
{
"end": 7500,
"start": 5000
}
],
"salt": "c3BsaXQtanNvbi1mbGFn"
}
],
"variationKey": "emg="
},
{
"shards": [
{
"ranges": [
{
"end": 10000,
"start": 7500
}
],
"salt": "c3BsaXQtanNvbi1mbGFn"
}
],
"variationKey": "ZW1vamk="
}
]
},
{
"doLog": false,
"key": "YWxsb2NhdGlvbi1kZWZhdWx0",
"splits": [
{
"shards": [],
"variationKey": "ZGU="
}
]
}
],
"enabled": true,
"key": "eab426e60c686e18da04981a4d53c837",
"totalShards": 10000,
"variationType": "JSON",
"variations": {
"ZGU=": {
"key": "ZGU=",
"value": "eyJhIjogImvDvG1tZXJ0IiwgImIiOiAic2Now7ZuIn0="
},
"ZW1vamk=": {
"key": "ZW1vamk=",
"value": "eyJhIjogIvCfpJciLCAiYiI6ICLwn4y4In0="
},
"dWE=": {
"key": "dWE=",
"value": "eyJhIjogItC/0ZbQutC70YPQstCw0YLQuNGB0Y8iLCAiYiI6ICLQu9GO0LHQvtCyIn0="
},
"emg=": {
"key": "emg=",
"value": "eyJhIjogIueFp+mhviIsICJiIjogIua8guS6riJ9"
}
}
}
}
}
98 changes: 98 additions & 0 deletions ufc/flags-v1.json
Original file line number Diff line number Diff line change
Expand Up @@ -1186,6 +1186,104 @@
}
],
"totalShards": 10000
},
"special-characters": {
"key": "special-characters",
"enabled": true,
"variationType": "JSON",
"variations": {
"de": {
"key": "de",
"value": "{\"a\": \"kümmert\", \"b\": \"schön\"}"
},
"ua": {
"key": "ua",
"value": "{\"a\": \"піклуватися\", \"b\": \"любов\"}"
},
"zh": {
"key": "zh",
"value": "{\"a\": \"照顾\", \"b\": \"漂亮\"}"
},
"emoji": {
"key": "emoji",
"value": "{\"a\": \"🤗\", \"b\": \"🌸\"}"
}
},
"totalShards": 10000,
"allocations": [
{
"key": "allocation-test",
"splits": [
{
"variationKey": "de",
"shards": [
{
"salt": "split-json-flag",
"ranges": [
{
"start": 0,
"end": 2500
}
]
}
]
},
{
"variationKey": "ua",
"shards": [
{
"salt": "split-json-flag",
"ranges": [
{
"start": 2500,
"end": 5000
}
]
}
]
},
{
"variationKey": "zh",
"shards": [
{
"salt": "split-json-flag",
"ranges": [
{
"start": 5000,
"end": 7500
}
]
}
]
},
{
"variationKey": "emoji",
"shards": [
{
"salt": "split-json-flag",
"ranges": [
{
"start": 7500,
"end": 10000
}
]
}
]
}
],
"doLog": true
},
{
"key": "allocation-default",
"splits": [
{
"variationKey": "de",
"shards": []
}
],
"doLog": false
}
]
}
}
}
143 changes: 143 additions & 0 deletions ufc/tests/test-special-characters.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
{
"flag": "special-characters",
"variationType": "JSON",
"defaultValue": {},
"subjects": [
{
"subjectKey": "ash",
"subjectAttributes": {},
"assignment": {
"a": "kümmert",
"b": "schön"
},
"evaluationDetails": {
"environmentName": "Test",
"flagEvaluationCode": "MATCH",
"flagEvaluationDescription": "ash belongs to the range of traffic assigned to \"de\" defined in allocation \"allocation-test\".",
"banditKey": null,
"banditAction": null,
"variationKey": "de",
"variationValue": {
"a": "kümmert",
"b": "schön"
},
"matchedRule": null,
"matchedAllocation": {
"key": "allocation-test",
"allocationEvaluationCode": "MATCH",
"orderPosition": 1
},
"unmatchedAllocations": [],
"unevaluatedAllocations": [
{
"key": "allocation-default",
"allocationEvaluationCode": "UNEVALUATED",
"orderPosition": 2
}
]
}
},
{
"subjectKey": "ben",
"subjectAttributes": {},
"assignment": {
"a": "піклуватися",
"b": "любов"
},
"evaluationDetails": {
"environmentName": "Test",
"flagEvaluationCode": "MATCH",
"flagEvaluationDescription": "ben belongs to the range of traffic assigned to \"ua\" defined in allocation \"allocation-test\".",
"banditKey": null,
"banditAction": null,
"variationKey": "ua",
"variationValue": {
"a": "піклуватися",
"b": "любов"
},
"matchedRule": null,
"matchedAllocation": {
"key": "allocation-test",
"allocationEvaluationCode": "MATCH",
"orderPosition": 1
},
"unmatchedAllocations": [],
"unevaluatedAllocations": [
{
"key": "allocation-default",
"allocationEvaluationCode": "UNEVALUATED",
"orderPosition": 2
}
]
}
},
{
"subjectKey": "cameron",
"subjectAttributes": {},
"assignment": {
"a": "照顾",
"b": "漂亮"
},
"evaluationDetails": {
"environmentName": "Test",
"flagEvaluationCode": "MATCH",
"flagEvaluationDescription": "cameron belongs to the range of traffic assigned to \"zh\" defined in allocation \"allocation-test\".",
"banditKey": null,
"banditAction": null,
"variationKey": "zh",
"variationValue": {
"a": "照顾",
"b": "漂亮"
},
"matchedRule": null,
"matchedAllocation": {
"key": "allocation-test",
"allocationEvaluationCode": "MATCH",
"orderPosition": 1
},
"unmatchedAllocations": [],
"unevaluatedAllocations": [
{
"key": "allocation-default",
"allocationEvaluationCode": "UNEVALUATED",
"orderPosition": 2
}
]
}
},
{
"subjectKey": "darryl",
"subjectAttributes": {},
"assignment": {
"a": "🤗",
"b": "🌸"
},
"evaluationDetails": {
"environmentName": "Test",
"flagEvaluationCode": "MATCH",
"flagEvaluationDescription": "darryl belongs to the range of traffic assigned to \"emoji\" defined in allocation \"allocation-test\".",
"banditKey": null,
"banditAction": null,
"variationKey": "emoji",
"variationValue": {
"a": "🤗",
"b": "🌸"
},
"matchedRule": null,
"matchedAllocation": {
"key": "allocation-test",
"allocationEvaluationCode": "MATCH",
"orderPosition": 1
},
"unmatchedAllocations": [],
"unevaluatedAllocations": [
{
"key": "allocation-default",
"allocationEvaluationCode": "UNEVALUATED",
"orderPosition": 2
}
]
}
}
]
}

0 comments on commit 2eea02c

Please sign in to comment.