File: 0009-Fix-syntax-warnings-about-invalid-escape-sequences-i.patch

package info (click to toggle)
vim-ultisnips 3.2-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,924 kB
  • sloc: python: 8,353; sh: 64; makefile: 38
file content (146 lines) | stat: -rw-r--r-- 5,933 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
From a5659402849c3e95241a31fe1f6402a4cd276c9b Mon Sep 17 00:00:00 2001
From: Nicholas Guriev <nicholas@guriev.su>
Date: Thu, 13 Nov 2025 15:23:13 +0300
Subject: Fix syntax warnings about invalid escape sequences in tests

Based on upstream commit 79b063ac44eb5a9c28129bc3837fef789a3190fa.
---
 test/test_Autocommands.py   |  4 ++--
 test/test_Interpolation.py  |  2 +-
 test/test_ParseSnippets.py  |  6 +++---
 test/test_SnippetOptions.py |  2 +-
 test/test_Transformation.py | 10 +++++-----
 test/test_UltiSnipFunc.py   |  2 +-
 6 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/test/test_Autocommands.py b/test/test_Autocommands.py
index c7d941f..1e2e572 100644
--- a/test/test_Autocommands.py
+++ b/test/test_Autocommands.py
@@ -16,9 +16,9 @@ class Autocommands(_VimTest):
         + JF
         + " done "
         + ESC
-        + ':execute "normal aM" . g:mapper_call_count . "\<Esc>"'
+        + ':execute "normal aM" . g:mapper_call_count . "\\<Esc>"'
         + "\n"
-        + ':execute "normal aU" . g:unmapper_call_count . "\<Esc>"'
+        + ':execute "normal aU" . g:unmapper_call_count . "\\<Esc>"'
         + "\n"
     )
     wanted = "[ [ bar ] ] done M1U1"
diff --git a/test/test_Interpolation.py b/test/test_Interpolation.py
index 382650a..1e80f2c 100644
--- a/test/test_Interpolation.py
+++ b/test/test_Interpolation.py
@@ -494,7 +494,7 @@ class PythonCode_CanOverwriteTabstop(_VimTest):
         """$1`!p if len(t[1]) > 3 and len(t[2]) == 0:
             t[2] = t[1][2:];
             t[1] = t[1][:2] + '-\\n\\t';
-            vim.command('call feedkeys("\<End>", "n")');
+            vim.command('call feedkeys("\\\\<End>", "n")');
             `$2""",
     )
     keys = "test" + EX + "blah" + ", bah"
diff --git a/test/test_ParseSnippets.py b/test/test_ParseSnippets.py
index 14793a4..5f98745 100644
--- a/test/test_ParseSnippets.py
+++ b/test/test_ParseSnippets.py
@@ -220,7 +220,7 @@ class ParseSnippets_MultiWord_NoContainer(_VimTest):
     }
     keys = "test snip" + EX
     wanted = keys
-    expected_error = "Invalid multiword trigger: 'test snip' in \S+:2"
+    expected_error = "Invalid multiword trigger: 'test snip' in \\S+:2"
 
 
 class ParseSnippets_MultiWord_UnmatchedContainer(_VimTest):
@@ -233,7 +233,7 @@ class ParseSnippets_MultiWord_UnmatchedContainer(_VimTest):
     }
     keys = "inv snip" + EX
     wanted = keys
-    expected_error = "Invalid multiword trigger: '!inv snip/' in \S+:2"
+    expected_error = "Invalid multiword trigger: '!inv snip/' in \\S+:2"
 
 
 class ParseSnippets_Global_Python(_VimTest):
@@ -299,7 +299,7 @@ class ParseSnippets_PrintPythonStacktraceMultiline(_VimTest):
     }
     keys = "test" + EX
     wanted = keys
-    expected_error = " > \s+qwe"
+    expected_error = " > \\s+qwe"
 
 
 class ParseSnippets_PrintErroneousSnippet(_VimTest):
diff --git a/test/test_SnippetOptions.py b/test/test_SnippetOptions.py
index 7e612b3..4f610c6 100644
--- a/test/test_SnippetOptions.py
+++ b/test/test_SnippetOptions.py
@@ -219,7 +219,7 @@ class SnippetOptions_Regex_Multiple(_VimTest):
 
 
 class _Regex_Self(_VimTest):
