-
Notifications
You must be signed in to change notification settings - Fork 0
/
check.html
26 lines (24 loc) · 1.1 KB
/
check.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<script type="text/javascript" src="filter2.js"></script>
<script type="text/javascript" src="test1.js"></script>
<script type="text/javascript">
// var testCase = [{
// msg1: {from: '[email protected]', to: '[email protected]'},
// msg2: {from: '[email protected]', to: '[email protected]'},
// msg3: {from: '[email protected]', to: '[email protected]'}
// }, [
// {from: '*@work.com', action: 'tag work'},
// {from: '*@spam.com', action: 'tag spam'},
// {from: '[email protected]', to: '[email protected]', action: 'folder jack'},
// {to: '[email protected]', action: 'forward to [email protected]'}
// ]]
// var ok = filter2.apply(this, testCase);
// var match = '{"msg1":["folder jack","forward to [email protected]"],"msg2":["tag spam","forward to [email protected]"],"msg3":["tag work"]}';
// if (JSON.stringify(ok) == match) {
// console.log('result is VALID');
// } else {
// console.log('result is INVALID');
// }
console.time('go')
filter2(messages.messages, messages.rules);
console.timeEnd('go')
</script>