@@ -103,31 +103,31 @@ tape('PARSER / if user is in segment ["u1", "u2", "u3", "u4"] then split 100%:on
103103
104104tape ( 'PARSER / if user.account is in list ["v1", "v2", "v3"] then split 100:on' , assert => {
105105
106- let { evaluator, segments } = parser ( [ {
107- " matcherGroup" : {
108- " combiner" : " AND" ,
109- " matchers" : [ {
110- " keySelector" : {
111- " trafficType" : " user" ,
112- " attribute" : " account"
106+ let { evaluator} = parser ( [ {
107+ matcherGroup : {
108+ combiner : ' AND' ,
109+ matchers : [ {
110+ keySelector : {
111+ trafficType : ' user' ,
112+ attribute : ' account'
113113 } ,
114- " matcherType" : " WHITELIST" ,
115- " negate" : false ,
116- " userDefinedSegmentMatcherData" : null ,
117- " whitelistMatcherData" : {
118- " whitelist" : [
119- "v1" ,
120- "v2" ,
121- "v3"
114+ matcherType : ' WHITELIST' ,
115+ negate : false ,
116+ userDefinedSegmentMatcherData : null ,
117+ whitelistMatcherData : {
118+ whitelist : [
119+ 'v1' ,
120+ 'v2' ,
121+ 'v3'
122122 ]
123123 } ,
124- " unaryNumericMatcherData" : null ,
125- " betweenMatcherData" : null
124+ unaryNumericMatcherData : null ,
125+ betweenMatcherData : null
126126 } ]
127127 } ,
128- " partitions" : [ {
129- " treatment" : "on" ,
130- " size" : 100
128+ partitions : [ {
129+ treatment : 'on' ,
130+ size : 100
131131 } ]
132132 } ] ) ;
133133
@@ -147,26 +147,26 @@ tape('PARSER / if user.account is in list ["v1", "v2", "v3"] then split 100:on',
147147
148148tape ( 'PARSER / if user.account is in segment all then split 100:on' , assert => {
149149
150- let { evaluator, segments } = parser ( [ {
151- " matcherGroup" : {
152- " combiner" : " AND" ,
153- " matchers" : [ {
154- " keySelector" : {
155- " trafficType" : " user" ,
156- " attribute" : " account"
150+ let { evaluator} = parser ( [ {
151+ matcherGroup : {
152+ combiner : ' AND' ,
153+ matchers : [ {
154+ keySelector : {
155+ trafficType : ' user' ,
156+ attribute : ' account'
157157 } ,
158- " matcherType" : " ALL_KEYS" ,
159- " negate" : false ,
160- " userDefinedSegmentMatcherData" : null ,
161- " whitelistMatcherData" : null ,
162- " unaryNumericMatcherData" : null ,
163- " betweenMatcherData" : null ,
164- " unaryStringMatcherData" : null
158+ matcherType : ' ALL_KEYS' ,
159+ negate : false ,
160+ userDefinedSegmentMatcherData : null ,
161+ whitelistMatcherData : null ,
162+ unaryNumericMatcherData : null ,
163+ betweenMatcherData : null ,
164+ unaryStringMatcherData : null
165165 } ]
166166 } ,
167- " partitions" : [ {
168- " treatment" : "on" ,
169- " size" : 100
167+ partitions : [ {
168+ treatment : 'on' ,
169+ size : 100
170170 } ]
171171 } ] ) ;
172172
@@ -176,37 +176,37 @@ tape('PARSER / if user.account is in segment all then split 100:on', assert => {
176176
177177 assert . true (
178178 evaluator ( 'test@split.io' , 31 ) === undefined ,
179- " missing attribute account but using segment all evaluates to on"
179+ ' missing attribute should evaluates to undefined'
180180 ) ;
181181
182182 assert . end ( ) ;
183183} ) ;
184184
185185tape ( 'PARSER / if user.attr is between 10 and 20 then split 100:on' , assert => {
186186
187- let { evaluator, segments } = parser ( [ {
188- " matcherGroup" : {
189- " combiner" : " AND" ,
190- " matchers" : [ {
191- " keySelector" : {
192- " trafficType" : " user" ,
193- " attribute" : " attr"
187+ let { evaluator} = parser ( [ {
188+ matcherGroup : {
189+ combiner : ' AND' ,
190+ matchers : [ {
191+ keySelector : {
192+ trafficType : ' user' ,
193+ attribute : ' attr'
194194 } ,
195- " matcherType" : " BETWEEN" ,
196- " negate" : false ,
197- " userDefinedSegmentMatcherData" : null ,
198- " whitelistMatcherData" : null ,
199- " unaryNumericMatcherData" : null ,
200- " betweenMatcherData" : {
201- " dataType" : " NUMBER" ,
202- " start" : 10 ,
203- " end" : 20
195+ matcherType : ' BETWEEN' ,
196+ negate : false ,
197+ userDefinedSegmentMatcherData : null ,
198+ whitelistMatcherData : null ,
199+ unaryNumericMatcherData : null ,
200+ betweenMatcherData : {
201+ dataType : ' NUMBER' ,
202+ start : 10 ,
203+ end : 20
204204 }
205205 } ]
206206 } ,
207- " partitions" : [ {
208- " treatment" : "on" ,
209- " size" : 100
207+ partitions : [ {
208+ treatment : 'on' ,
209+ size : 100
210210 } ]
211211 } ] ) ;
212212
@@ -228,28 +228,28 @@ tape('PARSER / if user.attr is between 10 and 20 then split 100:on', assert => {
228228
229229tape ( 'PARSER / if user.attr <= datetime 1458240947021 then split 100:on' , assert => {
230230
231- let { evaluator, segments } = parser ( [ {
232- " matcherGroup" : {
233- " combiner" : " AND" ,
234- " matchers" : [ {
235- " keySelector" : {
236- " trafficType" : " user" ,
237- " attribute" : " attr"
231+ let { evaluator} = parser ( [ {
232+ matcherGroup : {
233+ combiner : ' AND' ,
234+ matchers : [ {
235+ keySelector : {
236+ trafficType : ' user' ,
237+ attribute : ' attr'
238238 } ,
239- " matcherType" : " LESS_THAN_OR_EQUAL_TO" ,
240- " negate" : false ,
241- " userDefinedSegmentMatcherData" : null ,
242- " whitelistMatcherData" : null ,
243- " unaryNumericMatcherData" : {
244- " dataType" : " DATETIME" ,
245- " value" : 1458240947021
239+ matcherType : ' LESS_THAN_OR_EQUAL_TO' ,
240+ negate : false ,
241+ userDefinedSegmentMatcherData : null ,
242+ whitelistMatcherData : null ,
243+ unaryNumericMatcherData : {
244+ dataType : ' DATETIME' ,
245+ value : 1458240947021
246246 } ,
247- " betweenMatcherData" : null
247+ betweenMatcherData : null
248248 } ]
249249 } ,
250- " partitions" : [ {
251- " treatment" : "on" ,
252- " size" : 100
250+ partitions : [ {
251+ treatment : 'on' ,
252+ size : 100
253253 } ]
254254 } ] ) ;
255255
@@ -275,28 +275,28 @@ tape('PARSER / if user.attr <= datetime 1458240947021 then split 100:on', assert
275275
276276tape ( 'PARSER / if user.attr >= datetime 1458240947021 then split 100:on' , assert => {
277277
278- let { evaluator, segments } = parser ( [ {
279- " matcherGroup" : {
280- " combiner" : " AND" ,
281- " matchers" : [ {
282- " keySelector" : {
283- " trafficType" : " user" ,
284- " attribute" : " attr"
278+ let { evaluator} = parser ( [ {
279+ matcherGroup : {
280+ combiner : ' AND' ,
281+ matchers : [ {
282+ keySelector : {
283+ trafficType : ' user' ,
284+ attribute : ' attr'
285285 } ,
286- " matcherType" : " GREATER_THAN_OR_EQUAL_TO" ,
287- " negate" : false ,
288- " userDefinedSegmentMatcherData" : null ,
289- " whitelistMatcherData" : null ,
290- " unaryNumericMatcherData" : {
291- " dataType" : " DATETIME" ,
292- " value" : 1458240947021
286+ matcherType : ' GREATER_THAN_OR_EQUAL_TO' ,
287+ negate : false ,
288+ userDefinedSegmentMatcherData : null ,
289+ whitelistMatcherData : null ,
290+ unaryNumericMatcherData : {
291+ dataType : ' DATETIME' ,
292+ value : 1458240947021
293293 } ,
294- " betweenMatcherData" : null
294+ betweenMatcherData : null
295295 } ]
296296 } ,
297- " partitions" : [ {
298- " treatment" : "on" ,
299- " size" : 100
297+ partitions : [ {
298+ treatment : 'on' ,
299+ size : 100
300300 } ]
301301 } ] ) ;
302302
@@ -322,28 +322,28 @@ tape('PARSER / if user.attr >= datetime 1458240947021 then split 100:on', assert
322322
323323tape ( 'PARSER / if user.attr = datetime 1458240947021 then split 100:on' , assert => {
324324
325- let { evaluator, segments } = parser ( [ {
326- " matcherGroup" : {
327- " combiner" : " AND" ,
328- " matchers" : [ {
329- " keySelector" : {
330- " trafficType" : " user" ,
331- " attribute" : " attr"
325+ let { evaluator} = parser ( [ {
326+ matcherGroup : {
327+ combiner : ' AND' ,
328+ matchers : [ {
329+ keySelector : {
330+ trafficType : ' user' ,
331+ attribute : ' attr'
332332 } ,
333- " matcherType" : " EQUAL_TO" ,
334- " negate" : false ,
335- " userDefinedSegmentMatcherData" : null ,
336- " whitelistMatcherData" : null ,
337- " unaryNumericMatcherData" : {
338- " dataType" : " DATETIME" ,
339- " value" : 1458240947021
333+ matcherType : ' EQUAL_TO' ,
334+ negate : false ,
335+ userDefinedSegmentMatcherData : null ,
336+ whitelistMatcherData : null ,
337+ unaryNumericMatcherData : {
338+ dataType : ' DATETIME' ,
339+ value : 1458240947021
340340 } ,
341- " betweenMatcherData" : null
341+ betweenMatcherData : null
342342 } ]
343343 } ,
344- " partitions" : [ {
345- " treatment" : "on" ,
346- " size" : 100
344+ partitions : [ {
345+ treatment : 'on' ,
346+ size : 100
347347 } ]
348348 } ] ) ;
349349
0 commit comments