Test for precenting state.relpath fix.

This commit is contained in:
Avery Pennarun 2011-03-27 15:23:57 -04:00
commit fb20652d04
3 changed files with 12 additions and 1 deletions

2
t/pytest.do Normal file
View file

@ -0,0 +1,2 @@
exec >&2
python tstate.py

View file

@ -4,4 +4,4 @@ redo nonshelltest shelltest \
deltest deltest2 test.args test2.args passfailtest chdirtest \
curse/test deps/test "space dir/test" modetest makedir2 \
silencetest touchtest stamp/test alwaystest ifcreate-test \
unicode blank/blank vartest atime autosubdir/test
unicode blank/blank vartest atime autosubdir/test pytest

9
t/tstate.py Normal file
View file

@ -0,0 +1,9 @@
import sys
sys.path.insert(0, '..')
import state
assert(state.relpath('/a/b/c', '/a/b') == 'c')
assert(state.relpath('/a/b/c/', '/a/b') == 'c')
assert(state.relpath('/a/b/c', '/a/b/') == 'c')
assert(state.relpath('/a/b/c//', '/a/b/') == 'c')
assert(state.relpath('/a/b/c/../d', '/a/b/') == 'd')