r"""Asserts that self.func matches as described by s, which uses a little language to describe matches: abcd hijklmnopqrstuvwx|yz /|\ /|\ /|\ | | | the function should the current cursor position match th
(self, s)
| 79 | |
| 80 | class LineTestCase(unittest.TestCase): |
| 81 | def assertAccess(self, s): |
| 82 | r"""Asserts that self.func matches as described |
| 83 | by s, which uses a little language to describe matches: |
| 84 | |
| 85 | abcd<efg>hijklmnopqrstuvwx|yz |
| 86 | /|\ /|\ /|\ |
| 87 | | | | |
| 88 | the function should the current cursor position |
| 89 | match this "efg" is between the x and y |
| 90 | """ |
| 91 | (cursor_offset, line), match = decode(s) |
| 92 | result = self.func(cursor_offset, line) |
| 93 | |
| 94 | self.assertEqual( |
| 95 | result, |
| 96 | match, |
| 97 | "%s(%r) result\n%r (%r) doesn't match expected\n%r (%r)" |
| 98 | % ( |
| 99 | self.func.__name__, |
| 100 | line_with_cursor(cursor_offset, line), |
| 101 | encode(cursor_offset, line, result), |
| 102 | result, |
| 103 | s, |
| 104 | match, |
| 105 | ), |
| 106 | ) |
| 107 | |
| 108 | |
| 109 | class TestHelpers(LineTestCase): |
no test coverage detected