unittests: avoid using pattern matching on file names

The directory name could contain special characters that trips up the
matching used by find.  Instead, let's just make sure that the filename
starts with the directory name.
This commit is contained in:
John Szakmeister
2017-03-16 06:58:15 -04:00
parent 50953f9661
commit 3c8d974f73

View File

@@ -62,7 +62,7 @@ describe('tempfile related functions', function()
itp('generate file name in Neovim own temp directory', function()
local dir = vim_gettempdir()
local file = vim_tempname()
assert.truthy(file:find('^' .. dir .. '[^/]*$'))
eq(string.sub(file, 1, string.len(dir)), dir)
end)
end)
end)