# now test if the addition worked
import typecheck, os, sys, glob

mydir = os.path.split(sys.argv[0])[0]
libdir = os.path.split(glob.__file__)[0]

print "Testing SRE"
import sre
sre.match('abc', 'def')
try:
    sre.match(None, "def")
except typecheck.InterfaceError, e:
    print "Expect error to follow!"
    print e

try:
    sre.match("def", None)
except typecheck.InterfaceError, e:
    print "Expect error to follow!"
    print e

os.system(os.path.join(libdir, "test", "test_sre.py"))


import xmllib

print "Testing xmllib"

xmllib.XMLParser().feed("<?xml version='1.0'?>")

try:
    xmllib.XMLParser().feed(1)
    assert 0, "Should not get to this point"
except typecheck.InterfaceError, e:
    print "Expect error to follow!"
    print e

os.system(os.path.join(libdir, "test", "test_xmllib.py"))

print "Success!"
