-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathtag_test.go
43 lines (38 loc) · 1.04 KB
/
tag_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
package clop
import (
//"fmt"
"github.com/stretchr/testify/assert"
"testing"
)
type getData struct {
set string
need string
key string
}
func Test_Get(t *testing.T) {
gd := []getData{
{`clop:"-c;--number-nonblank"
usage:"number nonempty output lines, overrides"`,
`-c;--number-nonblank`,
"clop",
},
{`clop:"-c;--number-nonblank"
usage:"number nonempty output lines, overrides"`,
`number nonempty output lines, overrides`,
"usage",
},
{`clop:"-s;--squeeze-repeats"
usage:"replace each sequence of a repeated character
that is listed in the last specified SET,
with a single occurrence of that character"`,
`replace each sequence of a repeated character
that is listed in the last specified SET,
with a single occurrence of that character`,
"usage"},
}
for _, v := range gd {
val := Tag(v.set).Get(v.key)
//fmt.Printf("need(%s) get(%s)\n", v.need, val)
assert.Equal(t, val, v.need)
}
}