aboutsummaryrefslogtreecommitdiff
path: root/test/functional/eval/fnamemodify_spec.lua
blob: 4f86626a1e12f6ba113b09be3b53ab0b343521bd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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)