diff options
author | Ludovic Courtès <ludo@gnu.org> | 2011-04-14 23:14:14 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2011-04-14 23:14:14 +0200 |
commit | 022ae742d171fb9ef3db7aab59b4e029edd2ff02 (patch) | |
tree | d44d1a335d3c2cb805cb7a90fe3257379f0e2fec | |
parent | 3936cebc77bfbde57bb3fe904b26943e54a9d618 (diff) | |
download | guile-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.test | 17 |
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 () |