blob: 4831ca8fc54a26f303b32f6ecea7b39919d8fc32 [file] [edit]
# This set of tests exercises the serialization/deserialization and code copy
# functions in the library. The first section requires Unicode support; the
# remaining tests do not use UTF. None of the tests use JIT.
#if unicode
# Six disjoint characters above 255 require character lists. Vary the name
# length to exercise padding between the name table and the aligned lists.
/(?<A>[\x{100}\x{200}\x{300}\x{400}\x{500}\x{600}])/utf,push
/(?<AB>[\x{100}\x{200}\x{300}\x{400}\x{500}\x{600}])/utf,push
/(?<ABC>[\x{100}\x{200}\x{300}\x{400}\x{500}\x{600}])/utf,push
/(?<ABCD>[\x{100}\x{200}\x{300}\x{400}\x{500}\x{600}])/utf,push
#save testsaved1
#load testsaved1
#pop
\x{100}
\x{600}
\x{150}
#pop
\x{100}
\x{600}
\x{150}
#pop
\x{100}
\x{600}
\x{150}
#pop
\x{100}
\x{600}
\x{150}
#endif
#forbid_utf
# Compile several patterns, push them onto the stack, and then write them
# all to a file.
#pattern push
/(?<NAME>(?&NAME_PAT))\s+(?<ADDR>(?&ADDRESS_PAT))
(?(DEFINE)
(?<NAME_PAT>[a-z]+)
(?<ADDRESS_PAT>\d+)
)/x
/^(?:((.)(?1)\2|)|((.)(?3)\4|.))$/i
#save testsaved1
# Do it again for some more patterns.
/(*MARK:A)(*SKIP:B)(C|X)/mark
/(?:(?<n>foo)|(?<n>bar))\k<n>/dupnames
#save testsaved2
#pattern -push
# Reload the patterns, then pop them one by one and check them.
#load testsaved1
#load testsaved2
#pop info
foofoo
barbar
#pop mark
C
\= Expect no match
D
#pop
AmanaplanacanalPanama
#pop info
metcalfe 33
# Check for an error when different tables are used.
/abc/push,tables=1
/xyz/push,tables=2
#save testsaved1
#pop
xyz
#pop
abc
#pop should give an error
pqr
/abcd/pushcopy
abcd
#pop
abcd
#pop should give an error
/abcd/push
#popcopy
abcd
#pop
abcd
/abcd/push
#save testsaved1
#pop should give an error
#load testsaved1
#popcopy
abcd
#pop
abcd
#pop should give an error
/abcd/pushtablescopy
abcd
#popcopy
abcd
#pop
abcd
# Must only specify one of these
//push,pushcopy
//push,pushtablescopy
//pushcopy,pushtablescopy
# End of testinput20