summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2017-04-20 16:18:49 +0100
committerMaxime Coste <mawww@kakoune.org>2017-04-20 16:18:49 +0100
commitdbcddafbfdc8808e8823812b1a5c40d4aedcdf90 (patch)
treef849d94304e2fbc064741bdaf3d45f93fd89da67 /test
parent30e6387071b6aee2239d155822091dc834090b7f (diff)
Change utf8::to_next/to_previous so that they are more symetrical
The previous implementation could yield different positions when iterating forward and backward, leading to confusion in boost regex. This makes an existing problem a bit more visible: iterating with to_next and with read_codepoint wont behave the same way, as read_codepoint will put the iterator onto the byte following the utf8 codepoint, whereas to_next will put it on the next utf8 character start byte, which might be different if the buffer content is not valid utf8. Fixes #1195
Diffstat (limited to 'test')
-rw-r--r--test/regression/1195-infinite-loop-in-regex-matching/cmd1
-rw-r--r--test/regression/1195-infinite-loop-in-regex-matching/in1
-rw-r--r--test/regression/1195-infinite-loop-in-regex-matching/out1
-rw-r--r--test/regression/1195-infinite-loop-in-regex-matching/rc2
4 files changed, 5 insertions, 0 deletions
diff --git a/test/regression/1195-infinite-loop-in-regex-matching/cmd b/test/regression/1195-infinite-loop-in-regex-matching/cmd
new file mode 100644
index 00000000..8b137891
--- /dev/null
+++ b/test/regression/1195-infinite-loop-in-regex-matching/cmd
@@ -0,0 +1 @@
+
diff --git a/test/regression/1195-infinite-loop-in-regex-matching/in b/test/regression/1195-infinite-loop-in-regex-matching/in
new file mode 100644
index 00000000..21611d1a
--- /dev/null
+++ b/test/regression/1195-infinite-loop-in-regex-matching/in
@@ -0,0 +1 @@
+g `)kW!l)v RjWWq/.h3bάOa=~Nuù{GqTYFf#B- w]< c7JٻGsjImt 7q 2j3= U*S91;=MMJ^r>eUtU,qswUy3͊]A3iْ.nDD$:r8fb;z fJ
diff --git a/test/regression/1195-infinite-loop-in-regex-matching/out b/test/regression/1195-infinite-loop-in-regex-matching/out
new file mode 100644
index 00000000..21611d1a
--- /dev/null
+++ b/test/regression/1195-infinite-loop-in-regex-matching/out
@@ -0,0 +1 @@
+g `)kW!l)v RjWWq/.h3bάOa=~Nuù{GqTYFf#B- w]< c7JٻGsjImt 7q 2j3= U*S91;=MMJ^r>eUtU,qswUy3͊]A3iْ.nDD$:r8fb;z fJ
diff --git a/test/regression/1195-infinite-loop-in-regex-matching/rc b/test/regression/1195-infinite-loop-in-regex-matching/rc
new file mode 100644
index 00000000..d13cd29c
--- /dev/null
+++ b/test/regression/1195-infinite-loop-in-regex-matching/rc
@@ -0,0 +1,2 @@
+add-highlighter regions -default code -match-capture sh \
+ heredoc '<<-?(\w+)' '^\t*(\w+)$' ''