-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathreplace_strings_in_files_test.go
74 lines (66 loc) · 1.76 KB
/
replace_strings_in_files_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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
// -----------------------------------------------------------------------------
// CMDX Utilities Suite cmdx/[replace_strings_in_files_test.go]
// (c) balarabe@protonmail.com License: GPLv3
// -----------------------------------------------------------------------------
package main
// to test all items in replace_strings_in_files.go use:
// go test --run Test_rsif_
//
// to generate a test coverage report for the whole module use:
// go test -coverprofile cover.out
// go tool cover -html=cover.out
import (
"sync"
"testing"
"github.com/balacode/zr"
)
// go test --run Test_rsif_replaceStringsInFiles_
func Test_rsif_replaceStringsInFiles_(t *testing.T) {
zr.TBegin(t)
// replaceStringsInFiles(cmd Command, args []string)
//
test := func(
// in:
cmd Command, args []string,
) {
replaceStringsInFiles(cmd, args)
}
test(Command{}, []string{})
}
// go test --run Test_rsif_replaceAsync_
func Test_rsif_replaceAsync_(t *testing.T) {
zr.TBegin(t)
// replaceAsync(task *sync.WaitGroup, configFile string, cmd ReplCmd)
//
test := func(
// in:
task *sync.WaitGroup, configFile string, cmd ReplCmd,
) {
replaceAsync(task, configFile, cmd)
}
cmd := ReplCmd{}
test(nil, "", cmd)
}
// go test --run Test_rsif_replaceFileAsync_
func Test_rsif_replaceFileAsync_(t *testing.T) {
// replaceFileAsync(
// task *sync.WaitGroup,
// configFile string,
// filename string,
// content string,
// items []ReplItem,
// )
zr.TBegin(t)
test := func(
// in:
task *sync.WaitGroup,
configFile string,
filename string,
content string,
items []ReplItem,
) {
replaceFileAsync(task, configFile, filename, content, items)
}
test(nil, "", "", "", []ReplItem{})
}
// end