robin/laufey

git clone https://git.robinwobin.dev/robin/laufey

Justin M. KeyesMerge #40865 from justinmk/fixcif907614088

master
750 B29 linesraw
1-- Test if fnameescape is correct for special chars like!
2
3local n = require('test.functional.testnvim')()
4local t = require('test.testutil')
5
6local describe, it, setup, teardown = t.describe, t.it, t.setup, t.teardown
7local clear = n.clear
8local command, expect = n.command, n.expect
9
10describe('fnameescape', function()
11  setup(clear)
12
13  it('is working', function()
14    command('let fname = "Xspa ce"')
15    command('try | exe "w! " . fnameescape(fname) | put=\'Space\' | endtry')
16    command('let fname = "Xemark!"')
17    command('try | exe "w! " . fnameescape(fname) | put=\'ExclamationMark\' | endtry')
18
19    expect([[
20
21      Space
22      ExclamationMark]])
23  end)
24
25  teardown(function()
26    os.remove('Xspa ce')
27    os.remove('Xemark!')
28  end)
29end)