aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/tools/cython/Cython/Build/Tests/TestStripLiterals.py
diff options
context:
space:
mode:
authorAnton Samokhvalov <pg83@yandex.ru>2022-02-10 16:45:15 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:45:15 +0300
commit72cb13b4aff9bc9cf22e49251bc8fd143f82538f (patch)
treeda2c34829458c7d4e74bdfbdf85dff449e9e7fb8 /contrib/tools/cython/Cython/Build/Tests/TestStripLiterals.py
parent778e51ba091dc39e7b7fcab2b9cf4dbedfb6f2b5 (diff)
downloadydb-72cb13b4aff9bc9cf22e49251bc8fd143f82538f.tar.gz
Restoring authorship annotation for Anton Samokhvalov <pg83@yandex.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/tools/cython/Cython/Build/Tests/TestStripLiterals.py')
-rw-r--r--contrib/tools/cython/Cython/Build/Tests/TestStripLiterals.py110
1 files changed, 55 insertions, 55 deletions
diff --git a/contrib/tools/cython/Cython/Build/Tests/TestStripLiterals.py b/contrib/tools/cython/Cython/Build/Tests/TestStripLiterals.py
index a7572a5083..3f4261128f 100644
--- a/contrib/tools/cython/Cython/Build/Tests/TestStripLiterals.py
+++ b/contrib/tools/cython/Cython/Build/Tests/TestStripLiterals.py
@@ -1,57 +1,57 @@
-from Cython.Build.Dependencies import strip_string_literals
-
-from Cython.TestUtils import CythonTest
-
-class TestStripLiterals(CythonTest):
-
- def t(self, before, expected):
- actual, literals = strip_string_literals(before, prefix="_L")
+from Cython.Build.Dependencies import strip_string_literals
+
+from Cython.TestUtils import CythonTest
+
+class TestStripLiterals(CythonTest):
+
+ def t(self, before, expected):
+ actual, literals = strip_string_literals(before, prefix="_L")
self.assertEqual(expected, actual)
- for key, value in literals.items():
- actual = actual.replace(key, value)
+ for key, value in literals.items():
+ actual = actual.replace(key, value)
self.assertEqual(before, actual)
-
- def test_empty(self):
- self.t("", "")
-
- def test_single_quote(self):
- self.t("'x'", "'_L1_'")
-
- def test_double_quote(self):
- self.t('"x"', '"_L1_"')
-
- def test_nested_quotes(self):
- self.t(""" '"' "'" """, """ '_L1_' "_L2_" """)
-
- def test_triple_quote(self):
- self.t(" '''a\n''' ", " '''_L1_''' ")
-
- def test_backslash(self):
- self.t(r"'a\'b'", "'_L1_'")
- self.t(r"'a\\'", "'_L1_'")
- self.t(r"'a\\\'b'", "'_L1_'")
-
- def test_unicode(self):
- self.t("u'abc'", "u'_L1_'")
-
- def test_raw(self):
- self.t(r"r'abc\\'", "r'_L1_'")
-
- def test_raw_unicode(self):
- self.t(r"ru'abc\\'", "ru'_L1_'")
-
- def test_comment(self):
- self.t("abc # foo", "abc #_L1_")
-
- def test_comment_and_quote(self):
- self.t("abc # 'x'", "abc #_L1_")
- self.t("'abc#'", "'_L1_'")
-
- def test_include(self):
- self.t("include 'a.pxi' # something here",
- "include '_L1_' #_L2_")
-
- def test_extern(self):
- self.t("cdef extern from 'a.h': # comment",
- "cdef extern from '_L1_': #_L2_")
-
+
+ def test_empty(self):
+ self.t("", "")
+
+ def test_single_quote(self):
+ self.t("'x'", "'_L1_'")
+
+ def test_double_quote(self):
+ self.t('"x"', '"_L1_"')
+
+ def test_nested_quotes(self):
+ self.t(""" '"' "'" """, """ '_L1_' "_L2_" """)
+
+ def test_triple_quote(self):
+ self.t(" '''a\n''' ", " '''_L1_''' ")
+
+ def test_backslash(self):
+ self.t(r"'a\'b'", "'_L1_'")
+ self.t(r"'a\\'", "'_L1_'")
+ self.t(r"'a\\\'b'", "'_L1_'")
+
+ def test_unicode(self):
+ self.t("u'abc'", "u'_L1_'")
+
+ def test_raw(self):
+ self.t(r"r'abc\\'", "r'_L1_'")
+
+ def test_raw_unicode(self):
+ self.t(r"ru'abc\\'", "ru'_L1_'")
+
+ def test_comment(self):
+ self.t("abc # foo", "abc #_L1_")
+
+ def test_comment_and_quote(self):
+ self.t("abc # 'x'", "abc #_L1_")
+ self.t("'abc#'", "'_L1_'")
+
+ def test_include(self):
+ self.t("include 'a.pxi' # something here",
+ "include '_L1_' #_L2_")
+
+ def test_extern(self):
+ self.t("cdef extern from 'a.h': # comment",
+ "cdef extern from '_L1_': #_L2_")
+