local helpers = require('test.functional.helpers')(after_each) local clear = helpers.clear local eq = helpers.eq local eval = helpers.eval local funcs = helpers.funcs local nvim = helpers.nvim local source = helpers.source local command = helpers.command describe('maparg()', function() before_each(clear) local foo_bar_map_table = { lhs='foo', script=0, silent=0, rhs='bar', expr=0, sid=0, buffer=0, nowait=0, mode='n', noremap=1, lnum=0, } it('returns a dictionary', function() nvim('command', 'nnoremap foo bar') eq('bar', funcs.maparg('foo')) eq(foo_bar_map_table, funcs.maparg('foo', 'n', false, true)) end) it('returns 1 for silent when is used', function() nvim('command', 'nnoremap foo bar') eq(1, funcs.maparg('foo', 'n', false, true)['silent']) nvim('command', 'nnoremap baz bat') eq(0, funcs.maparg('baz', 'n', false, true)['silent']) end) it('returns an empty string when no map is present', function() eq('', funcs.maparg('not a mapping')) end) it('returns an empty dictionary when no map is present and dict is requested', function() eq({}, funcs.maparg('not a mapping', 'n', false, true)) end) it('returns the same value for noremap and