Annotation of embedaddon/libxml2/python/tests/regexp.py, revision 1.1.1.2
1.1 misho 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:
1.1.1.2 ! misho 9: print("error checking 'a'")
1.1 misho 10: sys.exit(1)
11: if re.regexpExec("b") != 1:
1.1.1.2 ! misho 12: print("error checking 'b'")
1.1 misho 13: sys.exit(1)
14: if re.regexpExec("ab") != 0:
1.1.1.2 ! misho 15: print("error checking 'ab'")
1.1 misho 16: sys.exit(1)
17: if re.regexpExec("") != 0:
1.1.1.2 ! misho 18: print("error checking 'ab'")
1.1 misho 19: sys.exit(1)
20: if re.regexpIsDeterminist() != 1:
1.1.1.2 ! misho 21: print("error checking determinism")
1.1 misho 22: sys.exit(1)
23: del re
24:
25:
26: # Memory debug specific
27: libxml2.cleanupParser()
28: if libxml2.debugMemory(1) == 0:
1.1.1.2 ! misho 29: print("OK")
1.1 misho 30: else:
1.1.1.2 ! misho 31: print("Memory leak %d bytes" % (libxml2.debugMemory(1)))
1.1 misho 32: libxml2.dumpMemory()
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>