Code optimization.

This commit is contained in:
ak47 committed 2026-10-14 20:39:01 -04:00
1 parent 12c514aab0
commit a121c26d63
11 files changed
+211 -37

No files matched your search

+12 -4
View File
@@ -176,14 +176,19 @@ func testLinkedHeadingSoundGeometry(t *testing.T, ctx context.Context, adapter *
}
defer worker.Stop(context.Background())
for _, step := range []struct {
target review.DocumentTarget
level int
backwards bool
name string
}{
{false, "Offscreen first topic"},
{false, "Offscreen second topic"},
{true, "Offscreen first topic"},
{review.DocumentHeading, 6, false, "Offscreen first topic"},
{review.DocumentHeading, 6, false, "Offscreen second topic"},
{review.DocumentHeading, 6, true, "Offscreen first topic"},
{review.DocumentLink, 0, false, "Offscreen first topic"},
{review.DocumentLink, 0, false, "Offscreen second topic"},
{review.DocumentLink, 0, true, "Offscreen first topic"},
} {
if err := worker.MoveDocument(review.DocumentHeading, 6, step.backwards); err != nil {
if err := worker.MoveDocument(step.target, step.level, step.backwards); err != nil {
t.Fatal(err)
}
select {
@@ -193,6 +198,9 @@ func testLinkedHeadingSoundGeometry(t *testing.T, ctx context.Context, adapter *
t.Fatalf("scrolled heading result = %+v", result)
}
link := result.DocumentPosition.LinkedHeading
if step.target == review.DocumentLink {
link = &result.DocumentPosition.Snapshot
}
if link == nil || !link.SoundGeometry.ObjectKnown || !link.SoundGeometry.ReferenceKnown {
t.Fatalf("scrolled link lacks fresh geometry: %+v", link)
}