github.com/golang/dep@v0.5.4/gps/source_errors_test.go (about)

     1  // Copyright 2017 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package gps
     6  
     7  import (
     8  	"testing"
     9  
    10  	"github.com/Masterminds/vcs"
    11  )
    12  
    13  func TestUnwrapVcsErrNonNil(t *testing.T) {
    14  	for _, err := range []error{
    15  		vcs.NewRemoteError("msg", nil, "out"),
    16  		vcs.NewRemoteError("msg", nil, ""),
    17  		vcs.NewRemoteError("", nil, "out"),
    18  		vcs.NewRemoteError("", nil, ""),
    19  		vcs.NewLocalError("msg", nil, "out"),
    20  		vcs.NewLocalError("msg", nil, ""),
    21  		vcs.NewLocalError("", nil, "out"),
    22  		vcs.NewLocalError("", nil, ""),
    23  		&vcs.RemoteError{},
    24  		&vcs.LocalError{},
    25  	} {
    26  		if unwrapVcsErr(err) == nil {
    27  			t.Errorf("unexpected nil error unwrapping: %#v", err)
    28  		}
    29  	}
    30  }