github.com/drone/runner-go@v1.12.0/environ/provider/static_test.go (about) 1 // Copyright 2019 Drone.IO Inc. All rights reserved. 2 // Use of this source code is governed by the Polyform License 3 // that can be found in the LICENSE file. 4 5 package provider 6 7 import ( 8 "testing" 9 10 "github.com/google/go-cmp/cmp" 11 ) 12 13 func TestStatic(t *testing.T) { 14 in := map[string]string{"a": "b"} 15 16 got, err := Static(in).List(noContext, nil) 17 if err != nil { 18 t.Error(err) 19 return 20 } 21 22 want := []*Variable{ 23 { 24 Name: "a", 25 Data: "b", 26 }, 27 } 28 29 if diff := cmp.Diff(got, want); diff != "" { 30 t.Errorf(diff) 31 } 32 }