forked from rogpeppe/go-internal
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
testscript: switch to new diff package
The main reason to prefer a copy of Go's internal/diff over pkg/diff is that internal/diff is much more efficient in both time and memory usage. In particular, pkg/diff required quadratic space in memory, which could easily cause "out of memory" errors in Go tests per pkg/diff#26. Beyond making the `cmp` command better able to handle large files, this also moves us back to having zero external dependencies, which is always a nice to have. The long_diff test still appears to work well; the output is changed since the new package produces a shorter, but still entirely correct, diff. It also seems like the new package includes a leading "diff" line to show the two filenames. That seems like a harmless change.
- Loading branch information
Showing
4 changed files
with
6 additions
and
16 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
module github.com/rogpeppe/go-internal | ||
|
||
go 1.18 | ||
|
||
require github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +0,0 @@ | ||
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e h1:aoZm08cpOy4WuID//EZDgcC4zIxODThtZNPirFr42+A= | ||
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= | ||
This file contains 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
This file contains 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