0
0
mirror of https://github.com/vim/vim.git synced 2025-07-26 11:04:33 -04:00

Add test for gettabvar() and settabvar().

This commit is contained in:
Bram Moolenaar 2010-05-31 21:27:30 +02:00
parent a3ff49fdcc
commit 20a825ae0f
6 changed files with 38 additions and 6 deletions

View File

@ -1450,6 +1450,8 @@ A jump table for the options with a short description can be found at |Q_op|.
as HTML. This works to copy rendered HTML from
Firefox, paste it as raw HTML in Vim, select the HTML
in Vim and paste it in a rich edit box in Firefox.
You probably want to add this only temporarily,
possibly use BufEnter autocommands.
Only supported for GTK version 2 and later.
Only available with the |+multi_byte| feature.

View File

@ -1087,12 +1087,16 @@ Vim 7.3:
Ron's version: http://dev.ronware.org/p/vim/finfo?name=gvim.nsi
- Also crypt the swap file, each block separately. Change mf_write() and
mf_read(). How to get b_p_key to these functions?
Generate seed for each block, store in pointer block. Block 1 is not
encrypted.
When changing the password need to read back with the old password and
write again with the new one.
Verify recovery works.
- Update for crypt code to use salt. (Mohsin May 30)
Make the strengthen_key value configurable and store it in the header.
- Do profiling on sha256 code to find obvious bottlenecks.
- Do profiling on crypt code to find obvious bottlenecks.
- Make 'clipboard' global-local, for "html"? Christian J. Robinson.
Patches to include:
- Extend test62 for gettabvar() and settabvar(). (Yegappan Lakshmanan, 2010
May 23)
- Use off_t instead of long for bytes in a buffer. (James Vega, 2010 May 22,
update next day)
- Include conceal patch?

View File

@ -87,7 +87,7 @@ struct pointer_entry
struct pointer_block
{
short_u pb_id; /* ID for pointer block: PTR_ID */
short_u pb_count; /* number of pointer in this block */
short_u pb_count; /* number of pointers in this block */
short_u pb_count_max; /* maximum value for pb_count */
PTR_EN pb_pointer[1]; /* list of pointers to blocks (actually longer)
* followed by empty space until end of page */
@ -3270,7 +3270,8 @@ ml_new_ptr(mfp)
pp = (PTR_BL *)(hp->bh_data);
pp->pb_id = PTR_ID;
pp->pb_count = 0;
pp->pb_count_max = (short_u)((mfp->mf_page_size - sizeof(PTR_BL)) / sizeof(PTR_EN) + 1);
pp->pb_count_max = (short_u)((mfp->mf_page_size - sizeof(PTR_BL))
/ sizeof(PTR_EN) + 1);
return hp;
}

View File

@ -3749,7 +3749,7 @@ update_keys(c)
int c; /* byte of plain text */
{
if (use_crypt_method > 0)
bf_ofb_update( (unsigned char) c);
bf_ofb_update(c);
else
{
keys[0] = CRC32(keys[0], c);

View File

@ -26,6 +26,29 @@ STARTTEST
:call append(line('$'), line2)
:unlet line1 line2
:"
:" Test for settabvar() and gettabvar() functions. Open a new tab page and
:" set 3 variables to a number, string and a list. Verify that the variables
:" are correctly set.
:tabnew
:tabfirst
:call settabvar(2, 'val_num', 100)
:call settabvar(2, 'val_str', 'SetTabVar test')
:call settabvar(2, 'val_list', ['red', 'blue', 'green'])
:"
:let test_status = 'gettabvar: fail'
:if gettabvar(2, 'val_num') == 100 && gettabvar(2, 'val_str') == 'SetTabVar test') && gettabvar(2, 'val_list') == ['red', 'blue', 'green'])
: let test_status = 'gettabvar: pass'
:endif
:call append(line('$'), test_status)
:"
:tabnext 2
:let test_status = 'settabvar: fail'
:if t:val_num == 100 && t:val_str == 'SetTabVar test' && t:val_list == ['red', 'blue', 'green']
: let test_status = 'settabvar: pass'
:endif
:tabclose
:call append(line('$'), test_status)
:"
:"
:/^Results/,$w! test.out
:qa!

View File

@ -3,3 +3,5 @@ tab page 2
this is tab page 3
this is tab page 1
this is tab page 4
gettabvar: pass
settabvar: pass