diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2023-09-19 11:36:47 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2023-09-19 11:38:03 +0200 |
commit | 49c52823b0c802e0fc8e4f18d517f766f7f43cfc (patch) | |
tree | 1fc7872996b880df1a15e497d5cda19862477cb0 /tests/test_string.py | |
parent | Work on making program ready for packaging. (diff) | |
download | rainbow-parenthesis-49c52823b0c802e0fc8e4f18d517f766f7f43cfc.tar.gz rainbow-parenthesis-49c52823b0c802e0fc8e4f18d517f766f7f43cfc.tar.xz |
Fix backslashes "eating" their next character.
Since we are working with literal characters, than a backslash shouldn't
be removed when esacping a character. The current (and excpeted)
functionallity is that the backslash should escape the next character,
but print both.
Also added tests for this.
Diffstat (limited to '')
-rw-r--r-- | tests/test_string.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/test_string.py b/tests/test_string.py new file mode 100644 index 0000000..5d3040b --- /dev/null +++ b/tests/test_string.py @@ -0,0 +1,6 @@ +from rainbow_parenthesis import colorize, Colored +import io + + +def test_escaped_parenthesis(): + assert list(r"\(") == list(colorize(io.StringIO(r"\("))) |