-
Notifications
You must be signed in to change notification settings - Fork 1
/
main_test.go
47 lines (38 loc) · 670 Bytes
/
main_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package main
import (
"os"
"reflect"
"testing"
)
func TestMainWithYAML(t *testing.T) {
os.Args = []string{
"kenv",
"-v",
"fixtures/vars.env",
"fixtures/deployment.yml",
}
main()
}
func TestMainWithJSON(t *testing.T) {
os.Args = []string{
"kenv",
"-v",
"fixtures/vars.env",
"fixtures/deployment.json",
}
main()
}
func TestFlagSliceString(t *testing.T) {
fs := FlagSlice{"foo", "bar"}
if fs.String() != "foo,bar" {
t.Fatalf("strings not equal")
}
}
func TestFlagSliceSet(t *testing.T) {
want := FlagSlice{"foo", "bar"}
fs := FlagSlice{"foo"}
fs.Set("bar")
if !reflect.DeepEqual(want, fs) {
t.Fatalf("flagslice not equal")
}
}