file_pat_to_reg_pat(): handle empty string.

This commit is contained in:
oni-link
2016-01-28 00:45:26 -05:00
committed by Justin M. Keyes
parent 894fcb778e
commit db77b7bc9e
3 changed files with 7 additions and 3 deletions

View File

@@ -12,8 +12,8 @@ describe('glob2regpat()', function()
helpers.feed('<cr>')
neq(nil, string.find(eval('v:errmsg'), '^E806:'))
end)
it('returns empty string for empty input', function()
eq('', eval("glob2regpat('')"))
it('returns ^$ for empty input', function()
eq('^$', eval("glob2regpat('')"))
end)
it('handles valid input', function()
eq('^foo\\.', eval("glob2regpat('foo.*')"))