1
1
package main
2
2
3
3
import (
4
- "bytes"
5
4
"errors"
6
5
"fmt"
7
6
"io/ioutil"
@@ -10,7 +9,6 @@ import (
10
9
"testing"
11
10
12
11
"github.com/google/go-cmp/cmp"
13
- "github.com/pkg/diff"
14
12
"github.com/scylladb/go-set"
15
13
"github.com/scylladb/go-set/strset"
16
14
)
@@ -207,15 +205,11 @@ func runSuccess(t *testing.T, args []string, wantUpPath string, wantDownPath str
207
205
t .Fatalf ("reading tmp down file: %v" , err )
208
206
}
209
207
210
- if ! bytes .Equal (tmpUp , wantUp ) {
211
- var outDiff bytes.Buffer
212
- diff .Text ("got" , wantUpPath , tmpUp , wantUp , & outDiff )
213
- t .Errorf ("\n up script: got the following differences:\n %v" , outDiff .String ())
208
+ if diff := cmp .Diff (tmpUp , wantUp , cmpOpt ); diff != "" {
209
+ t .Errorf ("\n up script: mismatch (-want +got):\n %s" , diff )
214
210
}
215
- if ! bytes .Equal (tmpDown , wantDown ) {
216
- var outDiff bytes.Buffer
217
- diff .Text ("got" , wantDownPath , tmpDown , wantDown , & outDiff )
218
- t .Errorf ("\n down script: got the following differences:\n %v" , outDiff .String ())
211
+ if diff := cmp .Diff (tmpDown , wantDown , cmpOpt ); diff != "" {
212
+ t .Errorf ("\n down script: mismatch (-want +got):\n %s" , diff )
219
213
}
220
214
}
221
215
0 commit comments