Skip to content

Commit 2eea02c

Browse files
authored
Include test case for special characters (#103)
* test case for special characters * update obfuscated config * update names in description * include unevaluated allocation * update cyrillic language example * fix reason
1 parent fe0d818 commit 2eea02c

File tree

3 files changed

+339
-0
lines changed

3 files changed

+339
-0
lines changed

ufc/flags-v1-obfuscated.json

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1186,6 +1186,104 @@
11861186
]
11871187
}
11881188
]
1189+
},
1190+
"eab426e60c686e18da04981a4d53c837": {
1191+
"allocations": [
1192+
{
1193+
"doLog": true,
1194+
"key": "YWxsb2NhdGlvbi10ZXN0",
1195+
"splits": [
1196+
{
1197+
"shards": [
1198+
{
1199+
"ranges": [
1200+
{
1201+
"end": 2500,
1202+
"start": 0
1203+
}
1204+
],
1205+
"salt": "c3BsaXQtanNvbi1mbGFn"
1206+
}
1207+
],
1208+
"variationKey": "ZGU="
1209+
},
1210+
{
1211+
"shards": [
1212+
{
1213+
"ranges": [
1214+
{
1215+
"end": 5000,
1216+
"start": 2500
1217+
}
1218+
],
1219+
"salt": "c3BsaXQtanNvbi1mbGFn"
1220+
}
1221+
],
1222+
"variationKey": "dWE="
1223+
},
1224+
{
1225+
"shards": [
1226+
{
1227+
"ranges": [
1228+
{
1229+
"end": 7500,
1230+
"start": 5000
1231+
}
1232+
],
1233+
"salt": "c3BsaXQtanNvbi1mbGFn"
1234+
}
1235+
],
1236+
"variationKey": "emg="
1237+
},
1238+
{
1239+
"shards": [
1240+
{
1241+
"ranges": [
1242+
{
1243+
"end": 10000,
1244+
"start": 7500
1245+
}
1246+
],
1247+
"salt": "c3BsaXQtanNvbi1mbGFn"
1248+
}
1249+
],
1250+
"variationKey": "ZW1vamk="
1251+
}
1252+
]
1253+
},
1254+
{
1255+
"doLog": false,
1256+
"key": "YWxsb2NhdGlvbi1kZWZhdWx0",
1257+
"splits": [
1258+
{
1259+
"shards": [],
1260+
"variationKey": "ZGU="
1261+
}
1262+
]
1263+
}
1264+
],
1265+
"enabled": true,
1266+
"key": "eab426e60c686e18da04981a4d53c837",
1267+
"totalShards": 10000,
1268+
"variationType": "JSON",
1269+
"variations": {
1270+
"ZGU=": {
1271+
"key": "ZGU=",
1272+
"value": "eyJhIjogImvDvG1tZXJ0IiwgImIiOiAic2Now7ZuIn0="
1273+
},
1274+
"ZW1vamk=": {
1275+
"key": "ZW1vamk=",
1276+
"value": "eyJhIjogIvCfpJciLCAiYiI6ICLwn4y4In0="
1277+
},
1278+
"dWE=": {
1279+
"key": "dWE=",
1280+
"value": "eyJhIjogItC/0ZbQutC70YPQstCw0YLQuNGB0Y8iLCAiYiI6ICLQu9GO0LHQvtCyIn0="
1281+
},
1282+
"emg=": {
1283+
"key": "emg=",
1284+
"value": "eyJhIjogIueFp+mhviIsICJiIjogIua8guS6riJ9"
1285+
}
1286+
}
11891287
}
11901288
}
11911289
}

