mirror of
				https://github.com/neovim/neovim.git
				synced 2025-10-26 12:27:24 +00:00 
			
		
		
		
	test: normalise nvim bridge functions
- remove helpers.cur*meths - remove helpers.nvim
This commit is contained in:
		| @@ -7,7 +7,7 @@ local eq = helpers.eq | ||||
| local eval = helpers.eval | ||||
| local feed = helpers.feed | ||||
| local map = vim.tbl_map | ||||
| local nvim = helpers.nvim | ||||
| local meths = helpers.meths | ||||
| local parse_context = helpers.parse_context | ||||
| local exec_capture = helpers.exec_capture | ||||
| local source = helpers.source | ||||
| @@ -126,16 +126,16 @@ describe('context functions', function() | ||||
|     end) | ||||
|  | ||||
|     it('saves and restores global variables properly', function() | ||||
|       nvim('set_var', 'one', 1) | ||||
|       nvim('set_var', 'Two', 2) | ||||
|       nvim('set_var', 'THREE', 3) | ||||
|       meths.nvim_set_var('one', 1) | ||||
|       meths.nvim_set_var('Two', 2) | ||||
|       meths.nvim_set_var('THREE', 3) | ||||
|       eq({ 1, 2, 3 }, eval('[g:one, g:Two, g:THREE]')) | ||||
|       call('ctxpush') | ||||
|       call('ctxpush', { 'gvars' }) | ||||
|  | ||||
|       nvim('del_var', 'one') | ||||
|       nvim('del_var', 'Two') | ||||
|       nvim('del_var', 'THREE') | ||||
|       meths.nvim_del_var('one') | ||||
|       meths.nvim_del_var('Two') | ||||
|       meths.nvim_del_var('THREE') | ||||
|       eq('Vim:E121: Undefined variable: g:one', pcall_err(eval, 'g:one')) | ||||
|       eq('Vim:E121: Undefined variable: g:Two', pcall_err(eval, 'g:Two')) | ||||
|       eq('Vim:E121: Undefined variable: g:THREE', pcall_err(eval, 'g:THREE')) | ||||
| @@ -143,9 +143,9 @@ describe('context functions', function() | ||||
|       call('ctxpop') | ||||
|       eq({ 1, 2, 3 }, eval('[g:one, g:Two, g:THREE]')) | ||||
|  | ||||
|       nvim('del_var', 'one') | ||||
|       nvim('del_var', 'Two') | ||||
|       nvim('del_var', 'THREE') | ||||
|       meths.nvim_del_var('one') | ||||
|       meths.nvim_del_var('Two') | ||||
|       meths.nvim_del_var('THREE') | ||||
|       eq('Vim:E121: Undefined variable: g:one', pcall_err(eval, 'g:one')) | ||||
|       eq('Vim:E121: Undefined variable: g:Two', pcall_err(eval, 'g:Two')) | ||||
|       eq('Vim:E121: Undefined variable: g:THREE', pcall_err(eval, 'g:THREE')) | ||||
| @@ -300,9 +300,9 @@ describe('context functions', function() | ||||
|       feed('G') | ||||
|       feed('gg') | ||||
|       command('edit ' .. fname2) | ||||
|       nvim('set_var', 'one', 1) | ||||
|       nvim('set_var', 'Two', 2) | ||||
|       nvim('set_var', 'THREE', 3) | ||||
|       meths.nvim_set_var('one', 1) | ||||
|       meths.nvim_set_var('Two', 2) | ||||
|       meths.nvim_set_var('THREE', 3) | ||||
|  | ||||
|       local with_regs = { | ||||
|         ['regs'] = { | ||||
| @@ -412,14 +412,14 @@ describe('context functions', function() | ||||
|     end) | ||||
|  | ||||
|     it('sets context dictionary at index in context stack', function() | ||||
|       nvim('set_var', 'one', 1) | ||||
|       nvim('set_var', 'Two', 2) | ||||
|       nvim('set_var', 'THREE', 3) | ||||
|       meths.nvim_set_var('one', 1) | ||||
|       meths.nvim_set_var('Two', 2) | ||||
|       meths.nvim_set_var('THREE', 3) | ||||
|       call('ctxpush') | ||||
|       local ctx1 = call('ctxget') | ||||
|       nvim('set_var', 'one', 'a') | ||||
|       nvim('set_var', 'Two', 'b') | ||||
|       nvim('set_var', 'THREE', 'c') | ||||
|       meths.nvim_set_var('one', 'a') | ||||
|       meths.nvim_set_var('Two', 'b') | ||||
|       meths.nvim_set_var('THREE', 'c') | ||||
|       call('ctxpush') | ||||
|       call('ctxpush') | ||||
|       local ctx2 = call('ctxget') | ||||
| @@ -431,7 +431,7 @@ describe('context functions', function() | ||||
|       eq({ 1, 2, 3 }, eval('[g:one, g:Two, g:THREE]')) | ||||
|       call('ctxpop') | ||||
|       eq({ 'a', 'b', 'c' }, eval('[g:one, g:Two, g:THREE]')) | ||||
|       nvim('set_var', 'one', 1.5) | ||||
|       meths.nvim_set_var('one', 1.5) | ||||
|       eq({ 1.5, 'b', 'c' }, eval('[g:one, g:Two, g:THREE]')) | ||||
|       call('ctxpop') | ||||
|       eq({ 'a', 'b', 'c' }, eval('[g:one, g:Two, g:THREE]')) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Lewis Russell
					Lewis Russell