Basic line splitter test with default specs.
()
| 215 | |
| 216 | |
| 217 | def 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 | |
| 241 | class NamedInstanceClass: |
nothing calls this directly
no test coverage detected
searching dependent graphs…