forked from hairyhenderson/gomplate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig_test.go
48 lines (38 loc) · 793 Bytes
/
config_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
48
package gomplate
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestConfigString(t *testing.T) {
c := &Config{}
expected := `input: -
output: -`
assert.Equal(t, expected, c.String())
c = &Config{
LDelim: "L",
RDelim: "R",
Input: "foo",
OutputFiles: []string{"-"},
Templates: []string{"foo=foo.t", "bar=bar.t"},
}
expected = `input: <arg>
output: -
left_delim: L
right_delim: R
templates: foo=foo.t, bar=bar.t`
assert.Equal(t, expected, c.String())
c = &Config{
InputDir: "in/",
OutputDir: "out/",
}
expected = `input: in/
output: out/`
assert.Equal(t, expected, c.String())
c = &Config{
InputDir: "in/",
OutputMap: "{{ .in }}",
}
expected = `input: in/
output: {{ .in }}`
assert.Equal(t, expected, c.String())
}