-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
narcissus_test.go
49 lines (40 loc) · 1.04 KB
/
narcissus_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
49
package narcissus
import "os"
// Used in other tests
var wd, _ = os.Getwd()
var fakeroot = wd + "/fakeroot"
// Test structure
type foo struct {
augeasPath string
A string `narcissus:"a"`
}
type bar struct{}
type simpleValues struct {
augeasPath string
Str string `narcissus:"str"`
Int int `narcissus:"int"`
Bool bool `narcissus:"bool"`
}
type sliceValues struct {
augeasPath string
SlStr []string `narcissus:"slstr"`
SlInt []int `narcissus:"slint"`
SlBool []bool `narcissus:"slbool"`
SlStrSeq []string `narcissus:"seq"`
SlStruct []mapEntry `narcissus:"mapentry"`
}
type mapValues struct {
augeasPath string
Entries map[string]mapEntry `narcissus:"mstruct"`
MStr map[string]string `narcissus:"sub/*,key-from-label"`
}
type mapEntry struct {
Str string `narcissus:"str"`
Int int `narcissus:"int"`
Bool bool `narcissus:"bool"`
SlStr []string `narcissus:"slstr"`
}
type noCapital struct {
augeasPath string
a string `narcissus:"a"`
}