tests/test-contrib-check-code.t
changeset 29397 844f72885fb9
parent 29279 438caf194160
child 29398 2a54cf92c773
--- a/tests/test-contrib-check-code.t	Wed Jun 22 21:30:49 2016 +0100
+++ b/tests/test-contrib-check-code.t	Tue Jun 21 00:50:39 2016 +0900
@@ -262,6 +262,20 @@
   >        'bar foo-'
   >        'bar')
   > EOF
+
+'missing _() in ui message' detection
+
+  $ cat > uigettext.py <<EOF
+  > ui.status("% 10s %05d % -3.2f %*s %%"
+  >           # this use '\\\\' instead of '\\', because the latter in
+  >           # heredoc on shell becomes just '\'
+  >           '\\\\ \n \t \0'
+  >           """12345
+  >           """
+  >           '''.:*+-=
+  >           ''' "%-6d \n 123456 .:*+-= foobar")
+  > EOF
+
   $ "$check_code" stringjoin.py
   stringjoin.py:1:
    > foo = (' foo'
@@ -288,3 +302,9 @@
    >        'bar foo-'
    string join across lines with no space
   [1]
+
+  $ "$check_code" uigettext.py
+  uigettext.py:1:
+   > ui.status("% 10s %05d % -3.2f %*s %%"
+   missing _() in ui message (use () to hide false-positives)
+  [1]