summaryrefslogtreecommitdiffstats
path: root/src/testdir/test69.in
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-06 02:44:24 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-06 02:44:24 +0000
commit8baab3c8d7a6f22888bd581cd5c6098fd2e4b5a8 (patch)
tree3537e168b860f2742f6029d70501b5ed7d15d345 /src/testdir/test69.in
parentInitial commit. (diff)
downloadvim-8baab3c8d7a6f22888bd581cd5c6098fd2e4b5a8.tar.xz
vim-8baab3c8d7a6f22888bd581cd5c6098fd2e4b5a8.zip
Adding upstream version 2:8.1.0875.upstream/2%8.1.0875upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--src/testdir/test69.in192
1 files changed, 192 insertions, 0 deletions
diff --git a/src/testdir/test69.in b/src/testdir/test69.in
new file mode 100644
index 0000000..2510c12
--- /dev/null
+++ b/src/testdir/test69.in
@@ -0,0 +1,192 @@
+Test for multi-byte text formatting.
+Also test, that 'mps' with multibyte chars works.
+And test "ra" on multi-byte characters.
+Also test byteidx() and byteidxcomp()
+
+STARTTEST
+:so mbyte.vim
+:set encoding=utf-8
+ENDTEST
+
+Results of test69:
+
+STARTTEST
+/^{/+1
+:set tw=2 fo=t
+gqgqjgqgqo
+XYZ
+abc XYZ
+ENDTEST
+
+{
+XYZ
+abc XYZ
+}
+
+STARTTEST
+/^{/+1
+:set tw=1 fo=tm
+gqgqjgqgqjgqgqjgqgqjgqgqo
+X
+Xa
+X a
+XY
+X Y
+ENDTEST
+
+{
+X
+Xa
+X a
+XY
+X Y
+}
+
+STARTTEST
+/^{/+1
+:set tw=2 fo=tm
+gqgqjgqgqjgqgqjgqgqjgqgqjgqgqjgqgqjgqgqjgqgqjgqgqo
+X
+Xa
+X a
+XY
+X Y
+aX
+abX
+abcX
+abX c
+abXY
+ENDTEST
+
+{
+X
+Xa
+X a
+XY
+X Y
+aX
+abX
+abcX
+abX c
+abXY
+}
+
+STARTTEST
+/^{/+1
+:set ai tw=2 fo=tm
+gqgqjgqgqo
+X
+Xa
+ENDTEST
+
+{
+ X
+ Xa
+}
+
+STARTTEST
+/^{/+1
+:set noai tw=2 fo=tm
+gqgqjgqgqo
+ X
+ Xa
+ENDTEST
+
+{
+ X
+ Xa
+}
+
+STARTTEST
+/^{/+1
+:set tw=2 fo=cqm comments=n:X
+gqgqjgqgqjgqgqjgqgqjgqgqjgqgqjgqgqjgqgqjgqgqjgqgqo
+X
+Xa
+XaY
+XY
+XYZ
+X Y
+X YZ
+XX
+XXa
+XXY
+ENDTEST
+
+{
+X
+Xa
+XaY
+XY
+XYZ
+X Y
+X YZ
+XX
+XXa
+XXY
+}
+
+STARTTEST
+/^{/+1
+:set tw=2 fo=tm
+RXa
+ENDTEST
+
+{
+
+}
+
+STARTTEST
+/^{/+1
+:set mps+=u2018:u2019
+d%
+ENDTEST
+
+{
+‘ two three ’ four
+}
+STARTTEST
+/^ra test
+jVjra
+ENDTEST
+
+ra test
+abba
+aab
+
+STARTTEST
+:set whichwrap+=h
+/^x
+dh
+:set whichwrap-=h
+ENDTEST
+
+x
+
+STARTTEST
+:let a = '.é.' " one char of two bytes
+:let b = '.é.' " normal e with composing char
+/^byteidx
+:put =string([byteidx(a, 0), byteidx(a, 1), byteidx(a, 2), byteidx(a, 3), byteidx(a, 4)])
+:put =string([byteidx(b, 0), byteidx(b, 1), byteidx(b, 2), byteidx(b, 3), byteidx(b, 4)])
+/^byteidxcomp
+:put =string([byteidxcomp(a, 0), byteidxcomp(a, 1), byteidxcomp(a, 2), byteidxcomp(a, 3), byteidxcomp(a, 4)])
+:let b = '.é.'
+:put =string([byteidxcomp(b, 0), byteidxcomp(b, 1), byteidxcomp(b, 2), byteidxcomp(b, 3), byteidxcomp(b, 4), byteidxcomp(b, 5)])
+ENDTEST
+
+byteidx
+byteidxcomp
+
+STARTTEST
+/^substitute
+:let y = substitute('123', '\zs', 'a', 'g') | put =y
+ENDTEST
+
+substitute
+
+STARTTEST
+:g/^STARTTEST/.,/^ENDTEST/d
+:1;/^Results/,$wq! test.out
+ENDTEST