Assert the order the page reader hands its problems back in - #209
Merged
iderex merged 1 commit intoAug 27, 2026
Merged
Conversation
Read sorts the problems it found by the line they are on, and nothing asserted the sort. Both mutants the tool reports at that comparison were applied by hand at 0112a59 and left the suite green: internal/markup/markup.go:227 Line < Line -> Line >= Line internal/markup/markup.go:227 Line < Line -> Line <= Line The order is not incidental to what the checker is for. The list is what somebody repairs a page from, and reversing the comparison hands them the bottom of the file first. It cannot be got right by accident either: an element still open when the input ends is only known to be open once the input has ended, so its problem is appended after every problem found further down the page, and the sort is the only thing that puts line 2 back in front of line 10. Two cases, one per direction of the same comparison. The first reads a document that ends with three elements still open and a skipped heading level below them, and asserts the four lines come back ascending. The document is not the wrapper the rest of the file uses, because that wrapper closes everything it opens and the out-of-order append cannot arise in it. The second puts three problems on one line and asserts they stay in the order the reader found them. That is the half the first case cannot see: every line in it is different, and a comparison that is no longer strict sorts distinct keys correctly and swaps equal ones. Three kinds on one line separate the two. Each of the two mutations above was applied again with these cases in, and a third, and all three produce a red run naming the property they removed. Signed-off-by: Nils Lehnen <30603423+iderex@users.noreply.github.com>
iderex
deleted the
tests/the-order-the-page-reader-hands-its-problems-back-in
branch
August 27, 2026 06:47
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What was wrong
Readsorts the problems it found by the line they are on, and nothing assertedthe sort. Both mutants the tool reports at that comparison were applied by hand
at
0112a59, in the working tree with the tree restored between, and both leftthe suite green:
Run 2026-08-27. Those two are the whole of what the tool reports as
NOT COVEREDin this package, and unlike the four in
./internal/rosterthat the same readingfound dead, these are a gap in the suite rather than a position the tool cannot
see.
The order is not incidental to what this package is for. The list is what
somebody repairs a page from, and the reversed comparison hands them the bottom
of the file first. It is also not something the code gets right by accident: an
element still open when the input ends is only known to be open once the input
has ended, so its problem is appended after every problem found further down the
page, and the sort is the only thing that puts line 2 back in front of line 10.
What this does
Two cases, one per direction of the same comparison.
The first reads a document ending with three elements still open and a skipped
heading level below them, and asserts the four lines come back ascending. The
document is not the wrapper the rest of the file uses, because that wrapper
closes everything it opens and the out-of-order append cannot arise inside it.
The second puts three problems on one line and asserts they stay in the order the
reader found them. That is the half the first case cannot see: every line in it is
different, and a comparison that has stopped being strict sorts distinct keys
correctly and swaps equal ones. Three kinds on one line separate the two.
Closes
Nothing. It belongs to #44 and does not close it: what that issue waits on is
where a mutation run lives, which is a call rather than a measurement and is not
touched here.
What was run
The gate, at the commit being pushed:
Three mutations of that comparison applied by hand with these cases in, one at a
time with the tree restored between. The third is not one the tool reports and is
here because it is the mistake somebody actually makes at a comparator:
All run 2026-08-27. Each is red for the property it removed, and the middle one
is red only in the second case, which is why both cases are here.
The tool, in a clone outside the working tree at the two commits, at the
coefficient #44 argues belongs beside any score:
Both run 2026-08-27. Read the killed counts with the run this package is already
known to give rather than as a difference these two cases produced. Six more
mutants are killed and only two of them are the ones above: the other four are
the four the earlier run reported as
NOT VIABLEand this one did not report atall. #44 already records that this package does not reproduce run to run, with a
mutant killed on one of three runs and timed out on the other two, and this pair
is another instance of it rather than a new fact. What does reproduce across both
runs is the fourteen survivors, which are unmoved and are the ones #44 reasons
about site by site.
No test was skipped. Nothing here needs a display, elevation, a socket or a
network.
The means
Go test cases in the package they judge, which is what every other suite in this
tree is made of. It adds no language, no runtime and no dependency:
go testalready runs it as the third leg of the gate, and the tool the figures above come
from is run by hand outside the gate and is not made a dependency of it here.
Each case is shown to bite by removing the thing it exists for and watching the
run go red naming that thing, which is the three readings above, and every claim
in this body carries the command that produced it.
Who read it
Nobody else. This change carries no second reader, and the evidence above stands
in place of one: the two mutations that found the gap, the three replayed against
the cases, and the two tool runs at the two commits. The ruleset on this branch
requires no approving review, so the merge is not evidence of one either.