From dd9b2bccde5d1f7feb82d819d730a61429df5dd1 Mon Sep 17 00:00:00 2001 From: Will McGugan Date: Tue, 22 Oct 2024 13:50:37 +0100 Subject: [PATCH] snapshot tests --- .../test_split_segments_infinite_loop.svg | 154 ++++++++++++++++++ .../snapshot_apps/split_segments.py | 2 +- tests/snapshot_tests/test_snapshots.py | 6 +- 3 files changed, 160 insertions(+), 2 deletions(-) create mode 100644 tests/snapshot_tests/__snapshots__/test_snapshots/test_split_segments_infinite_loop.svg diff --git a/tests/snapshot_tests/__snapshots__/test_snapshots/test_split_segments_infinite_loop.svg b/tests/snapshot_tests/__snapshots__/test_snapshots/test_split_segments_infinite_loop.svg new file mode 100644 index 0000000000..fb874be20f --- /dev/null +++ b/tests/snapshot_tests/__snapshots__/test_snapshots/test_split_segments_infinite_loop.svg @@ -0,0 +1,154 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + CodeApp + + + + + + + + + + ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▎ +1  x + + + + + + + + + + + + + + + + + + + + + +▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▎ + + + diff --git a/tests/snapshot_tests/snapshot_apps/split_segments.py b/tests/snapshot_tests/snapshot_apps/split_segments.py index cb80b63e84..9acb6fe28b 100644 --- a/tests/snapshot_tests/snapshot_apps/split_segments.py +++ b/tests/snapshot_tests/snapshot_apps/split_segments.py @@ -1,7 +1,7 @@ from textual.app import App, ComposeResult from textual.widgets import TextArea -FAIL_TEXT = "x " +FAIL_TEXT = "x" class CodeApp(App): diff --git a/tests/snapshot_tests/test_snapshots.py b/tests/snapshot_tests/test_snapshots.py index b184b9a247..019f49f505 100644 --- a/tests/snapshot_tests/test_snapshots.py +++ b/tests/snapshot_tests/test_snapshots.py @@ -2420,5 +2420,9 @@ def on_mount(self) -> None: def test_split_segments_infinite_loop(snap_compare): - """Regression test for https://github.com/Textualize/textual/issues/5151""" + """Regression test for https://github.com/Textualize/textual/issues/5151 + + Should be a bare-bones text editor containing "x" + + """ assert snap_compare(SNAPSHOT_APPS_DIR / "split_segments.py")