summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2011-04-14 23:14:14 +0200
committerLudovic Courtès <ludo@gnu.org>2011-04-14 23:14:14 +0200
commit022ae742d171fb9ef3db7aab59b4e029edd2ff02 (patch)
treed44d1a335d3c2cb805cb7a90fe3257379f0e2fec
parent3936cebc77bfbde57bb3fe904b26943e54a9d618 (diff)
downloadguile-022ae742d171fb9ef3db7aab59b4e029edd2ff02.tar.gz
Add tests for `-Wformat' and gettext.
* test-suite/tests/tree-il.test ("warnings")["non-literal format string using gettext", "one missing argument, gettext"]: New tests.
-rw-r--r--test-suite/tests/tree-il.test17
1 files changed, 17 insertions, 0 deletions
diff --git a/test-suite/tests/tree-il.test b/test-suite/tests/tree-il.test
index 8ea244343..1b86b99fc 100644
--- a/test-suite/tests/tree-il.test
+++ b/test-suite/tests/tree-il.test
@@ -1153,6 +1153,13 @@
(number? (string-contains (car w)
"non-literal format string")))))
+ (pass-if "non-literal format string using gettext"
+ (null? (call-with-warnings
+ (lambda ()
+ (compile '(format #t (_ "~A ~A!") "hello" "world")
+ #:opts %opts-w-format
+ #:to 'assembly)))))
+
(pass-if "wrong format string"
(let ((w (call-with-warnings
(lambda ()
@@ -1190,6 +1197,16 @@
(number? (string-contains (car w)
"expected 1, got 0")))))
+ (pass-if "one missing argument, gettext"
+ (let ((w (call-with-warnings
+ (lambda ()
+ (compile '(format some-port (_ "foo ~A~%"))
+ #:opts %opts-w-format
+ #:to 'assembly)))))
+ (and (= (length w) 1)
+ (number? (string-contains (car w)
+ "expected 1, got 0")))))
+
(pass-if "two missing arguments"
(let ((w (call-with-warnings
(lambda ()