ufc/flags-v1.json

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1186,6 +1186,104 @@
11861186
}
11871187
],
11881188
"totalShards": 10000
1189+
},
1190+
"special-characters": {
1191+
"key": "special-characters",
1192+
"enabled": true,
1193+
"variationType": "JSON",
1194+
"variations": {
1195+
"de": {
1196+
"key": "de",
1197+
"value": "{\"a\": \"kümmert\", \"b\": \"schön\"}"
1198+
},
1199+
"ua": {
1200+
"key": "ua",
1201+
"value": "{\"a\": \"піклуватися\", \"b\": \"любов\"}"
1202+
},
1203+
"zh": {
1204+
"key": "zh",
1205+
"value": "{\"a\": \"照顾\", \"b\": \"漂亮\"}"
1206+
},
1207+
"emoji": {
1208+
"key": "emoji",
1209+
"value": "{\"a\": \"🤗\", \"b\": \"🌸\"}"
1210+
}
1211+
},
1212+
"totalShards": 10000,
1213+
"allocations": [
1214+
{
1215+
"key": "allocation-test",
1216+
"splits": [
1217+
{
1218+
"variationKey": "de",
1219+
"shards": [
1220+
{
1221+
"salt": "split-json-flag",
1222+
"ranges": [
1223+
{
1224+
"start": 0,
1225+
"end": 2500
1226+
}
1227+
]
1228+
}
1229+
]
1230+
},
1231+
{
1232+
"variationKey": "ua",
1233+
"shards": [
1234+
{
1235+
"salt": "split-json-flag",
1236+
"ranges": [
1237+
{
1238+
"start": 2500,
1239+
"end": 5000
1240+
}
1241+
]
1242+
}
1243+
]
1244+
},
1245+
{
1246+
"variationKey": "zh",
1247+
"shards": [
1248+
{
1249+
"salt": "split-json-flag",
1250+
"ranges": [
1251+
{
1252+
"start": 5000,
1253+
"end": 7500
1254+
}
1255+
]
1256+
}
1257+
]
1258+
},
1259+
{
1260+
"variationKey": "emoji",
1261+
"shards": [
1262+
{
1263+
"salt": "split-json-flag",
1264+
"ranges": [
1265+
{
1266+
"start": 7500,
1267+
"end": 10000
1268+
}
1269+
]
1270+
}
1271+
]
1272+
}
1273+
],
1274+
"doLog": true
1275+
},
1276+
{
1277+
"key": "allocation-default",
1278+
"splits": [
1279+
{
1280+
"variationKey": "de",
1281+
"shards": []
1282+
}
1283+
],
1284+
"doLog": false
1285+
}
1286+
]
11891287
}
11901288
}
11911289
}
Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
{
2+
"flag": "special-characters",
3+
"variationType": "JSON",
4+
"defaultValue": {},
5+
"subjects": [
6+
{
7+
"subjectKey": "ash",
8+
"subjectAttributes": {},
9+
"assignment": {
10+
"a": "kümmert",
11+
"b": "schön"
12+
},
13+
"evaluationDetails": {
14+
"environmentName": "Test",
15+
"flagEvaluationCode": "MATCH",
16+
"flagEvaluationDescription": "ash belongs to the range of traffic assigned to \"de\" defined in allocation \"allocation-test\".",
17+
"banditKey": null,
18+
"banditAction": null,
19+
"variationKey": "de",
20+
"variationValue": {
21+
"a": "kümmert",
22+
"b": "schön"
23+
},
24+
"matchedRule": null,
25+
"matchedAllocation": {
26+
"key": "allocation-test",
27+
"allocationEvaluationCode": "MATCH",
28+
"orderPosition": 1
29+
},
30+
"unmatchedAllocations": [],
31+
"unevaluatedAllocations": [
32+
{
33+
"key": "allocation-default",
34+
"allocationEvaluationCode": "UNEVALUATED",
35+
"orderPosition": 2
36+
}
37+
]
38+
}
39+
},
40+
{
41+
"subjectKey": "ben",
42+
"subjectAttributes": {},
43+
"assignment": {
44+
"a": "піклуватися",
45+
"b": "любов"
46+
},
47+
"evaluationDetails": {
48+
"environmentName": "Test",
49+
"flagEvaluationCode": "MATCH",
50+
"flagEvaluationDescription": "ben belongs to the range of traffic assigned to \"ua\" defined in allocation \"allocation-test\".",
51+
"banditKey": null,
52+
"banditAction": null,
53+
"variationKey": "ua",
54+
"variationValue": {
55+
"a": "піклуватися",
56+
"b": "любов"
57+
},
58+
"matchedRule": null,
59+
"matchedAllocation": {
60+
"key": "allocation-test",
61+
"allocationEvaluationCode": "MATCH",
62+
"orderPosition": 1
63+
},
64+
"unmatchedAllocations": [],
65+
"unevaluatedAllocations": [
66+
{
67+
"key": "allocation-default",
68+
"allocationEvaluationCode": "UNEVALUATED",
69+
"orderPosition": 2
70+
}
71+
]
72+
}
73+
},
74+
{
75+
"subjectKey": "cameron",
76+
"subjectAttributes": {},
77+
"assignment": {
78+
"a": "照顾",
79+
"b": "漂亮"
80+
},
81+
"evaluationDetails": {
82+
"environmentName": "Test",
83+
"flagEvaluationCode": "MATCH",
84+
"flagEvaluationDescription": "cameron belongs to the range of traffic assigned to \"zh\" defined in allocation \"allocation-test\".",
85+
"banditKey": null,
86+
"banditAction": null,
87+
"variationKey": "zh",
88+
"variationValue": {
89+
"a": "照顾",
90+
"b": "漂亮"
91+
},
92+
"matchedRule": null,
93+
"matchedAllocation": {
94+
"key": "allocation-test",
95+
"allocationEvaluationCode": "MATCH",
96+
"orderPosition": 1
97+
},
98+
"unmatchedAllocations": [],
99+
"unevaluatedAllocations": [
100+
{
101+
"key": "allocation-default",
102+
"allocationEvaluationCode": "UNEVALUATED",
103+
"orderPosition": 2
104+
}
105+
]
106+
}
107+
},
108+
{
109+
"subjectKey": "darryl",
110+
"subjectAttributes": {},
111+
"assignment": {
112+
"a": "🤗",
113+
"b": "🌸"
114+
},
115+
"evaluationDetails": {
116+
"environmentName": "Test",
117+
"flagEvaluationCode": "MATCH",
118+
"flagEvaluationDescription": "darryl belongs to the range of traffic assigned to \"emoji\" defined in allocation \"allocation-test\".",
119+
"banditKey": null,
120+
"banditAction": null,
121+
"variationKey": "emoji",
122+
"variationValue": {
123+
"a": "🤗",
124+
"b": "🌸"
125+
},
126+
"matchedRule": null,
127+
"matchedAllocation": {
128+
"key": "allocation-test",
129+
"allocationEvaluationCode": "MATCH",
130+
"orderPosition": 1
131+
},
132+
"unmatchedAllocations": [],
133+
"unevaluatedAllocations": [
134+
{
135+
"key": "allocation-default",
136+
"allocationEvaluationCode": "UNEVALUATED",
137+
"orderPosition": 2
138+
}
139+
]
140+
}
141+
}
142+
]
143+
}

0 commit comments

Comments
 (0)