neovim/test/functional/legacy/glob2regpat_spec.lua
zeertzjq 7abfb1f86e vim-patch:8.2.2949: tests failing because no error for float to string conversion
Problem:    Tests failing because there is no error for float to string
            conversion.
Solution:   Change the check for failure to check for correct result.  Make
            some conversions strict in Vim9 script.

3cfa5b16b0

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-06-12 13:27:16 +08:00

16 lines
431 B
Lua

local helpers = require('test.functional.helpers')(after_each)
local clear = helpers.clear
local eq, eval = helpers.eq, helpers.eval
describe('glob2regpat()', function()
before_each(clear)
it('returns ^$ for empty input', function()
eq('^$', eval("glob2regpat('')"))
end)
it('handles valid input', function()
eq('^foo\\.', eval("glob2regpat('foo.*')"))
eq('\\.vim$', eval("glob2regpat('*.vim')"))
end)
end)