File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / libxml2 / python / tests / regexp.py
Revision 1.1.1.2 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Sun Jun 15 19:53:34 2014 UTC (10 years, 5 months ago) by misho
Branches: libxml2, MAIN
CVS tags: v2_9_1p0, v2_9_1, HEAD
libxml2 2.9.1

    1: #!/usr/bin/python -u
    2: import libxml2
    3: 
    4: # Memory debug specific
    5: libxml2.debugMemory(1)
    6: 
    7: re = libxml2.regexpCompile("a|b")
    8: if re.regexpExec("a") != 1:
    9:     print("error checking 'a'")
   10:     sys.exit(1)
   11: if re.regexpExec("b") != 1:
   12:     print("error checking 'b'")
   13:     sys.exit(1)
   14: if re.regexpExec("ab") != 0:
   15:     print("error checking 'ab'")
   16:     sys.exit(1)
   17: if re.regexpExec("") != 0:
   18:     print("error checking 'ab'")
   19:     sys.exit(1)
   20: if re.regexpIsDeterminist() != 1:
   21:     print("error checking determinism")
   22:     sys.exit(1)
   23: del re
   24:     
   25: 
   26: # Memory debug specific
   27: libxml2.cleanupParser()
   28: if libxml2.debugMemory(1) == 0:
   29:     print("OK")
   30: else:
   31:     print("Memory leak %d bytes" % (libxml2.debugMemory(1)))
   32:     libxml2.dumpMemory()

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>