Janis Danisevskis | 8b979b2 | 2016-08-15 16:09:16 +0100 | [diff] [blame] | 1 | # This set of tests exercises the serialization/deserialization and code copy |
2 | # functions in the library. It does not use UTF or JIT. | ||||
Janis Danisevskis | 53e448c | 2016-03-31 13:35:25 +0100 | [diff] [blame] | 3 | |
4 | #forbid_utf | ||||
5 | |||||
6 | # Compile several patterns, push them onto the stack, and then write them | ||||
7 | # all to a file. | ||||
8 | |||||
9 | #pattern push | ||||
10 | |||||
11 | /(?<NAME>(?&NAME_PAT))\s+(?<ADDR>(?&ADDRESS_PAT)) | ||||
12 | (?(DEFINE) | ||||
13 | (?<NAME_PAT>[a-z]+) | ||||
14 | (?<ADDRESS_PAT>\d+) | ||||
15 | )/x | ||||
16 | /^(?:((.)(?1)\2|)|((.)(?3)\4|.))$/i | ||||
17 | |||||
18 | #save testsaved1 | ||||
19 | |||||
20 | # Do it again for some more patterns. | ||||
21 | |||||
22 | /(*MARK:A)(*SKIP:B)(C|X)/mark | ||||
23 | /(?:(?<n>foo)|(?<n>bar))\k<n>/dupnames | ||||
24 | |||||
25 | #save testsaved2 | ||||
26 | #pattern -push | ||||
27 | |||||
28 | # Reload the patterns, then pop them one by one and check them. | ||||
29 | |||||
30 | #load testsaved1 | ||||
31 | #load testsaved2 | ||||
32 | |||||
33 | #pop info | ||||
Elliott Hughes | 9bc971b | 2018-07-27 13:23:14 -0700 | [diff] [blame] | 34 | foofoo |
Janis Danisevskis | 53e448c | 2016-03-31 13:35:25 +0100 | [diff] [blame] | 35 | barbar |
Elliott Hughes | 9bc971b | 2018-07-27 13:23:14 -0700 | [diff] [blame] | 36 | |
Janis Danisevskis | 53e448c | 2016-03-31 13:35:25 +0100 | [diff] [blame] | 37 | #pop mark |
38 | C | ||||
Elliott Hughes | 9bc971b | 2018-07-27 13:23:14 -0700 | [diff] [blame] | 39 | \= Expect no match |
40 | D | ||||
41 | |||||
Janis Danisevskis | 53e448c | 2016-03-31 13:35:25 +0100 | [diff] [blame] | 42 | #pop |
Elliott Hughes | 9bc971b | 2018-07-27 13:23:14 -0700 | [diff] [blame] | 43 | AmanaplanacanalPanama |
Janis Danisevskis | 53e448c | 2016-03-31 13:35:25 +0100 | [diff] [blame] | 44 | |
45 | #pop info | ||||
46 | metcalfe 33 | ||||
Elliott Hughes | 9bc971b | 2018-07-27 13:23:14 -0700 | [diff] [blame] | 47 | |
Janis Danisevskis | 53e448c | 2016-03-31 13:35:25 +0100 | [diff] [blame] | 48 | # Check for an error when different tables are used. |
49 | |||||
50 | /abc/push,tables=1 | ||||
51 | /xyz/push,tables=2 | ||||
52 | #save testsaved1 | ||||
53 | |||||
54 | #pop | ||||
55 | xyz | ||||
56 | |||||
57 | #pop | ||||
58 | abc | ||||
59 | |||||
60 | #pop should give an error | ||||
61 | pqr | ||||
Elliott Hughes | 9bc971b | 2018-07-27 13:23:14 -0700 | [diff] [blame] | 62 | |
Janis Danisevskis | 8b979b2 | 2016-08-15 16:09:16 +0100 | [diff] [blame] | 63 | /abcd/pushcopy |
64 | abcd | ||||
Elliott Hughes | 9bc971b | 2018-07-27 13:23:14 -0700 | [diff] [blame] | 65 | |
Janis Danisevskis | 8b979b2 | 2016-08-15 16:09:16 +0100 | [diff] [blame] | 66 | #pop |
Elliott Hughes | 9bc971b | 2018-07-27 13:23:14 -0700 | [diff] [blame] | 67 | abcd |
Janis Danisevskis | 8b979b2 | 2016-08-15 16:09:16 +0100 | [diff] [blame] | 68 | |
69 | #pop should give an error | ||||
70 | |||||
71 | /abcd/push | ||||
72 | #popcopy | ||||
73 | abcd | ||||
Elliott Hughes | 9bc971b | 2018-07-27 13:23:14 -0700 | [diff] [blame] | 74 | |
Janis Danisevskis | 8b979b2 | 2016-08-15 16:09:16 +0100 | [diff] [blame] | 75 | #pop |
Elliott Hughes | 9bc971b | 2018-07-27 13:23:14 -0700 | [diff] [blame] | 76 | abcd |
77 | |||||
Janis Danisevskis | 8b979b2 | 2016-08-15 16:09:16 +0100 | [diff] [blame] | 78 | /abcd/push |
79 | #save testsaved1 | ||||
80 | #pop should give an error | ||||
81 | |||||
82 | #load testsaved1 | ||||
Elliott Hughes | 9bc971b | 2018-07-27 13:23:14 -0700 | [diff] [blame] | 83 | #popcopy |
Janis Danisevskis | 8b979b2 | 2016-08-15 16:09:16 +0100 | [diff] [blame] | 84 | abcd |
Elliott Hughes | 9bc971b | 2018-07-27 13:23:14 -0700 | [diff] [blame] | 85 | |
Janis Danisevskis | 8b979b2 | 2016-08-15 16:09:16 +0100 | [diff] [blame] | 86 | #pop |
87 | abcd | ||||
88 | |||||
89 | #pop should give an error | ||||
Janis Danisevskis | 53e448c | 2016-03-31 13:35:25 +0100 | [diff] [blame] | 90 | |
Elliott Hughes | 9bc971b | 2018-07-27 13:23:14 -0700 | [diff] [blame] | 91 | /abcd/pushtablescopy |
92 | abcd | ||||
93 | |||||
94 | #popcopy | ||||
95 | abcd | ||||
96 | |||||
97 | #pop | ||||
98 | abcd | ||||
99 | |||||
100 | # Must only specify one of these | ||||
101 | |||||
102 | //push,pushcopy | ||||
103 | |||||
104 | //push,pushtablescopy | ||||
105 | |||||
106 | //pushcopy,pushtablescopy | ||||
107 | |||||
Janis Danisevskis | 53e448c | 2016-03-31 13:35:25 +0100 | [diff] [blame] | 108 | # End of testinput20 |