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