aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2025-05-14 07:46:36 -0300
committerEuAndreh <eu@euandre.org>2025-05-14 07:46:36 -0300
commit9416dc43227fa8ccec5296c47691e3e0357c9ac4 (patch)
treefa5e4857bb2f975238c0b2fd33c983e81fd716ed /tests
parentsrc/gotext.go: Do away with most of the CLI options (diff)
downloadgotext-9416dc43227fa8ccec5296c47691e3e0357c9ac4.tar.gz
gotext-9416dc43227fa8ccec5296c47691e3e0357c9ac4.tar.xz
src/gotext.go: Remove global `opts` shared variable
Diffstat (limited to 'tests')
-rw-r--r--tests/gotext.go25
1 files changed, 20 insertions, 5 deletions
diff --git a/tests/gotext.go b/tests/gotext.go
index 3c097c8..da57254 100644
--- a/tests/gotext.go
+++ b/tests/gotext.go
@@ -52,7 +52,10 @@ func test_processFiles() {
}
`))
defer os.Remove(fname)
- g.TErrorIf(processFiles([]string{fname}))
+ g.TErrorIf(processFiles(argsT{
+ subArgs: []string{fname},
+ keyword: "i18n.G",
+ }))
g.TAssertEqual(msgIDs, map[string][]msgID{
"foo": []msgID{
@@ -78,7 +81,10 @@ func test_processFiles() {
}
`))
defer os.Remove(fname)
- g.TErrorIf(processFiles([]string{fname}))
+ g.TErrorIf(processFiles(argsT{
+ subArgs: []string{fname},
+ keyword: "i18n.G",
+ }))
g.TAssertEqual(msgIDs, map[string][]msgID{
"foo": []msgID{
@@ -106,7 +112,10 @@ func test_processFiles() {
i18n.G("foo\n" + "bar\n" + "baz")
}
`))
- g.TErrorIf(processFiles([]string{fname}))
+ g.TErrorIf(processFiles(argsT{
+ subArgs: []string{fname},
+ keyword: "i18n.G",
+ }))
g.TAssertEqual(msgIDs, map[string][]msgID{
"foo\\nbar\\nbaz": []msgID{
@@ -128,7 +137,10 @@ func test_processFiles() {
}
`), "`"))
defer os.Remove(fname)
- g.TErrorIf(processFiles([]string{fname}))
+ g.TErrorIf(processFiles(argsT{
+ subArgs: []string{fname},
+ keyword: "i18n.G",
+ }))
out := bytes.NewBuffer([]byte(""))
writePotFile(out)
@@ -429,7 +441,10 @@ func test_writePotFile() {
}
`))
defer os.Remove(fname)
- g.TErrorIf(processFiles([]string{fname}))
+ g.TErrorIf(processFiles(argsT{
+ subArgs: []string{fname},
+ keyword: "i18n.G",
+ }))
out := bytes.NewBuffer([]byte(""))
writePotFile(out)