Mercurial > vim
annotate src/testdir/test_set.vim @ 26079:a60952e58e5d v8.2.3573
patch 8.2.3573: cannot decide whether to skip test that fails with 64 bit
Commit: https://github.com/vim/vim/commit/69b3072d984480935ec412b32b97fea974d2b689
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Nov 2 21:39:49 2021 +0000
patch 8.2.3573: cannot decide whether to skip test that fails with 64 bit
Problem: Cannot decide whether to skip test that fails with 64 bit ints.
(closes https://github.com/vim/vim/issues/9072)
Solution: Add v:sizeofint, v:sizeoflong and v:sizeofpointer. Improve the
check for multiply overflow.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 02 Nov 2021 22:45:04 +0100 |
parents | dd98794f7d8c |
children | d26bab4f6aca |
rev | line source |
---|---|
7426
779a7c14c795
commit https://github.com/vim/vim/commit/8f79acdf7ede2693fbda53c3c9693f16db4f193b
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1 " Tests for the :set command |
779a7c14c795
commit https://github.com/vim/vim/commit/8f79acdf7ede2693fbda53c3c9693f16db4f193b
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2 |
779a7c14c795
commit https://github.com/vim/vim/commit/8f79acdf7ede2693fbda53c3c9693f16db4f193b
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
3 function Test_set_backslash() |
779a7c14c795
commit https://github.com/vim/vim/commit/8f79acdf7ede2693fbda53c3c9693f16db4f193b
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
4 let isk_save = &isk |
779a7c14c795
commit https://github.com/vim/vim/commit/8f79acdf7ede2693fbda53c3c9693f16db4f193b
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
5 |
779a7c14c795
commit https://github.com/vim/vim/commit/8f79acdf7ede2693fbda53c3c9693f16db4f193b
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
6 set isk=a,b,c |
779a7c14c795
commit https://github.com/vim/vim/commit/8f79acdf7ede2693fbda53c3c9693f16db4f193b
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
7 set isk+=d |
779a7c14c795
commit https://github.com/vim/vim/commit/8f79acdf7ede2693fbda53c3c9693f16db4f193b
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
8 call assert_equal('a,b,c,d', &isk) |
779a7c14c795
commit https://github.com/vim/vim/commit/8f79acdf7ede2693fbda53c3c9693f16db4f193b
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
9 set isk+=\\,e |
779a7c14c795
commit https://github.com/vim/vim/commit/8f79acdf7ede2693fbda53c3c9693f16db4f193b
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
10 call assert_equal('a,b,c,d,\,e', &isk) |
779a7c14c795
commit https://github.com/vim/vim/commit/8f79acdf7ede2693fbda53c3c9693f16db4f193b
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
11 set isk-=e |
779a7c14c795
commit https://github.com/vim/vim/commit/8f79acdf7ede2693fbda53c3c9693f16db4f193b
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
12 call assert_equal('a,b,c,d,\', &isk) |
779a7c14c795
commit https://github.com/vim/vim/commit/8f79acdf7ede2693fbda53c3c9693f16db4f193b
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
13 set isk-=\\ |
779a7c14c795
commit https://github.com/vim/vim/commit/8f79acdf7ede2693fbda53c3c9693f16db4f193b
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
14 call assert_equal('a,b,c,d', &isk) |
779a7c14c795
commit https://github.com/vim/vim/commit/8f79acdf7ede2693fbda53c3c9693f16db4f193b
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
15 |
779a7c14c795
commit https://github.com/vim/vim/commit/8f79acdf7ede2693fbda53c3c9693f16db4f193b
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
16 let &isk = isk_save |
779a7c14c795
commit https://github.com/vim/vim/commit/8f79acdf7ede2693fbda53c3c9693f16db4f193b
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
17 endfunction |
779a7c14c795
commit https://github.com/vim/vim/commit/8f79acdf7ede2693fbda53c3c9693f16db4f193b
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
18 |
779a7c14c795
commit https://github.com/vim/vim/commit/8f79acdf7ede2693fbda53c3c9693f16db4f193b
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
19 function Test_set_add() |
779a7c14c795
commit https://github.com/vim/vim/commit/8f79acdf7ede2693fbda53c3c9693f16db4f193b
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
20 let wig_save = &wig |
779a7c14c795
commit https://github.com/vim/vim/commit/8f79acdf7ede2693fbda53c3c9693f16db4f193b
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
21 |
779a7c14c795
commit https://github.com/vim/vim/commit/8f79acdf7ede2693fbda53c3c9693f16db4f193b
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
22 set wildignore=*.png, |
779a7c14c795
commit https://github.com/vim/vim/commit/8f79acdf7ede2693fbda53c3c9693f16db4f193b
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
23 set wildignore+=*.jpg |
779a7c14c795
commit https://github.com/vim/vim/commit/8f79acdf7ede2693fbda53c3c9693f16db4f193b
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
24 call assert_equal('*.png,*.jpg', &wig) |
779a7c14c795
commit https://github.com/vim/vim/commit/8f79acdf7ede2693fbda53c3c9693f16db4f193b
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
25 |
779a7c14c795
commit https://github.com/vim/vim/commit/8f79acdf7ede2693fbda53c3c9693f16db4f193b
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
26 let &wig = wig_save |
779a7c14c795
commit https://github.com/vim/vim/commit/8f79acdf7ede2693fbda53c3c9693f16db4f193b
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
27 endfunction |
21765
08940efa6b4e
patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents:
7426
diff
changeset
|
28 |
25238
dd98794f7d8c
patch 8.2.3155: some option related code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
29 |
dd98794f7d8c
patch 8.2.3155: some option related code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
30 " :set, :setlocal, :setglobal without arguments show values of options. |
dd98794f7d8c
patch 8.2.3155: some option related code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
31 func Test_set_no_arg() |
dd98794f7d8c
patch 8.2.3155: some option related code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
32 set textwidth=79 |
dd98794f7d8c
patch 8.2.3155: some option related code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
33 let a = execute('set') |
dd98794f7d8c
patch 8.2.3155: some option related code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
34 call assert_match("^\n--- Options ---\n.*textwidth=79\\>", a) |
dd98794f7d8c
patch 8.2.3155: some option related code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
35 set textwidth& |
dd98794f7d8c
patch 8.2.3155: some option related code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
36 |
dd98794f7d8c
patch 8.2.3155: some option related code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
37 setlocal textwidth=78 |
dd98794f7d8c
patch 8.2.3155: some option related code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
38 let a = execute('setlocal') |
dd98794f7d8c
patch 8.2.3155: some option related code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
39 call assert_match("^\n--- Local option values ---\n.*textwidth=78\\>", a) |
dd98794f7d8c
patch 8.2.3155: some option related code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
40 setlocal textwidth& |
dd98794f7d8c
patch 8.2.3155: some option related code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
41 |
dd98794f7d8c
patch 8.2.3155: some option related code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
42 setglobal textwidth=77 |
dd98794f7d8c
patch 8.2.3155: some option related code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
43 let a = execute('setglobal') |
dd98794f7d8c
patch 8.2.3155: some option related code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
44 call assert_match("^\n--- Global option values ---\n.*textwidth=77\\>", a) |
dd98794f7d8c
patch 8.2.3155: some option related code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
45 setglobal textwidth& |
dd98794f7d8c
patch 8.2.3155: some option related code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
46 endfunc |
dd98794f7d8c
patch 8.2.3155: some option related code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
47 |
21765
08940efa6b4e
patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents:
7426
diff
changeset
|
48 " vim: shiftwidth=2 sts=2 expandtab |