From 37701531dbb992de94d94b2d5f014416d13767e1 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sat, 17 Oct 2026 10:54:01 -1000 Subject: Give the trim timing check room for a slow host The about-render unit test bounds three renders at one second to catch the cubic trim coming back. They take 0.1 s on a fast host and three seconds on a slow one, where the check failed, while the old code took minutes, so ten seconds still tells the two apart. --- tests/extensions/test-about-render.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'tests/extensions') diff --git a/tests/extensions/test-about-render.lua b/tests/extensions/test-about-render.lua index cb1c736..4d92882 100644 --- a/tests/extensions/test-about-render.lua +++ b/tests/extensions/test-about-render.lua @@ -250,12 +250,13 @@ out = render("README.md", string.rep("*a", 200)) h.check("an emphasis bomb still renders something", #out > 0) -- Trimming a run of spaces must stay linear, or one hostile line holds a --- request for minutes. Both lines below took seconds before. +-- request for minutes. The lines below took minutes before, and the bound +-- leaves room for a slow host, where they take a few seconds now. local started = os.clock() render("README.md", "# a" .. string.rep(" ", 3000) .. "b") render("README.md", string.rep("# a\n", 50000)) render("README.md", "| a | b |\n|---|---|\n| x" .. string.rep(" ", 40000) .. "y | z |") -h.check("a long run of spaces is trimmed quickly", os.clock() - started < 1) +h.check("a long run of spaces is trimmed quickly", os.clock() - started < 10) out = render("README.md", "| a | b |\n| --- | --- |\n| 1 | 2 |") h.contains("a pipe table renders its head", out, "ab") -- cgit 2.12.1