Mercurial > vim
annotate src/testdir/test_expr_utf8.vim @ 33988:7c30841c60a0 v9.0.2180
patch 9.0.2180: POSIX function name in exarg causes issues
Commit: https://github.com/vim/vim/commit/6fdb6280821a822768df5689a5d727e37d38306c
Author: Zoltan Arpadffy <zoltan.arpadffy@gmail.com>
Date: Tue Dec 19 20:53:07 2023 +0100
patch 9.0.2180: POSIX function name in exarg causes issues
Problem: POSIX function name in exarg struct causes issues
on OpenVMS
Solution: Rename getline member in exarg struct to ea_getline,
remove isinf() workaround for VMS
There are compilers that do not treat well POSIX functions - like
getline - usage in the structs.
Older VMS compilers could digest this... but the newer OpenVMS compilers
( like VSI C x86-64 X7.4-843 (GEM 50XB9) ) cannot deal with these
structs. This could be limited to getline() that is defined via
getdelim() and might not affect all POSIX functions in general - but
avoiding POSIX function names usage in the structs is a "safe side"
practice without compromising the functionality or the code readability.
The previous OpenVMS X86 port used a workaround limiting the compiler
capabilities using __CRTL_VER_OVERRIDE=80400000
In order to make the OpenVMS port future proof, this pull request
proposes a possible solution.
closes: #13704
Signed-off-by: Zoltan Arpadffy <zoltan.arpadffy@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Tue, 19 Dec 2023 21:00:04 +0100 |
parents | 512f48dc7100 |
children |
rev | line source |
---|---|
8895
7f29248d5789
commit https://github.com/vim/vim/commit/0f518a8f4d4be4cac10389680f6bd5e3781f94b0
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1 " Tests for expressions using utf-8. |
7f29248d5789
commit https://github.com/vim/vim/commit/0f518a8f4d4be4cac10389680f6bd5e3781f94b0
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2 |
7f29248d5789
commit https://github.com/vim/vim/commit/0f518a8f4d4be4cac10389680f6bd5e3781f94b0
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
3 func Test_strgetchar() |
8909
6393ac6d7060
commit https://github.com/vim/vim/commit/b22bd46b9681d73d095f2eadff8163d3a6cf416b
Christian Brabandt <cb@256bit.org>
parents:
8895
diff
changeset
|
4 call assert_equal(char2nr('á'), strgetchar('áxb', 0)) |
6393ac6d7060
commit https://github.com/vim/vim/commit/b22bd46b9681d73d095f2eadff8163d3a6cf416b
Christian Brabandt <cb@256bit.org>
parents:
8895
diff
changeset
|
5 call assert_equal(char2nr('x'), strgetchar('áxb', 1)) |
8895
7f29248d5789
commit https://github.com/vim/vim/commit/0f518a8f4d4be4cac10389680f6bd5e3781f94b0
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
6 |
8909
6393ac6d7060
commit https://github.com/vim/vim/commit/b22bd46b9681d73d095f2eadff8163d3a6cf416b
Christian Brabandt <cb@256bit.org>
parents:
8895
diff
changeset
|
7 call assert_equal(char2nr('a'), strgetchar('àxb', 0)) |
6393ac6d7060
commit https://github.com/vim/vim/commit/b22bd46b9681d73d095f2eadff8163d3a6cf416b
Christian Brabandt <cb@256bit.org>
parents:
8895
diff
changeset
|
8 call assert_equal(char2nr('̀'), strgetchar('àxb', 1)) |
6393ac6d7060
commit https://github.com/vim/vim/commit/b22bd46b9681d73d095f2eadff8163d3a6cf416b
Christian Brabandt <cb@256bit.org>
parents:
8895
diff
changeset
|
9 call assert_equal(char2nr('x'), strgetchar('àxb', 2)) |
8911
460c8cc144f0
commit https://github.com/vim/vim/commit/5d18e0eca59ffbba22c7f7c91c9f99d672095728
Christian Brabandt <cb@256bit.org>
parents:
8909
diff
changeset
|
10 |
460c8cc144f0
commit https://github.com/vim/vim/commit/5d18e0eca59ffbba22c7f7c91c9f99d672095728
Christian Brabandt <cb@256bit.org>
parents:
8909
diff
changeset
|
11 call assert_equal(char2nr('あ'), strgetchar('あaい', 0)) |
460c8cc144f0
commit https://github.com/vim/vim/commit/5d18e0eca59ffbba22c7f7c91c9f99d672095728
Christian Brabandt <cb@256bit.org>
parents:
8909
diff
changeset
|
12 call assert_equal(char2nr('a'), strgetchar('あaい', 1)) |
460c8cc144f0
commit https://github.com/vim/vim/commit/5d18e0eca59ffbba22c7f7c91c9f99d672095728
Christian Brabandt <cb@256bit.org>
parents:
8909
diff
changeset
|
13 call assert_equal(char2nr('い'), strgetchar('あaい', 2)) |
8895
7f29248d5789
commit https://github.com/vim/vim/commit/0f518a8f4d4be4cac10389680f6bd5e3781f94b0
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
14 endfunc |
7f29248d5789
commit https://github.com/vim/vim/commit/0f518a8f4d4be4cac10389680f6bd5e3781f94b0
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
15 |
7f29248d5789
commit https://github.com/vim/vim/commit/0f518a8f4d4be4cac10389680f6bd5e3781f94b0
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
16 func Test_strcharpart() |
7f29248d5789
commit https://github.com/vim/vim/commit/0f518a8f4d4be4cac10389680f6bd5e3781f94b0
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
17 call assert_equal('áxb', strcharpart('áxb', 0)) |
7f29248d5789
commit https://github.com/vim/vim/commit/0f518a8f4d4be4cac10389680f6bd5e3781f94b0
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
18 call assert_equal('á', strcharpart('áxb', 0, 1)) |
7f29248d5789
commit https://github.com/vim/vim/commit/0f518a8f4d4be4cac10389680f6bd5e3781f94b0
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
19 call assert_equal('x', strcharpart('áxb', 1, 1)) |
7f29248d5789
commit https://github.com/vim/vim/commit/0f518a8f4d4be4cac10389680f6bd5e3781f94b0
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
20 |
8993
2085167ab1b0
commit https://github.com/vim/vim/commit/fca66003053f8c0da5161d1fe4b75b3a389934b5
Christian Brabandt <cb@256bit.org>
parents:
8911
diff
changeset
|
21 call assert_equal('いうeお', strcharpart('あいうeお', 1)) |
2085167ab1b0
commit https://github.com/vim/vim/commit/fca66003053f8c0da5161d1fe4b75b3a389934b5
Christian Brabandt <cb@256bit.org>
parents:
8911
diff
changeset
|
22 call assert_equal('い', strcharpart('あいうeお', 1, 1)) |
2085167ab1b0
commit https://github.com/vim/vim/commit/fca66003053f8c0da5161d1fe4b75b3a389934b5
Christian Brabandt <cb@256bit.org>
parents:
8911
diff
changeset
|
23 call assert_equal('いう', strcharpart('あいうeお', 1, 2)) |
2085167ab1b0
commit https://github.com/vim/vim/commit/fca66003053f8c0da5161d1fe4b75b3a389934b5
Christian Brabandt <cb@256bit.org>
parents:
8911
diff
changeset
|
24 call assert_equal('いうe', strcharpart('あいうeお', 1, 3)) |
2085167ab1b0
commit https://github.com/vim/vim/commit/fca66003053f8c0da5161d1fe4b75b3a389934b5
Christian Brabandt <cb@256bit.org>
parents:
8911
diff
changeset
|
25 call assert_equal('いうeお', strcharpart('あいうeお', 1, 4)) |
2085167ab1b0
commit https://github.com/vim/vim/commit/fca66003053f8c0da5161d1fe4b75b3a389934b5
Christian Brabandt <cb@256bit.org>
parents:
8911
diff
changeset
|
26 call assert_equal('eお', strcharpart('あいうeお', 3)) |
2085167ab1b0
commit https://github.com/vim/vim/commit/fca66003053f8c0da5161d1fe4b75b3a389934b5
Christian Brabandt <cb@256bit.org>
parents:
8911
diff
changeset
|
27 call assert_equal('e', strcharpart('あいうeお', 3, 1)) |
2085167ab1b0
commit https://github.com/vim/vim/commit/fca66003053f8c0da5161d1fe4b75b3a389934b5
Christian Brabandt <cb@256bit.org>
parents:
8911
diff
changeset
|
28 |
2085167ab1b0
commit https://github.com/vim/vim/commit/fca66003053f8c0da5161d1fe4b75b3a389934b5
Christian Brabandt <cb@256bit.org>
parents:
8911
diff
changeset
|
29 call assert_equal('あ', strcharpart('あいうeお', -3, 4)) |
2085167ab1b0
commit https://github.com/vim/vim/commit/fca66003053f8c0da5161d1fe4b75b3a389934b5
Christian Brabandt <cb@256bit.org>
parents:
8911
diff
changeset
|
30 |
8895
7f29248d5789
commit https://github.com/vim/vim/commit/0f518a8f4d4be4cac10389680f6bd5e3781f94b0
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
31 call assert_equal('a', strcharpart('àxb', 0, 1)) |
7f29248d5789
commit https://github.com/vim/vim/commit/0f518a8f4d4be4cac10389680f6bd5e3781f94b0
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
32 call assert_equal('̀', strcharpart('àxb', 1, 1)) |
7f29248d5789
commit https://github.com/vim/vim/commit/0f518a8f4d4be4cac10389680f6bd5e3781f94b0
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
33 call assert_equal('x', strcharpart('àxb', 2, 1)) |
24132
512f48dc7100
patch 8.2.2607: strcharpart() cannot include composing characters
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
34 |
512f48dc7100
patch 8.2.2607: strcharpart() cannot include composing characters
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
35 |
512f48dc7100
patch 8.2.2607: strcharpart() cannot include composing characters
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
36 call assert_equal('a', strcharpart('àxb', 0, 1, 0)) |
512f48dc7100
patch 8.2.2607: strcharpart() cannot include composing characters
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
37 call assert_equal('à', strcharpart('àxb', 0, 1, 1)) |
512f48dc7100
patch 8.2.2607: strcharpart() cannot include composing characters
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
38 call assert_equal('x', strcharpart('àxb', 1, 1, 1)) |
512f48dc7100
patch 8.2.2607: strcharpart() cannot include composing characters
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
39 |
512f48dc7100
patch 8.2.2607: strcharpart() cannot include composing characters
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
40 call assert_fails("let v = strcharpart('abc', 0, 0, [])", 'E745:') |
512f48dc7100
patch 8.2.2607: strcharpart() cannot include composing characters
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
41 call assert_fails("let v = strcharpart('abc', 0, 0, 2)", 'E1023:') |
8895
7f29248d5789
commit https://github.com/vim/vim/commit/0f518a8f4d4be4cac10389680f6bd5e3781f94b0
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
42 endfunc |
21765
08940efa6b4e
patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
43 |
08940efa6b4e
patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
44 " vim: shiftwidth=2 sts=2 expandtab |