Sha256: 86d28dd33a135ff055247b33d580afa4ee8413e547799b0e996bf46a6d02925b

Contents?: true

Size: 1.18 KB

Versions: 30

Compression:

Stored size: 1.18 KB

Contents

import posixpath

errors = 0

def tester(fn, wantResult):
    gotResult = eval(fn)
    if wantResult != gotResult:
        print "error!"
        print "evaluated: " + str(fn)
        print "should be: " + str(wantResult)
        print " returned: " + str(gotResult)
        print ""
        global errors
        errors = errors + 1

tester('posixpath.splitdrive("/foo/bar")', ('', '/foo/bar'))

tester('posixpath.split("/foo/bar")', ('/foo', 'bar'))
tester('posixpath.split("/")', ('/', ''))
tester('posixpath.split("foo")', ('', 'foo'))

tester('posixpath.splitext("foo.ext")', ('foo', '.ext'))
tester('posixpath.splitext("/foo/foo.ext")', ('/foo/foo', '.ext'))

tester('posixpath.isabs("/")', 1)
tester('posixpath.isabs("/foo")', 1)
tester('posixpath.isabs("/foo/bar")', 1)
tester('posixpath.isabs("foo/bar")', 0)

tester('posixpath.commonprefix(["/home/swenson/spam", "/home/swen/spam"])',
       "/home/swen")
tester('posixpath.commonprefix(["/home/swen/spam", "/home/swen/eggs"])',
       "/home/swen/")
tester('posixpath.commonprefix(["/home/swen/spam", "/home/swen/spam"])',
       "/home/swen/spam")

if errors:
    print str(errors) + " errors."
else:
    print "No errors.  Thank your lucky stars."

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
rubyfox-server-2.12.1.0 lib/rubyfox/server/data/lib/Lib/test/test_posixpath.py
rubyfox-server-2.11.1.0 lib/rubyfox/server/data/lib/Lib/test/test_posixpath.py
rubyfox-server-2.9.2.0 lib/rubyfox/server/data/lib/Lib/test/test_posixpath.py
rubyfox-server-2.9.1.0 lib/rubyfox/server/data/lib/Lib/test/test_posixpath.py
rubyfox-server-2.9.0.0 lib/rubyfox/server/data/lib/Lib/test/test_posixpath.py
rubyfox-server-2.8.4.0 lib/rubyfox/server/data/lib/Lib/test/test_posixpath.py
rubyfox-server-2.8.0.1 lib/rubyfox/server/data/lib/Lib/test/test_posixpath.py
rubyfox-server-2.8.0.0 lib/rubyfox/server/data/lib/Lib/test/test_posixpath.py
rubyfox-server-2.3.0.0 lib/rubyfox/server/data/lib/Lib/test/test_posixpath.py
rubyfox-server-2.3.0.pre2 lib/rubyfox/server/data/lib/Lib/test/test_posixpath.py