File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -25,4 +25,18 @@ describe("Directory utilities:", function()
2525 match = utils .dirs_match (cwd , allowed_dirs )
2626 assert .equals (true , match )
2727 end )
28+
29+ it (" can handle only ignore directories" , function ()
30+ local cwd = " ~/Code/Neovim/persisted.nvim"
31+ local allowed_dirs = {}
32+ local ignored_dirs = { { " /tmp" } }
33+ local allowed_match = utils .dirs_match (cwd , allowed_dirs )
34+ local ignored_match = utils .dirs_match (cwd , ignored_dirs )
35+ -- This looks weird, I know. That is because we expect dirs_match to return
36+ -- false for allowed_dirs since allowed dirs is empty.
37+ -- Therefore this is actually testing to ensure we are getting false and false
38+ -- This test specifically addresses the change added in
39+ -- https://github.com/olimorris/persisted.nvim/pull/152
40+ assert .equals (true , not allowed_match and not ignored_match )
41+ end )
2842end )
You can’t perform that action at this time.
0 commit comments