-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
001fb8b
commit c47c90d
Showing
7 changed files
with
136 additions
and
128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -103,31 +103,31 @@ tape('PARSER / if user is in segment ["u1", "u2", "u3", "u4"] then split 100%:on | |
|
||
tape('PARSER / if user.account is in list ["v1", "v2", "v3"] then split 100:on', assert => { | ||
|
||
let {evaluator, segments} = parser([{ | ||
"matcherGroup": { | ||
"combiner": "AND", | ||
"matchers": [{ | ||
"keySelector": { | ||
"trafficType": "user", | ||
"attribute": "account" | ||
let {evaluator} = parser([{ | ||
matcherGroup: { | ||
combiner: 'AND', | ||
matchers: [{ | ||
keySelector: { | ||
trafficType: 'user', | ||
attribute: 'account' | ||
}, | ||
"matcherType": "WHITELIST", | ||
"negate": false, | ||
"userDefinedSegmentMatcherData": null, | ||
"whitelistMatcherData": { | ||
"whitelist": [ | ||
"v1", | ||
"v2", | ||
"v3" | ||
matcherType: 'WHITELIST', | ||
negate: false, | ||
userDefinedSegmentMatcherData: null, | ||
whitelistMatcherData: { | ||
whitelist: [ | ||
'v1', | ||
'v2', | ||
'v3' | ||
] | ||
}, | ||
"unaryNumericMatcherData": null, | ||
"betweenMatcherData": null | ||
unaryNumericMatcherData: null, | ||
betweenMatcherData: null | ||
}] | ||
}, | ||
"partitions": [{ | ||
"treatment": "on", | ||
"size": 100 | ||
partitions: [{ | ||
treatment: 'on', | ||
size: 100 | ||
}] | ||
}]); | ||
|
||
|
@@ -147,26 +147,26 @@ tape('PARSER / if user.account is in list ["v1", "v2", "v3"] then split 100:on', | |
|
||
tape('PARSER / if user.account is in segment all then split 100:on', assert => { | ||
|
||
let {evaluator, segments} = parser([{ | ||
"matcherGroup": { | ||
"combiner": "AND", | ||
"matchers": [{ | ||
"keySelector": { | ||
"trafficType": "user", | ||
"attribute": "account" | ||
let {evaluator} = parser([{ | ||
matcherGroup: { | ||
combiner: 'AND', | ||
matchers: [{ | ||
keySelector: { | ||
trafficType: 'user', | ||
attribute: 'account' | ||
}, | ||
"matcherType": "ALL_KEYS", | ||
"negate": false, | ||
"userDefinedSegmentMatcherData": null, | ||
"whitelistMatcherData": null, | ||
"unaryNumericMatcherData": null, | ||
"betweenMatcherData": null, | ||
"unaryStringMatcherData": null | ||
matcherType: 'ALL_KEYS', | ||
negate: false, | ||
userDefinedSegmentMatcherData: null, | ||
whitelistMatcherData: null, | ||
unaryNumericMatcherData: null, | ||
betweenMatcherData: null, | ||
unaryStringMatcherData: null | ||
}] | ||
}, | ||
"partitions": [{ | ||
"treatment": "on", | ||
"size": 100 | ||
partitions: [{ | ||
treatment: 'on', | ||
size: 100 | ||
}] | ||
}]); | ||
|
||
|
@@ -176,37 +176,37 @@ tape('PARSER / if user.account is in segment all then split 100:on', assert => { | |
|
||
assert.true( | ||
evaluator('[email protected]', 31) === undefined, | ||
"missing attribute account but using segment all evaluates to on" | ||
'missing attribute should evaluates to undefined' | ||
); | ||
|
||
assert.end(); | ||
}); | ||
|
||
tape('PARSER / if user.attr is between 10 and 20 then split 100:on', assert => { | ||
|
||
let {evaluator, segments} = parser([{ | ||
"matcherGroup": { | ||
"combiner": "AND", | ||
"matchers": [{ | ||
"keySelector": { | ||
"trafficType": "user", | ||
"attribute": "attr" | ||
let {evaluator} = parser([{ | ||
matcherGroup: { | ||
combiner: 'AND', | ||
matchers: [{ | ||
keySelector: { | ||
trafficType: 'user', | ||
attribute: 'attr' | ||
}, | ||
"matcherType": "BETWEEN", | ||
"negate": false, | ||
"userDefinedSegmentMatcherData": null, | ||
"whitelistMatcherData": null, | ||
"unaryNumericMatcherData": null, | ||
"betweenMatcherData": { | ||
"dataType": "NUMBER", | ||
"start": 10, | ||
"end": 20 | ||
matcherType: 'BETWEEN', | ||
negate: false, | ||
userDefinedSegmentMatcherData: null, | ||
whitelistMatcherData: null, | ||
unaryNumericMatcherData: null, | ||
betweenMatcherData: { | ||
dataType: 'NUMBER', | ||
start: 10, | ||
end: 20 | ||
} | ||
}] | ||
}, | ||
"partitions": [{ | ||
"treatment": "on", | ||
"size": 100 | ||
partitions: [{ | ||
treatment: 'on', | ||
size: 100 | ||
}] | ||
}]); | ||
|
||
|
@@ -228,28 +228,28 @@ tape('PARSER / if user.attr is between 10 and 20 then split 100:on', assert => { | |
|
||
tape('PARSER / if user.attr <= datetime 1458240947021 then split 100:on', assert => { | ||
|
||
let {evaluator, segments} = parser([{ | ||
"matcherGroup": { | ||
"combiner": "AND", | ||
"matchers": [{ | ||
"keySelector": { | ||
"trafficType": "user", | ||
"attribute": "attr" | ||
let {evaluator} = parser([{ | ||
matcherGroup: { | ||
combiner: 'AND', | ||
matchers: [{ | ||
keySelector: { | ||
trafficType: 'user', | ||
attribute: 'attr' | ||
}, | ||
"matcherType": "LESS_THAN_OR_EQUAL_TO", | ||
"negate": false, | ||
"userDefinedSegmentMatcherData": null, | ||
"whitelistMatcherData": null, | ||
"unaryNumericMatcherData": { | ||
"dataType": "DATETIME", | ||
"value": 1458240947021 | ||
matcherType: 'LESS_THAN_OR_EQUAL_TO', | ||
negate: false, | ||
userDefinedSegmentMatcherData: null, | ||
whitelistMatcherData: null, | ||
unaryNumericMatcherData: { | ||
dataType: 'DATETIME', | ||
value: 1458240947021 | ||
}, | ||
"betweenMatcherData": null | ||
betweenMatcherData: null | ||
}] | ||
}, | ||
"partitions": [{ | ||
"treatment": "on", | ||
"size": 100 | ||
partitions: [{ | ||
treatment: 'on', | ||
size: 100 | ||
}] | ||
}]); | ||
|
||
|
@@ -275,28 +275,28 @@ tape('PARSER / if user.attr <= datetime 1458240947021 then split 100:on', assert | |
|
||
tape('PARSER / if user.attr >= datetime 1458240947021 then split 100:on', assert => { | ||
|
||
let {evaluator, segments} = parser([{ | ||
"matcherGroup": { | ||
"combiner": "AND", | ||
"matchers": [{ | ||
"keySelector": { | ||
"trafficType": "user", | ||
"attribute": "attr" | ||
let {evaluator} = parser([{ | ||
matcherGroup: { | ||
combiner: 'AND', | ||
matchers: [{ | ||
keySelector: { | ||
trafficType: 'user', | ||
attribute: 'attr' | ||
}, | ||
"matcherType": "GREATER_THAN_OR_EQUAL_TO", | ||
"negate": false, | ||
"userDefinedSegmentMatcherData": null, | ||
"whitelistMatcherData": null, | ||
"unaryNumericMatcherData": { | ||
"dataType": "DATETIME", | ||
"value": 1458240947021 | ||
matcherType: 'GREATER_THAN_OR_EQUAL_TO', | ||
negate: false, | ||
userDefinedSegmentMatcherData: null, | ||
whitelistMatcherData: null, | ||
unaryNumericMatcherData: { | ||
dataType: 'DATETIME', | ||
value: 1458240947021 | ||
}, | ||
"betweenMatcherData": null | ||
betweenMatcherData: null | ||
}] | ||
}, | ||
"partitions": [{ | ||
"treatment": "on", | ||
"size": 100 | ||
partitions: [{ | ||
treatment: 'on', | ||
size: 100 | ||
}] | ||
}]); | ||
|
||
|
@@ -322,28 +322,28 @@ tape('PARSER / if user.attr >= datetime 1458240947021 then split 100:on', assert | |
|
||
tape('PARSER / if user.attr = datetime 1458240947021 then split 100:on', assert => { | ||
|
||
let {evaluator, segments} = parser([{ | ||
"matcherGroup": { | ||
"combiner": "AND", | ||
"matchers": [{ | ||
"keySelector": { | ||
"trafficType": "user", | ||
"attribute": "attr" | ||
let {evaluator} = parser([{ | ||
matcherGroup: { | ||
combiner: 'AND', | ||
matchers: [{ | ||
keySelector: { | ||
trafficType: 'user', | ||
attribute: 'attr' | ||
}, | ||
"matcherType": "EQUAL_TO", | ||
"negate": false, | ||
"userDefinedSegmentMatcherData": null, | ||
"whitelistMatcherData": null, | ||
"unaryNumericMatcherData": { | ||
"dataType": "DATETIME", | ||
"value": 1458240947021 | ||
matcherType: 'EQUAL_TO', | ||
negate: false, | ||
userDefinedSegmentMatcherData: null, | ||
whitelistMatcherData: null, | ||
unaryNumericMatcherData: { | ||
dataType: 'DATETIME', | ||
value: 1458240947021 | ||
}, | ||
"betweenMatcherData": null | ||
betweenMatcherData: null | ||
}] | ||
}, | ||
"partitions": [{ | ||
"treatment": "on", | ||
"size": 100 | ||
partitions: [{ | ||
treatment: 'on', | ||
size: 100 | ||
}] | ||
}]); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters