MCPcopy Index your code
hub / github.com/ipython/ipython / test_line_split

Function test_line_split

tests/test_completer.py:217–238  ·  view source on GitHub ↗

Basic line splitter test with default specs.

()

Source from the content-addressed store, hash-verified

215
216
217def test_line_split():
218 """Basic line splitter test with default specs."""
219 sp = completer.CompletionSplitter()
220 # The format of the test specs is: part1, part2, expected answer. Parts 1
221 # and 2 are joined into the 'line' sent to the splitter, as if the cursor
222 # was at the end of part1. So an empty part2 represents someone hitting
223 # tab at the end of the line, the most common case.
224 t = [
225 ("run some/script", "", "some/script"),
226 ("run scripts/er", "ror.py foo", "scripts/er"),
227 ("echo $HOM", "", "HOM"),
228 ("print sys.pa", "", "sys.pa"),
229 ("print(sys.pa", "", "sys.pa"),
230 ("execfile('scripts/er", "", "scripts/er"),
231 ("a[x.", "", "x."),
232 ("a[x.", "y", "x."),
233 ('cd "some_file/', "", "some_file/"),
234 ]
235 check_line_split(sp, t)
236 # Ensure splitting works OK with unicode by re-running the tests with
237 # all inputs turned into unicode
238 check_line_split(sp, [map(str, p) for p in t])
239
240
241class NamedInstanceClass:

Callers

nothing calls this directly

Calls 1

check_line_splitFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…