Skip to content

Commit

Permalink
win: Fix failing tests. (neovim#201)
Browse files Browse the repository at this point in the history
- test_vim.test_command: close the file before unlink().

- test_vim.test_chdir was failing for two reasons. First because
  of missing Windows-specific handling of path names in
  find_file_in_path_option in file_search.c in Neovim core
  (neovim/neovim#4711). Second because although `:cd /` 
  works, getcwd() prepends the drive-letter.

Closes neovim#166
  • Loading branch information
brcolow authored and justinmk committed Jan 14, 2017
1 parent ca3551d commit a2e1169
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions test/test_vim.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ def test_command():
vim.command('normal itesting\npython\napi')
vim.command('w')
ok(os.path.isfile(fname))
eq(open(fname).read(), 'testing\npython\napi\n')
with open(fname) as f:
eq(f.read(), 'testing\npython\napi\n')
os.unlink(fname)


Expand Down Expand Up @@ -63,8 +64,10 @@ def test_strwidth():
@with_setup(setup=cleanup)
def test_chdir():
pwd = vim.eval('getcwd()')
root = os.path.abspath(os.sep)
# We can chdir to '/' on Windows, but then the pwd will be the root drive
vim.chdir('/')
eq(vim.eval('getcwd()'), '/')
eq(vim.eval('getcwd()'), root)
vim.chdir(pwd)
eq(vim.eval('getcwd()'), pwd)

Expand Down

0 comments on commit a2e1169

Please sign in to comment.