VirtualBox

source: vbox/trunk/src/libs/libxml2-2.9.2/python/tests/regexp.py@ 58072

Last change on this file since 58072 was 58072, checked in by vboxsync, 9 years ago

libxml 2.9.2 unmodified

  • Property svn:eol-style set to LF
  • Property svn:executable set to *
File size: 716 bytes
Line 
1#!/usr/bin/python -u
2import libxml2
3
4# Memory debug specific
5libxml2.debugMemory(1)
6
7re = libxml2.regexpCompile("a|b")
8if re.regexpExec("a") != 1:
9 print("error checking 'a'")
10 sys.exit(1)
11if re.regexpExec("b") != 1:
12 print("error checking 'b'")
13 sys.exit(1)
14if re.regexpExec("ab") != 0:
15 print("error checking 'ab'")
16 sys.exit(1)
17if re.regexpExec("") != 0:
18 print("error checking 'ab'")
19 sys.exit(1)
20if re.regexpIsDeterminist() != 1:
21 print("error checking determinism")
22 sys.exit(1)
23del re
24
25
26# Memory debug specific
27libxml2.cleanupParser()
28if libxml2.debugMemory(1) == 0:
29 print("OK")
30else:
31 print("Memory leak %d bytes" % (libxml2.debugMemory(1)))
32 libxml2.dumpMemory()
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette