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.19.2.0 lib/rubyfox/server/data/lib/Lib/test/test_posixpath.py
rubyfox-server-2.17.3.2 lib/rubyfox/server/data/lib/Lib/test/test_posixpath.py
rubyfox-server-2.17.3.1 lib/rubyfox/server/data/lib/Lib/test/test_posixpath.py
rubyfox-server-2.17.3.0 lib/rubyfox/server/data/lib/Lib/test/test_posixpath.py
rubyfox-server-2.16.3.2 lib/rubyfox/server/data/lib/Lib/test/test_posixpath.py
rubyfox-server-2.16.3.1 lib/rubyfox/server/data/lib/Lib/test/test_posixpath.py
rubyfox-server-2.16.0.4 lib/rubyfox/server/data/lib/Lib/test/test_posixpath.py
rubyfox-server-2.16.0.3 lib/rubyfox/server/data/lib/Lib/test/test_posixpath.py
rubyfox-server-2.16.0.2 lib/rubyfox/server/data/lib/Lib/test/test_posixpath.py
rubyfox-server-2.16.0.1 lib/rubyfox/server/data/lib/Lib/test/test_posixpath.py
rubyfox-server-2.16.0.0 lib/rubyfox/server/data/lib/Lib/test/test_posixpath.py
rubyfox-server-2.13.7.3 lib/rubyfox/server/data/lib/Lib/test/test_posixpath.py
rubyfox-server-2.13.6.2 lib/rubyfox/server/data/lib/Lib/test/test_posixpath.py
rubyfox-server-2.13.6.1 lib/rubyfox/server/data/lib/Lib/test/test_posixpath.py
rubyfox-server-2.13.5.1 lib/rubyfox/server/data/lib/Lib/test/test_posixpath.py
rubyfox-server-2.13.4.1 lib/rubyfox/server/data/lib/Lib/test/test_posixpath.py
rubyfox-server-2.13.3.1 lib/rubyfox/server/data/lib/Lib/test/test_posixpath.py
rubyfox-server-2.12.5.1 lib/rubyfox/server/data/lib/Lib/test/test_posixpath.py
rubyfox-server-2.12.5.0 lib/rubyfox/server/data/lib/Lib/test/test_posixpath.py
rubyfox-server-2.12.4.0 lib/rubyfox/server/data/lib/Lib/test/test_posixpath.py