From 022ae742d171fb9ef3db7aab59b4e029edd2ff02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Thu, 14 Apr 2011 23:14:14 +0200 Subject: [PATCH] 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. --- test-suite/tests/tree-il.test | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) 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 ()