Remove newline test
This commit is contained in:
parent
1d9b60d733
commit
40a1c4a2d9
@ -97,7 +97,6 @@ foo\ x\x\"/foo xx"/foo\ x\x\"/
|
|||||||
'foo\ bar'/foo\ bar/'foo\ bar'/
|
'foo\ bar'/foo\ bar/'foo\ bar'/
|
||||||
'foo\\ bar'/foo\\ bar/'foo\\ bar'/
|
'foo\\ bar'/foo\\ bar/'foo\\ bar'/
|
||||||
foo\ bar/foo bar/foo\ bar/
|
foo\ bar/foo bar/foo\ bar/
|
||||||
foo#bar\nbaz/foo#bar|baz/foo#bar\n|baz/
|
|
||||||
:-) ;-)/:-)|;-)/:-) |;-)/
|
:-) ;-)/:-)|;-)/:-) |;-)/
|
||||||
áéíóú/áéíóú/áéíóú/
|
áéíóú/áéíóú/áéíóú/
|
||||||
"""
|
"""
|
||||||
@ -110,7 +109,6 @@ class SplitTests(unittest.TestCase):
|
|||||||
"""Test splitting."""
|
"""Test splitting."""
|
||||||
for case in test_data.strip().splitlines():
|
for case in test_data.strip().splitlines():
|
||||||
cmd, *out = case.split('/')[:-1]
|
cmd, *out = case.split('/')[:-1]
|
||||||
cmd = cmd.replace(r'\n', '\n')
|
|
||||||
with self.subTest(cmd=cmd):
|
with self.subTest(cmd=cmd):
|
||||||
items = split.split(cmd)
|
items = split.split(cmd)
|
||||||
self.assertEqual(items, out[0].split('|'))
|
self.assertEqual(items, out[0].split('|'))
|
||||||
@ -119,7 +117,6 @@ class SplitTests(unittest.TestCase):
|
|||||||
"""Test if splitting with keep=True yields the original string."""
|
"""Test if splitting with keep=True yields the original string."""
|
||||||
for case in test_data.strip().splitlines():
|
for case in test_data.strip().splitlines():
|
||||||
cmd, *_out = case.split('/')[:-1]
|
cmd, *_out = case.split('/')[:-1]
|
||||||
cmd = cmd.replace(r'\n', '\n')
|
|
||||||
with self.subTest(cmd=cmd):
|
with self.subTest(cmd=cmd):
|
||||||
items = split.split(cmd, keep=True)
|
items = split.split(cmd, keep=True)
|
||||||
self.assertEqual(''.join(items), cmd)
|
self.assertEqual(''.join(items), cmd)
|
||||||
@ -128,7 +125,6 @@ class SplitTests(unittest.TestCase):
|
|||||||
"""Test splitting with keep=True."""
|
"""Test splitting with keep=True."""
|
||||||
for case in test_data.strip().splitlines():
|
for case in test_data.strip().splitlines():
|
||||||
cmd, *out = case.split('/')[:-1]
|
cmd, *out = case.split('/')[:-1]
|
||||||
cmd = cmd.replace(r'\n', '\n')
|
|
||||||
with self.subTest(cmd=cmd):
|
with self.subTest(cmd=cmd):
|
||||||
items = split.split(cmd, keep=True)
|
items = split.split(cmd, keep=True)
|
||||||
self.assertEqual(items, out[1].split('|'))
|
self.assertEqual(items, out[1].split('|'))
|
||||||
|
@ -35,7 +35,7 @@ class ShellLexer:
|
|||||||
|
|
||||||
def __init__(self, s):
|
def __init__(self, s):
|
||||||
self.iterator = iter(s)
|
self.iterator = iter(s)
|
||||||
self.whitespace = ' \t\r\n'
|
self.whitespace = ' \t\r'
|
||||||
self.quotes = '\'"'
|
self.quotes = '\'"'
|
||||||
self.escape = '\\'
|
self.escape = '\\'
|
||||||
self.escapedquotes = '"'
|
self.escapedquotes = '"'
|
||||||
|
Loading…
Reference in New Issue
Block a user