chiark / gitweb /
test suite: i18n-messages: Test message translation
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 29 Sep 2018 10:23:18 +0000 (11:23 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 29 Sep 2018 11:48:14 +0000 (12:48 +0100)
We test just one of the messages I provided for en_US.UTF-8.
That's probably sufficient.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
debian/tests/control
tests/tests/i18n-messages [new file with mode: 0755]

index 1d29b2fb4cf6f355285d1b35bd07d8b030843f52..bdcfa981f334c2b723ac92767c4136b86a7aa6ab 100644 (file)
@@ -24,10 +24,6 @@ Tests: gdr-diverge-nmu gdr-diverge-nmu-dgit gdr-edits gdr-fresh gdr-import-dgit
 Tests-Directory: tests/tests
 Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, bc, faketime, git-debrebase, git-buildpackage
 
 Tests-Directory: tests/tests
 Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, bc, faketime, git-debrebase, git-buildpackage
 
-Tests: gdr-newupstream gdr-viagit
-Tests-Directory: tests/tests
-Depends: chiark-utils-bin, faketime, git-debrebase, git-buildpackage
-
 Tests: gitattributes
 Tests-Directory: tests/tests
 Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, bc, faketime, bsdgames, man-db, git-man
 Tests: gitattributes
 Tests-Directory: tests/tests
 Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, bc, faketime, bsdgames, man-db, git-man
@@ -37,6 +33,10 @@ Tests-Directory: tests/tests
 Depends: gnupg, patch, diffutils
 Restrictions: hint-testsuite-triggers
 
 Depends: gnupg, patch, diffutils
 Restrictions: hint-testsuite-triggers
 
+Tests: gdr-newupstream gdr-viagit i18n-messages
+Tests-Directory: tests/tests
+Depends: chiark-utils-bin, faketime, git-debrebase, git-buildpackage
+
 Tests: manpages-format
 Tests-Directory: tests/tests
 Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, bc, faketime, man-db, make, groff, git-debrebase
 Tests: manpages-format
 Tests-Directory: tests/tests
 Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, bc, faketime, man-db, make, groff, git-debrebase
diff --git a/tests/tests/i18n-messages b/tests/tests/i18n-messages
new file mode 100755 (executable)
index 0000000..f2aaa87
--- /dev/null
@@ -0,0 +1,41 @@
+#!/bin/bash
+set -e
+autoimport=
+. tests/lib
+
+t-dependencies NO-DGIT GDR
+t-restrict x-dgit-out-of-tree-only
+# We don't run this test in-tree because:
+#  1. The .mo files that we would use might need to be built
+#     and would certainly have to be `installed' somewhere we
+#     could reference them.  We could do that here maybe,
+#     but it would risk dirtying the tree because the i18n
+#     machinery is dirtying, and also:
+#  2. The locale system does not provide a path-like variable
+#     we could use to point to our not-yet-installed .mo files.
+#     There is LOCPATH but setting it breaks everything because
+#     it disables `locale archives' and those are what provides
+#     important infrastructure.
+
+t-setup-import gdr-convert-gbp-noarchive
+
+cd $p
+
+t-gdr-prep-new-upstream 2.1
+git tag v2.1 upstream
+
+git branch startpoint
+v=2.1-1
+
+git checkout master
+
+anchor=$(t-git-debrebase anchor)
+
+t-expect-fail F:'old anchor is recognised' \
+t-git-debrebase --anchor=$anchor new-upstream 2.1
+
+expect_fail_lcmessages=en_US.UTF-8
+t-expect-fail F:'old anchor is recognized' \
+t-git-debrebase --anchor=$anchor new-upstream 2.1
+
+t-ok