github.com/golang/dep@v0.5.4/gps/manifest_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 "testing"
     8  
     9  // Test that prep manifest sanitizes manifests appropriately
    10  func TestPrepManifest(t *testing.T) {
    11  	m := SimpleManifest{
    12  		Deps: ProjectConstraints{
    13  			ProjectRoot("foo"): ProjectProperties{},
    14  			ProjectRoot("bar"): ProjectProperties{
    15  				Source: "whatever",
    16  			},
    17  		},
    18  	}
    19  
    20  	prepped := prepManifest(m)
    21  	d := prepped.DependencyConstraints()
    22  	if len(d) != 1 {
    23  		t.Error("prepManifest did not eliminate empty ProjectProperties from deps map")
    24  	}
    25  
    26  	if d[ProjectRoot("bar")].Constraint != any {
    27  		t.Error("prepManifest did not normalize nil constraint to anyConstraint in deps map")
    28  	}
    29  }