Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

testscript: add test to show cmp with small diff between large files #129

Merged
merged 1 commit into from
Mar 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
167 changes: 167 additions & 0 deletions testscript/testdata/long_diff.txt
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
1 change: 1 addition & 0 deletions testscript/testscript.go
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@ func (ts *TestScript) setup() string {
"devnull=" + os.DevNull,
"/=" + string(os.PathSeparator),
":=" + string(os.PathListSeparator),
"$=$",

// If we are collecting coverage profiles for merging into the main one,
// ensure the environment variable is forwarded to sub-processes.
Expand Down