-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
testscript: add test to show cmp with small diff between large files
Also define $ as part of the standard testscript environment, for use in cmpenv situations where the literal $ is required in a file.
- Loading branch information
Showing
3 changed files
with
177 additions
and
0 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,9 +1,18 @@ | ||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= | ||
github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= | ||
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= | ||
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= | ||
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= | ||
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= | ||
github.com/pkg/diff v0.0.0-20200914180035-5b29258ca4f7 h1:+/+DxvQaYifJ+grD4klzrS5y+KJXldn/2YTl5JG+vZ8= | ||
github.com/pkg/diff v0.0.0-20200914180035-5b29258ca4f7/go.mod h1:zO8QMzTeZd5cpnIkz/Gn6iK0jDfGicM1nynOkkPIl28= | ||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= | ||
github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= | ||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= | ||
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= | ||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= | ||
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= | ||
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= | ||
gopkg.in/errgo.v2 v2.1.0 h1:0vLT13EuvQ0hNvakwLuFZ/jYrLp5F3kcWHXdRggjCE8= | ||
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= | ||
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= |
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 |
---|---|---|
@@ -0,0 +1,167 @@ | ||
# Verify the behaviour of cmp in the case of a small diff between | ||
# two large files | ||
|
||
unquote dir/script.txt | ||
! testscript dir | ||
env | ||
cmpenv stdout stdout.golden | ||
|
||
-- dir/script.txt -- | ||
>cmp a b | ||
> | ||
>-- a -- | ||
>a | ||
>a | ||
>a | ||
>a | ||
>a | ||
>a | ||
>a | ||
>a | ||
>a | ||
>a | ||
>a | ||
>a | ||
>a | ||
>a | ||
>a | ||
>a | ||
>a | ||
>a | ||
>a | ||
>a | ||
>a | ||
>a | ||
>a | ||
>a | ||
>a | ||
>a | ||
>a | ||
>a | ||
>a | ||
>a | ||
>a | ||
>a | ||
>a | ||
>a | ||
>a | ||
>a | ||
>a | ||
>a | ||
>a | ||
>a | ||
>a | ||
>a | ||
>a | ||
>a | ||
>a | ||
>a | ||
>a | ||
>a | ||
>a | ||
>-- b -- | ||
>b | ||
>a | ||
>a | ||
>a | ||
>a | ||
>a | ||
>a | ||
>a | ||
>a | ||
>a | ||
>a | ||
>a | ||
>a | ||
>a | ||
>a | ||
>a | ||
>a | ||
>a | ||
>a | ||
>a | ||
>a | ||
>a | ||
>a | ||
>a | ||
>a | ||
>a | ||
>a | ||
>a | ||
>a | ||
>a | ||
>a | ||
>a | ||
>a | ||
>a | ||
>a | ||
>a | ||
>a | ||
>a | ||
>a | ||
>a | ||
>a | ||
>a | ||
>a | ||
>a | ||
>a | ||
>a | ||
>a | ||
>a | ||
>a | ||
-- stdout.golden -- | ||
|
||
> cmp a b | ||
[diff -a +b] | ||
-a | ||
+b | ||
a | ||
a | ||
a | ||
a | ||
a | ||
a | ||
a | ||
a | ||
a | ||
a | ||
a | ||
a | ||
a | ||
a | ||
a | ||
a | ||
a | ||
a | ||
a | ||
a | ||
a | ||
a | ||
a | ||
a | ||
a | ||
a | ||
a | ||
a | ||
a | ||
a | ||
a | ||
a | ||
a | ||
a | ||
a | ||
a | ||
a | ||
a | ||
a | ||
a | ||
a | ||
a | ||
a | ||
a | ||
a | ||
a | ||
a | ||
a | ||
|
||
FAIL: $$WORK${/}dir${/}script.txt:1: a and b differ |
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