Commit ec8dfd8
committed
Keep the vendored DiffPlex internal and drop what Pester does not call
Vendoring put 20 DiffPlex types into Pester's public API. Nothing asked for that, and
it would make the vendored library part of the compatibility surface, so replacing it
or updating it across a breaking change becomes our problem.
Every vendored type is internal now. Pester exposes one method,
Pester.StringDiff.Format, which takes the two strings and returns the part of the
failure message that describes how they differ. StringDiffResult and Compare are
internal, and PesterTests sees them through InternalsVisibleTo.
The files were already modified, so there was no reason to keep code we never call.
pester.patch removes Differ's convenience methods, IDiffer, ISideBySideDiffBuilder,
and the SideBySideDiffBuilder constructors and static helpers that default to
LineChunker. Five files then have nothing referring to them and are not vendored at
all. 19 files became 14, and Pester.dll grows by 22 KB per target framework instead
of 24 KB.
WordChunker and DelimiterChunker stay. SideBySideDiffBuilder uses them for the word
level sub pieces on a changed line, which we do not render yet, and highlighting the
changed part inside a line is the obvious next thing to do to this message. Cutting
them means editing the core of SideBySideDiffBuilder rather than deleting whole
members.
Deleting code is what breaks a vendored copy, because a hand-trimmed one diverges
quietly and nobody can tell what was changed on purpose. So the removals are kept as
a patch, not applied by hand. Update-VendoredDiffPlex.ps1 rebuilds the whole thing
from upstream, applies the namespace rewrite, the internal rewrite and the header,
then applies pester.patch, and -Verify compares that against what is on disk. Running
it against a newer DiffPlex either works or git says which hunk failed. -Regenerate
rewrites the patch after a deliberate hand edit.
🤖1 parent 87e76ed commit ec8dfd8
25 files changed
Lines changed: 422 additions & 420 deletions
File tree
- src
- csharp/Pester
- DiffPlex
- Chunkers
- DiffBuilder
- Model
- Model
- functions/assert/String
This file was deleted.
Lines changed: 0 additions & 25 deletions
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
This file was deleted.
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
Lines changed: 0 additions & 22 deletions
This file was deleted.
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
0 commit comments