The io.Reader contract says a Read at EOF returns io.EOF (0, io.EOF).
The mock was returning fs.ErrClosed, which is a distinct sentinel used
for reads on already-closed files. Aligning the mock with the stdlib
contract keeps tests that iterate over the file happy.
Signed-off-by: Mohammed Al Sahaf <msaa1990@gmail.com>
TestStaticIPRangeProvision was re-implementing Provision's loop
instead of calling it. The real Provision only touches the Ranges
field, so a zero-value caddy.Context is enough to exercise it.
Signed-off-by: Mohammed Al Sahaf <msaa1990@gmail.com>
Neither test asserted a real outcome (one compared against an
unreachable literal, the other logged then discarded the result).
Since Replacer.ReplaceAll substitutes the provided default for
unknown placeholders, both cases can be checked with deterministic
equality.
Signed-off-by: Mohammed Al Sahaf <msaa1990@gmail.com>
The doc comment says randString excludes confusing characters like
I, l, 1, 0, O. When sameCase is true, uppercase letters are excluded,
and l and o should also be excluded. But the dictionary used when
sameCase was true still contained '0'. Drop it, and update the test
to match the actual documented exclusions.
Signed-off-by: Mohammed Al Sahaf <msaa1990@gmail.com>
- willCycle now reports a cycle when from == to, so addEdge rejects
self-loops (a self-importing file was previously accepted).
- removeNode now drops the removed node's outgoing edges and any
incoming edges pointing at it, keeping the adjacency map consistent.
Also tightens the two tests that previously only logged the buggy
behavior into real assertions.
Signed-off-by: Mohammed Al Sahaf <msaa1990@gmail.com>
The loop appended before checking the length, so with maxToDisplay=0
one domain leaked into the output before the break check. Reorder so
the length check comes first.
Signed-off-by: Mohammed Al Sahaf <msaa1990@gmail.com>
- reverseproxy: TestHostActiveHealthCounters and TestHostResetHealth
tested Host.activeHealth*/countHealth*/resetHealth methods, which
master #7916 moved to Upstream.
- rewrite: rewrite_utils_test.go tested the reverse() helper, which
master #7877 removed as part of a strip_path_suffix bug fix.
- root: Config.cancelFunc changed from context.CancelFunc to
context.CancelCauseFunc upstream; pass nil cause in the test cleanup.