Show More
@@ -13,7 +13,7 b' def expect_token(expected, cell, cursor_pos):' | |||
|
13 | 13 | if offset + len(line) >= cursor_pos: |
|
14 | 14 | break |
|
15 | 15 | else: |
|
16 | offset += len(line) | |
|
16 | offset += len(line)+1 | |
|
17 | 17 | column = cursor_pos - offset |
|
18 | 18 | line_with_cursor = '%s|%s' % (line[:column], line[column:]) |
|
19 | 19 | nt.assert_equal(token, expected, |
@@ -88,3 +88,15 b' def test_line_at_cursor():' | |||
|
88 | 88 | (line, offset) = line_at_cursor(cell, cursor_pos=11) |
|
89 | 89 | assert line == "", ("Expected '', got %r" % line) |
|
90 | 90 | assert offset == 0, ("Expected '', got %r" % line) |
|
91 | ||
|
92 | def test_muliline_statement(): | |
|
93 | cell = """a = (1, | |
|
94 | 3) | |
|
95 | ||
|
96 | int() | |
|
97 | map() | |
|
98 | """ | |
|
99 | for c in range(16, 22): | |
|
100 | yield lambda: expect_token("int", cell, c) | |
|
101 | for c in range(22, 28): | |
|
102 | yield lambda: expect_token("map", cell, c) |
General Comments 0
You need to be logged in to leave comments.
Login now