()
| 160 | |
| 161 | |
| 162 | def test_crop(): |
| 163 | content = [ |
| 164 | Strip([Segment("foo")]), |
| 165 | Strip([Segment("bar")]), |
| 166 | Strip([Segment("baz")]), |
| 167 | ] |
| 168 | styles = Styles() |
| 169 | styles.padding = 1 |
| 170 | styles.border = ("heavy", "white") |
| 171 | cache = StylesCache() |
| 172 | lines = cache.render( |
| 173 | styles, |
| 174 | Size(7, 7), |
| 175 | Color.parse("blue"), |
| 176 | Color.parse("green"), |
| 177 | content.__getitem__, |
| 178 | [], |
| 179 | None, |
| 180 | None, |
| 181 | content_size=Size(3, 3), |
| 182 | crop=Region(2, 2, 3, 3), |
| 183 | ) |
| 184 | text_content = _extract_content(lines) |
| 185 | expected_text = [ |
| 186 | "foo", |
| 187 | "bar", |
| 188 | "baz", |
| 189 | ] |
| 190 | assert text_content == expected_text |
| 191 | |
| 192 | |
| 193 | def test_dirty_cache() -> None: |
nothing calls this directly
no test coverage detected
searching dependent graphs…