diff options
author | EuAndreh <eu@euandre.org> | 2025-05-13 06:03:56 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2025-05-14 07:05:02 -0300 |
commit | 5409f0d17026fe473b0a42264323ecb8ab78a5c5 (patch) | |
tree | 3fa5e436b5cd0cd725c8daeaadcd1cdeb8ee85b5 /tests/integration.sh | |
parent | Absorb gettext_test.go (diff) | |
download | gotext-5409f0d17026fe473b0a42264323ecb8ab78a5c5.tar.gz gotext-5409f0d17026fe473b0a42264323ecb8ab78a5c5.tar.xz |
Absorb go-xgettext/main_test.go
Diffstat (limited to 'tests/integration.sh')
-rwxr-xr-x | tests/integration.sh | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/tests/integration.sh b/tests/integration.sh index e69de29..fb22072 100755 --- a/tests/integration.sh +++ b/tests/integration.sh @@ -0,0 +1,65 @@ +#!/bin/sh +set -euo pipefail + +exit + +// FIXME +// func (s *xgettextTestSuite) TestIntegration(c *C) { +// fname := makeGoSourceFile(c, []byte(`package main +// +// func main() { +// // TRANSLATORS: foo comment +// // with multiple lines +// i18n.G("foo") +// +// // this comment has no translators tag +// i18n.G("abc") +// +// // TRANSLATORS: plural +// i18n.NG("singular", "plural", 99) +// +// i18n.G("zz %s") +// } +// `)) +// +// // a real integration test :) +// outName := filepath.Join(c.MkDir(), "snappy.pot") +// os.Args = []string{"test-binary", +// "--output", outName, +// "--keyword", "i18n.G", +// "--keyword-plural", "i18n.NG", +// "--msgid-bugs-address", "snappy-devel@lists.ubuntu.com", +// "--package-name", "snappy", +// fname, +// } +// main() +// +// // verify its what we expect +// got, err := ioutil.ReadFile(outName) +// c.Assert(err, IsNil) +// expected := fmt.Sprintf(`%s +// #: %[2]s:9 +// msgid "abc" +// msgstr "" +// +// #. TRANSLATORS: foo comment +// #. with multiple lines +// #: %[2]s:6 +// msgid "foo" +// msgstr "" +// +// #. TRANSLATORS: plural +// #: %[2]s:12 +// msgid "singular" +// msgid_plural "plural" +// msgstr[0] "" +// msgstr[1] "" +// +// #: %[2]s:14 +// #, c-format +// msgid "zz %%s" +// msgstr "" +// +// `, header, fname) +// c.Assert(string(got), Equals, expected) +// } |