aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libpathod/rparse.py2
-rw-r--r--test/test_rparse.py6
2 files changed, 6 insertions, 2 deletions
diff --git a/libpathod/rparse.py b/libpathod/rparse.py
index e71265ea..9d0f7e79 100644
--- a/libpathod/rparse.py
+++ b/libpathod/rparse.py
@@ -165,7 +165,7 @@ class FileGenerator:
class _Value:
def __init__(self, val):
- self.val = val
+ self.val = val.decode("string_escape")
def get_generator(self, settings):
return LiteralGenerator(self.val)
diff --git a/test/test_rparse.py b/test/test_rparse.py
index dfc8c758..11c831c6 100644
--- a/test/test_rparse.py
+++ b/test/test_rparse.py
@@ -40,7 +40,11 @@ class TestMisc:
def test_valueliteral(self):
v = rparse.ValueLiteral("foo")
assert v.expr()
- assert str(v)
+ assert v.val == "foo"
+
+ v = rparse.ValueLiteral(r"foo\n")
+ assert v.expr()
+ assert v.val == "foo\n"
def test_valuenakedliteral(self):
v = rparse.ValueNakedLiteral("foo")