1\version "2.19.21" 2#(ly:set-option 'warning-as-error #t) 3#(ly:expect-warning (_ "Bar number is ~a; expected ~a") 3 15) 4 5\header { 6 7texidoc="@code{\\barNumberCheck} may be inserted to check whether the 8current bar number is correct. Checking is enabled by default for 9layout and disabled by default for MIDI." 10 11} 12 13okMusic = \relative { 14 c''1 | 15 \barNumberCheck #2 % OK 16 c1 | 17} 18 19\score { 20 \relative { 21 \okMusic 22 \barNumberCheck #15 % Warning 23 c''1 24 } 25} 26 27\score { 28 \midi { } 29 30 \relative { 31 \okMusic 32 \barNumberCheck #34 % Wrong, but no warning for MIDI output 33 c''1 34 } 35} 36