diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2016-01-28 17:00:49 -0500 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2016-01-28 17:00:49 -0500 |
commit | 73e83e85662e201f84786134573070135cec05ed (patch) | |
tree | 90eeb56d7a65616f45190a34fa80bad4d7649ce8 /test | |
parent | 1574c4a115ab0d554131c5bfae38fbdad765a0d0 (diff) | |
parent | db77b7bc9e510f790064333473abde98e0284af1 (diff) | |
download | rneovim-73e83e85662e201f84786134573070135cec05ed.tar.gz rneovim-73e83e85662e201f84786134573070135cec05ed.tar.bz2 rneovim-73e83e85662e201f84786134573070135cec05ed.zip |
Merge pull request #4096 from justinmk/coverity125476
coverity/125476: RI: Null pointer dereference
Diffstat (limited to 'test')
-rw-r--r-- | test/functional/legacy/glob2regpat_spec.lua | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/functional/legacy/glob2regpat_spec.lua b/test/functional/legacy/glob2regpat_spec.lua new file mode 100644 index 0000000000..357128bcb6 --- /dev/null +++ b/test/functional/legacy/glob2regpat_spec.lua @@ -0,0 +1,22 @@ +-- Tests for signs + +local helpers = require('test.functional.helpers') +local clear, execute, expect = helpers.clear, helpers.execute, helpers.expect +local eq, neq, eval = helpers.eq, helpers.neq, helpers.eval + +describe('glob2regpat()', function() + before_each(clear) + + it('handles invalid input', function() + execute('call glob2regpat(1.33)') + helpers.feed('<cr>') + neq(nil, string.find(eval('v:errmsg'), '^E806:')) + end) + 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) |