Show More
@@ -4,7 +4,7 b'' | |||
|
4 | 4 | |
|
5 | 5 | import nose.tools as nt |
|
6 | 6 | |
|
7 | from IPython.utils.tokenutil import token_at_cursor | |
|
7 | from IPython.utils.tokenutil import token_at_cursor, line_at_cursor | |
|
8 | 8 | |
|
9 | 9 | def expect_token(expected, cell, cursor_pos): |
|
10 | 10 | token = token_at_cursor(cell, cursor_pos) |
@@ -68,3 +68,9 b' def test_attrs():' | |||
|
68 | 68 | expected = 'obj.attr.subattr' |
|
69 | 69 | for i in range(idx, len(cell)): |
|
70 | 70 | expect_token(expected, cell, i) |
|
71 | ||
|
72 | def test_line_at_cursor(): | |
|
73 | cell = "" | |
|
74 | (line, offset) = line_at_cursor(cell, cursor_pos=11) | |
|
75 | assert line == "", ("Expected '', got %r" % line) | |
|
76 | assert offset == 0, ("Expected '', got %r" % line) |
General Comments 0
You need to be logged in to leave comments.
Login now