mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-20 11:40:18 +02:00
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.
This commit is contained in:
parent
3936cebc77
commit
022ae742d1
1 changed files with 17 additions and 0 deletions
|
@ -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 ()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue