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.
12 func TestDedupEnv(t
*testing
.T
) {
20 in
: []string{"k1=v1", "k2=v2", "K1=v3"},
21 want
: []string{"K1=v3", "k2=v2"},
25 in
: []string{"k1=v1", "K1=V2", "k1=v3"},
26 want
: []string{"k1=v3", "K1=V2"},
29 in
: []string{"=a", "=b", "foo", "bar"},
30 want
: []string{"=b", "foo", "bar"},
33 for _
, tt
:= range tests
{
34 got
:= dedupEnvCase(tt
.noCase
, tt
.in
)
35 if !reflect
.DeepEqual(got
, tt
.want
) {
36 t
.Errorf("Dedup(%v, %q) = %q; want %q", tt
.noCase
, tt
.in
, got
, tt
.want
)