MCPcopy Create free account
hub / github.com/ipython/ipython / test_line_split

Function test_line_split

IPython/core/tests/test_completer.py:97–118  ·  view source on GitHub ↗

Basic line splitter test with default specs.

()

Source from the content-addressed store, hash-verified

95
96
97def test_line_split():
98 """Basic line splitter test with default specs."""
99 sp = completer.CompletionSplitter()
100 # The format of the test specs is: part1, part2, expected answer. Parts 1
101 # and 2 are joined into the 'line' sent to the splitter, as if the cursor
102 # was at the end of part1. So an empty part2 represents someone hitting
103 # tab at the end of the line, the most common case.
104 t = [
105 ("run some/scrip", "", "some/scrip"),
106 ("run scripts/er", "ror.py foo", "scripts/er"),
107 ("echo $HOM", "", "HOM"),
108 ("print sys.pa", "", "sys.pa"),
109 ("print(sys.pa", "", "sys.pa"),
110 ("execfile('scripts/er", "", "scripts/er"),
111 ("a[x.", "", "x."),
112 ("a[x.", "y", "x."),
113 ('cd "some_file/', "", "some_file/"),
114 ]
115 check_line_split(sp, t)
116 # Ensure splitting works OK with unicode by re-running the tests with
117 # all inputs turned into unicode
118 check_line_split(sp, [map(str, p) for p in t])
119
120
121class NamedInstanceMetaclass(type):

Callers

nothing calls this directly

Calls 1

check_line_splitFunction · 0.85

Tested by

no test coverage detected