VirtualBox

source: vbox/trunk/src/libs/libxml2-2.13.2/python/tests/regexp.py@ 105420

Last change on this file since 105420 was 105420, checked in by vboxsync, 7 months ago

libxml2-2.12.6: Applied and adjusted our libxml2 changes to 2.12.6. bugref:10730

  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 711 bytes
Line 
1#!/usr/bin/env python3
2import setup_test
3import libxml2
4
5# Memory debug specific
6libxml2.debugMemory(1)
7
8re = libxml2.regexpCompile("a|b")
9if re.regexpExec("a") != 1:
10 print("error checking 'a'")
11 sys.exit(1)
12if re.regexpExec("b") != 1:
13 print("error checking 'b'")
14 sys.exit(1)
15if re.regexpExec("ab") != 0:
16 print("error checking 'ab'")
17 sys.exit(1)
18if re.regexpExec("") != 0:
19 print("error checking 'ab'")
20 sys.exit(1)
21if re.regexpIsDeterminist() != 1:
22 print("error checking determinism")
23 sys.exit(1)
24del re
25
26
27# Memory debug specific
28libxml2.cleanupParser()
29if libxml2.debugMemory(1) == 0:
30 print("OK")
31else:
32 print("Memory leak %d bytes" % (libxml2.debugMemory(1)))
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