Show More
@@ -1,38 +1,38 b'' | |||
|
1 | 1 | # coding: utf-8 |
|
2 | import nose.tools as nt | |
|
3 | 2 | |
|
4 | 3 | from IPython.core.splitinput import split_user_input, LineInfo |
|
5 | 4 | from IPython.testing import tools as tt |
|
6 | 5 | |
|
7 | 6 | tests = [ |
|
8 |
( |
|
|
9 |
( |
|
|
10 |
( |
|
|
11 |
( |
|
|
12 |
( |
|
|
13 |
( |
|
|
14 |
( |
|
|
15 |
( |
|
|
16 |
( |
|
|
17 |
( |
|
|
18 |
( |
|
|
19 |
( |
|
|
20 |
( |
|
|
21 |
( |
|
|
22 |
( |
|
|
23 |
( |
|
|
24 |
( |
|
|
25 |
( |
|
|
26 |
( |
|
|
27 |
( |
|
|
28 |
( |
|
|
29 | ] | |
|
30 |
tests.append(( |
|
|
7 | ("x=1", ("", "", "x", "=1")), | |
|
8 | ("?", ("", "?", "", "")), | |
|
9 | ("??", ("", "??", "", "")), | |
|
10 | (" ?", (" ", "?", "", "")), | |
|
11 | (" ??", (" ", "??", "", "")), | |
|
12 | ("??x", ("", "??", "x", "")), | |
|
13 | ("?x=1", ("", "?", "x", "=1")), | |
|
14 | ("!ls", ("", "!", "ls", "")), | |
|
15 | (" !ls", (" ", "!", "ls", "")), | |
|
16 | ("!!ls", ("", "!!", "ls", "")), | |
|
17 | (" !!ls", (" ", "!!", "ls", "")), | |
|
18 | (",ls", ("", ",", "ls", "")), | |
|
19 | (";ls", ("", ";", "ls", "")), | |
|
20 | (" ;ls", (" ", ";", "ls", "")), | |
|
21 | ("f.g(x)", ("", "", "f.g", "(x)")), | |
|
22 | ("f.g (x)", ("", "", "f.g", "(x)")), | |
|
23 | ("?%hist1", ("", "?", "%hist1", "")), | |
|
24 | ("?%%hist2", ("", "?", "%%hist2", "")), | |
|
25 | ("??%hist3", ("", "??", "%hist3", "")), | |
|
26 | ("??%%hist4", ("", "??", "%%hist4", "")), | |
|
27 | ("?x*", ("", "?", "x*", "")), | |
|
28 | ] | |
|
29 | tests.append(("Pérez Fernando", ("", "", "Pérez", "Fernando"))) | |
|
30 | ||
|
31 | 31 | |
|
32 | 32 | def test_split_user_input(): |
|
33 | 33 | return tt.check_pairs(split_user_input, tests) |
|
34 | 34 | |
|
35 | 35 | def test_LineInfo(): |
|
36 | 36 | """Simple test for LineInfo construction and str()""" |
|
37 |
linfo = LineInfo( |
|
|
38 |
|
|
|
37 | linfo = LineInfo(" %cd /home") | |
|
38 | assert str(linfo) == "LineInfo [ |%|cd|/home]" |
General Comments 0
You need to be logged in to leave comments.
Login now