aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authoruser <user@clank>2026-08-27 15:17:48 +0200
committeruser <user@clank>2026-08-27 15:17:48 +0200
commit7ceb4e1492922fc33d0f9d13d01eec72bfda2363 (patch)
treef45fe0d7c953883fcc00f43c774207845850ea50 /tests
parentselection: drag past an edge scrolls the viewport under it (diff)
downloadslosh-7ceb4e1492922fc33d0f9d13d01eec72bfda2363.tar.gz
slosh-7ceb4e1492922fc33d0f9d13d01eec72bfda2363.tar.xz
slosh-7ceb4e1492922fc33d0f9d13d01eec72bfda2363.zip
test_splash: 'landed' is the row in its final form
The h-centered check raced the assembly it was measuring. landed_row() answered as soon as one occurrence of the opening run had a block glyph at its start -- but the logo's first line contains that run three times, assembly is staggered, and under a parallel suite's load the middle section can finish whole checks before the leftmost. The test then measured a middle occurrence's x (24) and called the logo off-centre. The row is 'landed' when all three occurrences are present -- its final form -- and the first block glyph is still required to sit where the match begins, so a particle passing to the left keeps us waiting rather than shifting the answer.
Diffstat (limited to 'tests')
-rw-r--r--tests/test_splash.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/tests/test_splash.py b/tests/test_splash.py
index efbd7ec..2e01cd4 100644
--- a/tests/test_splash.py
+++ b/tests/test_splash.py
@@ -40,11 +40,15 @@ def test_the_splash_assembles_centered_and_goes_away():
# The logo's first line contains its opening run three times over, and
# assembly is staggered, so a middle occurrence can land before the
- # leftmost: "assembled" is the row whose *first* block glyph is where
- # the match begins.
+ # leftmost -- under load, whole checks before it. "Landed" is therefore
+ # all three occurrences present (the row in its final form), with the
+ # first block glyph where the match begins so a particle still passing
+ # to its left keeps us waiting rather than shifting the answer.
def landed_row(sn):
for i, line in enumerate(sn.text):
- if GLYPHS in line and line.index(GLYPHS) == line.index("\u2584"):
+ if line.count(GLYPHS) == 3 and line.index(GLYPHS) == line.index(
+ "\u2584"
+ ):
return i
return None