From 3c8d974f73f2b435d682e3f8752493f8da6e4f1e Mon Sep 17 00:00:00 2001 From: John Szakmeister Date: Thu, 16 Mar 2017 06:58:15 -0400 Subject: 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. --- test/unit/tempfile_spec.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) -- cgit