aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2018-01-09 01:06:59 +0100
committerJan Edmund Lazo <janedmundlazo@hotmail.com>2018-01-28 13:58:51 -0500
commitafbdafffc2980c2879393ef03fc3edac49282ea7 (patch)
treed40ee1bf4f22e2d2c9e363ccf968caf22aadd494
parent499c9a15531b7a0e9736a395e8d401ceab3d24d2 (diff)
downloadrneovim-afbdafffc2980c2879393ef03fc3edac49282ea7.tar.gz
rneovim-afbdafffc2980c2879393ef03fc3edac49282ea7.tar.bz2
rneovim-afbdafffc2980c2879393ef03fc3edac49282ea7.zip
test: fnamemodify()
-rw-r--r--test/functional/eval/fnamemodify_spec.lua21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/functional/eval/fnamemodify_spec.lua b/test/functional/eval/fnamemodify_spec.lua
new file mode 100644
index 0000000000..4f86626a1e
--- /dev/null
+++ b/test/functional/eval/fnamemodify_spec.lua
@@ -0,0 +1,21 @@
+local helpers = require('test.functional.helpers')(after_each)
+local clear = helpers.clear
+local eq = helpers.eq
+local iswin = helpers.iswin
+local fnamemodify = helpers.funcs.fnamemodify
+
+describe('fnamemodify()', function()
+ before_each(clear)
+
+ it('works', function()
+ if iswin() then
+ eq([[C:\]], fnamemodify([[\]], ':p:h'))
+ eq([[C:\]], fnamemodify([[\]], ':p'))
+ eq([[C:/]], fnamemodify([[/]], ':p:h'))
+ eq([[C:/]], fnamemodify([[/]], ':p'))
+ else
+ eq('/', fnamemodify([[/]], ':p:h'))
+ eq('/', fnamemodify([[/]], ':p'))
+ end
+ end)
+end)