]> git.donarmstrong.com Git - roundcube.git/blob - plugins/managesieve/tests/tokenize.phpt
Imported Upstream version 0.5.2+dfsg
[roundcube.git] / plugins / managesieve / tests / tokenize.phpt
1 --TEST--
2 Script parsing: tokenizer
3 --SKIPIF--
4 --FILE--
5 <?php
6 include('../lib/rcube_sieve.php');
7
8 $txt[1] = array(1, 'text: #test
9 This is test ; message;
10 Multi line
11 .
12 ;
13 ');
14 $txt[2] = array(0, '["test1","test2"]');
15 $txt[3] = array(1, '["test"]');
16 $txt[4] = array(1, '"te\\"st"');
17 $txt[5] = array(0, 'test #comment');
18 $txt[6] = array(0, 'text:
19 test
20 .
21 text:
22 test
23 .
24 ');
25 $txt[7] = array(1, '"\\a\\\\\\"a"');
26
27 foreach ($txt as $idx => $t) {
28     echo "[$idx]---------------\n"; 
29     var_dump(rcube_sieve_script::tokenize($t[1], $t[0]));
30 }
31 ?>
32 --EXPECT--
33 [1]---------------
34 string(34) "This is test ; message;
35 Multi line"
36 [2]---------------
37 array(1) {
38   [0]=>
39   array(2) {
40     [0]=>
41     string(5) "test1"
42     [1]=>
43     string(5) "test2"
44   }
45 }
46 [3]---------------
47 array(1) {
48   [0]=>
49   string(4) "test"
50 }
51 [4]---------------
52 string(5) "te"st"
53 [5]---------------
54 array(1) {
55   [0]=>
56   string(4) "test"
57 }
58 [6]---------------
59 array(2) {
60   [0]=>
61   string(4) "test"
62   [1]=>
63   string(4) "test"
64 }
65 [7]---------------
66 string(4) "a\"a"