comparison src/testdir/test_popupwin.vim @ 29994:86eb4aba16c3 v9.0.0335

patch 9.0.0335: checks for Dictionary argument often give a vague error Commit: https://github.com/vim/vim/commit/04c4c5746e15884768d2cb41370c3276a196cd4c Author: Yegappan Lakshmanan <yegappan@yahoo.com> Date: Tue Aug 30 19:48:24 2022 +0100 patch 9.0.0335: checks for Dictionary argument often give a vague error Problem: Checks for Dictionary argument often give a vague error message. Solution: Give a useful error message. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/11009)
author Bram Moolenaar <Bram@vim.org>
date Tue, 30 Aug 2022 21:00:05 +0200
parents ab7f050f4335
children 13b02c1ea0f7
comparison
equal deleted inserted replaced
29993:8dd1900432a0 29994:86eb4aba16c3
1033 endfunc 1033 endfunc
1034 1034
1035 func Test_popup_invalid_arguments() 1035 func Test_popup_invalid_arguments()
1036 call assert_fails('call popup_create(666, {})', 'E86:') 1036 call assert_fails('call popup_create(666, {})', 'E86:')
1037 call popup_clear() 1037 call popup_clear()
1038 call assert_fails('call popup_create("text", "none")', 'E715:') 1038 call assert_fails('call popup_create("text", "none")', 'E1206:')
1039 call popup_clear() 1039 call popup_clear()
1040 call assert_fails('call popup_create(test_null_string(), {})', 'E450:') 1040 call assert_fails('call popup_create(test_null_string(), {})', 'E450:')
1041 call assert_fails('call popup_create(test_null_list(), {})', 'E450:') 1041 call assert_fails('call popup_create(test_null_list(), {})', 'E450:')
1042 call popup_clear() 1042 call popup_clear()
1043 1043
1307 eval winid->popup_move(#{line: 1}) 1307 eval winid->popup_move(#{line: 1})
1308 redraw 1308 redraw
1309 let line = join(map(range(1, 6), 'screenstring(1, v:val)'), '') 1309 let line = join(map(range(1, 6), 'screenstring(1, v:val)'), '')
1310 call assert_equal('hworld', line) 1310 call assert_equal('hworld', line)
1311 1311
1312 call assert_fails('call popup_move(winid, [])', 'E715:') 1312 call assert_fails('call popup_move(winid, [])', 'E1206:')
1313 call assert_fails('call popup_move(winid, test_null_dict())', 'E715:') 1313 call assert_fails('call popup_move(winid, test_null_dict())', 'E1297:')
1314 1314
1315 call popup_close(winid) 1315 call popup_close(winid)
1316 1316
1317 call assert_equal(0, popup_move(-1, {})) 1317 call assert_equal(0, popup_move(-1, {}))
1318 1318
2575 let options = popup_getoptions(winid) 2575 let options = popup_getoptions(winid)
2576 call assert_equal(0, options.wrap) 2576 call assert_equal(0, options.wrap)
2577 call assert_equal(1, options.drag) 2577 call assert_equal(1, options.drag)
2578 call assert_equal('Another', options.highlight) 2578 call assert_equal('Another', options.highlight)
2579 2579
2580 call assert_fails('call popup_setoptions(winid, [])', 'E715:') 2580 call assert_fails('call popup_setoptions(winid, [])', 'E1206:')
2581 call assert_fails('call popup_setoptions(winid, test_null_dict())', 'E715:') 2581 call assert_fails('call popup_setoptions(winid, test_null_dict())', 'E1297:')
2582 2582
2583 call popup_close(winid) 2583 call popup_close(winid)
2584 call assert_equal(0, popup_setoptions(winid, options.wrap)) 2584 call assert_equal(0, popup_setoptions(winid, options.wrap))
2585 endfunc 2585 endfunc
2586 2586