"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "internal/agherr/agherr_test.go" between
AdGuardHome-0.104.1.tar.gz and AdGuardHome-0.104.3.tar.gz

About: AdGuard Home is a network-wide ads & trackers blocking DNS server. It operates as a DNS server that re-routes tracking domains to a "black hole," thus preventing your devices from connecting to those servers.

agherr_test.go  (AdGuardHome-0.104.1):agherr_test.go  (AdGuardHome-0.104.3)
package agherr package agherr
import ( import (
"errors" "errors"
"fmt" "fmt"
"testing" "testing"
"github.com/AdguardTeam/AdGuardHome/internal/testutil"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
) )
func TestMain(m *testing.M) {
testutil.DiscardLogOutput(m)
}
func TestError_Error(t *testing.T) { func TestError_Error(t *testing.T) {
testCases := []struct { testCases := []struct {
name string name string
want string want string
err error err error
}{{ }{{
name: "simple", name: "simple",
want: "a", want: "a",
err: Many("a"), err: Many("a"),
}, { }, {
skipping to change at line 46 skipping to change at line 51
} }
func TestError_Unwrap(t *testing.T) { func TestError_Unwrap(t *testing.T) {
const ( const (
errSimple = iota errSimple = iota
errWrapped errWrapped
errNil errNil
) )
errs := []error{ errs := []error{
errSimple: errors.New("a"), errSimple: errors.New("a"),
errWrapped: fmt.Errorf("%w", errors.New("nested")), errWrapped: fmt.Errorf("err: %w", errors.New("nested")),
errNil: nil, errNil: nil,
} }
testCases := []struct { testCases := []struct {
name string name string
want error want error
wrapped error wrapped error
}{{ }{{
name: "simple", name: "simple",
want: errs[errSimple], want: errs[errSimple],
wrapped: Many("a", errs[errSimple]), wrapped: Many("a", errs[errSimple]),
 End of changes. 3 change blocks. 
1 lines changed or deleted 6 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)