aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Szakmeister <john@szakmeister.net>2017-03-16 06:58:15 -0400
committerJohn Szakmeister <john@szakmeister.net>2017-03-16 06:58:15 -0400
commit3c8d974f73f2b435d682e3f8752493f8da6e4f1e (patch)
tree039664ff62a5be152f8576b3f12d5a8660e331b8
parent50953f96614ab2ce9790cff726b5a9edf18c2301 (diff)
downloadrneovim-3c8d974f73f2b435d682e3f8752493f8da6e4f1e.tar.gz
rneovim-3c8d974f73f2b435d682e3f8752493f8da6e4f1e.tar.bz2
rneovim-3c8d974f73f2b435d682e3f8752493f8da6e4f1e.zip
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.
-rw-r--r--test/unit/tempfile_spec.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/unit/tempfile_spec.lua b/test/unit/tempfile_spec.lua
index 210518fe1f..c05abfd640 100644
--- a/test/unit/tempfile_spec.lua
+++ b/test/unit/tempfile_spec.lua
@@ -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)