From 9416dc43227fa8ccec5296c47691e3e0357c9ac4 Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Wed, 14 May 2025 07:46:36 -0300 Subject: src/gotext.go: Remove global `opts` shared variable --- tests/gotext.go | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) (limited to 'tests') 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) -- cgit v1.2.3