mirror of
https://github.com/restic/restic.git
synced 2026-10-05 18:30:30 +00:00
data/fs: faster comparison in tests
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"reflect"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
@@ -275,11 +276,12 @@ func TestApplyPolicy(t *testing.T) {
|
||||
|
||||
cmpOpts := cmpopts.IgnoreUnexported(data.Snapshot{})
|
||||
|
||||
if !cmp.Equal(want.Keep, keep, cmpOpts) {
|
||||
// reflect.DeepEqual is faster than cmp.Equal
|
||||
if !reflect.DeepEqual(want.Keep, keep) {
|
||||
t.Error(cmp.Diff(want.Keep, keep, cmpOpts))
|
||||
}
|
||||
|
||||
if !cmp.Equal(want.Reasons, reasons, cmpOpts) {
|
||||
if !reflect.DeepEqual(want.Reasons, reasons) {
|
||||
t.Error(cmp.Diff(want.Reasons, reasons, cmpOpts))
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user