mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
* canvas * imports * more box drawing * lines * lines * box drawing table * fix box table * tweak test * canvas color * simplify canvas * optimization * clipping * render experiment * keyline css * tests * don't draw around invisible widgets * optimize * snapshot test * docs and examples * tab size * disclaimer * docs * changelog * snapshots * accidental add * rename for consistency * simplify color * docstrings * comment * snapshots * micro optimize * micro-optimization * typing * set over list * remove comment * docstring * punctuation * Update docs/styles/keyline.md Co-authored-by: Darren Burns <darrenburns@users.noreply.github.com> --------- Co-authored-by: Darren Burns <darrenburns@users.noreply.github.com>
26 lines
905 B
Python
26 lines
905 B
Python
import pytest
|
|
|
|
from textual._box_drawing import combine_quads
|
|
|
|
|
|
@pytest.mark.parametrize(
|
|
"quad1, quad2, expected",
|
|
[
|
|
((0, 0, 0, 0), (0, 0, 0, 0), (0, 0, 0, 0)),
|
|
((0, 0, 0, 1), (0, 0, 0, 0), (0, 0, 0, 1)),
|
|
((0, 0, 0, 1), (0, 0, 0, 1), (0, 0, 0, 1)),
|
|
((0, 0, 0, 2), (0, 0, 0, 1), (0, 0, 0, 1)),
|
|
((0, 0, 0, 2), (1, 2, 3, 0), (1, 2, 3, 2)),
|
|
((0, 1, 0, 2), (1, 0, 3, 0), (1, 1, 3, 2)),
|
|
# Repeating to check cached values
|
|
((0, 0, 0, 0), (0, 0, 0, 0), (0, 0, 0, 0)),
|
|
((0, 0, 0, 1), (0, 0, 0, 0), (0, 0, 0, 1)),
|
|
((0, 0, 0, 1), (0, 0, 0, 1), (0, 0, 0, 1)),
|
|
((0, 0, 0, 2), (0, 0, 0, 1), (0, 0, 0, 1)),
|
|
((0, 0, 0, 2), (1, 2, 3, 0), (1, 2, 3, 2)),
|
|
((0, 1, 0, 2), (1, 0, 3, 0), (1, 1, 3, 2)),
|
|
],
|
|
)
|
|
def test_box_combine_quads(quad1, quad2, expected):
|
|
assert combine_quads(quad1, quad2) == expected
|