-    snippets = ("((?<=\W)|^)(\.)", "self.", "", "r")
+    snippets = ("((?<=\\W)|^)(\\.)", "self.", "", "r")
 
 
 class SnippetOptions_Regex_Self_Start(_Regex_Self):
diff --git a/test/test_Transformation.py b/test/test_Transformation.py
index d6f21e2..444d0be 100644
--- a/test/test_Transformation.py
+++ b/test/test_Transformation.py
@@ -29,7 +29,7 @@ class Transformation_SimpleCaseTransformInFrontDefVal_ECR(_VimTest):
 
 
 class Transformation_MultipleTransformations_ECR(_VimTest):
-    snippets = ("test", "${1:Some Text}${1/.+/\\U$0\E/}\n${1/.+/\L$0\E/}")
+    snippets = ("test", "${1:Some Text}${1/.+/\\U$0\\E/}\n${1/.+/\\L$0\\E/}")
     keys = "test" + EX + "SomE tExt "
     wanted = "SomE tExt SOME TEXT \nsome text "
 
@@ -89,19 +89,19 @@ class Transformation_CleverTransformUpercaseChar_ExpectCorrectResult(_VimTest):
 
 
 class Transformation_CleverTransformLowercaseChar_ExpectCorrectResult(_VimTest):
-    snippets = ("test", "$1 ${1/(.*)/\l$1/}")
+    snippets = ("test", "$1 ${1/(.*)/\\l$1/}")
     keys = "test" + EX + "Hallo"
     wanted = "Hallo hallo"
 
 
 class Transformation_CleverTransformLongUpper_ExpectCorrectResult(_VimTest):
-    snippets = ("test", "$1 ${1/(.*)/\\U$1\E/}")
+    snippets = ("test", "$1 ${1/(.*)/\\U$1\\E/}")
     keys = "test" + EX + "hallo"
     wanted = "hallo HALLO"
 
 
 class Transformation_CleverTransformLongLower_ExpectCorrectResult(_VimTest):
-    snippets = ("test", "$1 ${1/(.*)/\L$1\E/}")
+    snippets = ("test", "$1 ${1/(.*)/\\L$1\\E/}")
     keys = "test" + EX + "HALLO"
     wanted = "HALLO hallo"
 
@@ -115,7 +115,7 @@ class Transformation_SimpleCaseAsciiResult(_VimTest):
 
 class Transformation_LowerCaseAsciiResult(_VimTest):
     skip_if = lambda self: no_unidecode_available()
-    snippets = ("ascii", "$1 ${1/(.*)/\L$1\E/a}")
+    snippets = ("ascii", "$1 ${1/(.*)/\\L$1\\E/a}")
     keys = "ascii" + EX + "éèàçôïÉÈÀÇÔÏ€"
     wanted = "éèàçôïÉÈÀÇÔÏ€ eeacoieeacoieur"
 
diff --git a/test/test_UltiSnipFunc.py b/test/test_UltiSnipFunc.py
index 0caf03e..029a5d4 100644
--- a/test/test_UltiSnipFunc.py
+++ b/test/test_UltiSnipFunc.py
@@ -86,7 +86,7 @@ hi4"""
 
     def _before_test(self):
         self.vim.send_to_vim(
-            ":set langmap=йq,цw,уe,кr,еt,нy,гu,шi,щo,зp,х[,ъ],фa,ыs,вd,аf,пg,рh,оj,лk,дl,ж\\;,э',яz,чx,сc,мv,иb,тn,ьm,ю.,ё',ЙQ,ЦW,УE,КR,ЕT,НY,ГU,ШI,ЩO,ЗP,Х\{,Ъ\},ФA,ЫS,ВD,АF,ПG,РH,ОJ,ЛK,ДL,Ж\:,Э\",ЯZ,ЧX,СC,МV,ИB,ТN,ЬM,Б\<,Ю\>\n"
+            ":set langmap=йq,цw,уe,кr,еt,нy,гu,шi,щo,зp,х[,ъ],фa,ыs,вd,аf,пg,рh,оj,лk,дl,ж\\;,э',яz,чx,сc,мv,иb,тn,ьm,ю.,ё',ЙQ,ЦW,УE,КR,ЕT,НY,ГU,ШI,ЩO,ЗP,Х\\{,Ъ\\},ФA,ЫS,ВD,АF,ПG,РH,ОJ,ЛK,ДL,Ж\\:,Э\",ЯZ,ЧX,СC,МV,ИB,ТN,ЬM,Б\\<,Ю\\>\n"
         )