On 2019-09-28 4:09 pm, Knute Snortum wrote:
> I haven't been able to get the ly:expect-warning function working
> properly. Here is a MWE:
>
> %%% Start
> \version "2.19.83"
> \include "english.ly"
>
> #(ly:expect-warning "omitting tuplet bracket")
>
> {
> \clef bass
> \tuplet 3/2 4 {
> <<
> { g4 s8 gf4 s8 f4 s8 s4. }
> \\
> { g8 ef' bf gf ef' bf f ef' a, bf, df' bf }
> >> |
> }
> }
> %%% End
>
> This will still emit warnings for me. I'm on Ubuntu 19.04 if that
> matters.
As implemented, ly:expect-warning is to be used for individual
occurrences of a warning, not as a simple global filter.
Try this variation on the function that makes it easy to specify how
many instances of the warning should be expected:
%%%%
\version "2.19.83"
\include "english.ly"
#(define ly:expect-warning-times (lambda args
(for-each (lambda _ (apply ly:expect-warning (cdr args)))
(iota (car args)))))
#(ly:expect-warning-times 4 "omitting tuplet bracket")
{
\clef bass
\tuplet 3/2 4 {
<<
{ g4 s8 gf4 s8 f4 s8 s4. }
\\
{ g8 ef' bf gf ef' bf f ef' a, bf, df' bf }
>> |
}
}
%%%%
-- Aaron Hill
That works great. Thanks!
(via Gmail)