summaryrefslogtreecommitdiff
path: root/pylint/test/unittest_checker_strings.py
diff options
context:
space:
mode:
Diffstat (limited to 'pylint/test/unittest_checker_strings.py')
-rw-r--r--pylint/test/unittest_checker_strings.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/pylint/test/unittest_checker_strings.py b/pylint/test/unittest_checker_strings.py
index 57dc0af8d..4cac73747 100644
--- a/pylint/test/unittest_checker_strings.py
+++ b/pylint/test/unittest_checker_strings.py
@@ -10,6 +10,28 @@ from pylint.checkers import strings
from pylint.testutils import CheckerTestCase, Message
+TEST_TOKENS = (
+ '"X"',
+ "'X'",
+ "'''X'''",
+ '"""X"""',
+ 'r"X"',
+ "R'X'",
+ 'u"X"',
+ "F'X'",
+ 'f"X"',
+ "F'X'",
+ 'fr"X"',
+ 'Fr"X"',
+ 'fR"X"',
+ 'FR"X"',
+ 'rf"X"',
+ 'rF"X"',
+ 'Rf"X"',
+ 'RF"X"',
+)
+
+
class TestStringChecker(CheckerTestCase):
CHECKER_CLASS = strings.StringFormatChecker
@@ -58,3 +80,7 @@ class TestStringChecker(CheckerTestCase):
)
):
self.checker.visit_binop(node)
+
+ def test_str_eval(self):
+ for token in TEST_TOKENS:
+ assert strings.str_eval(token) == "X"