From afbdafffc2980c2879393ef03fc3edac49282ea7 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Tue, 9 Jan 2018 01:06:59 +0100 Subject: [PATCH] test: fnamemodify() --- test/functional/eval/fnamemodify_spec.lua | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 test/functional/eval/fnamemodify_spec.lua 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)