()
| 103 | expect_token(expected, cell, i) |
| 104 | |
| 105 | def test_line_at_cursor(): |
| 106 | cell = "" |
| 107 | (line, offset) = line_at_cursor(cell, cursor_pos=11) |
| 108 | nt.assert_equal(line, "") |
| 109 | nt.assert_equal(offset, 0) |
| 110 | |
| 111 | # The position after a newline should be the start of the following line. |
| 112 | cell = "One\nTwo\n" |
| 113 | (line, offset) = line_at_cursor(cell, cursor_pos=4) |
| 114 | nt.assert_equal(line, "Two\n") |
| 115 | nt.assert_equal(offset, 4) |
| 116 | |
| 117 | # The end of a cell should be on the last line |
| 118 | cell = "pri\npri" |
| 119 | (line, offset) = line_at_cursor(cell, cursor_pos=7) |
| 120 | nt.assert_equal(line, "pri") |
| 121 | nt.assert_equal(offset, 4) |
| 122 | |
| 123 | def test_multiline_statement(): |
| 124 | cell = """a = (1, |
nothing calls this directly
no test coverage detected