X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=input%2Fregression%2Fmarkup-cyclic-reference.ly;fp=input%2Fregression%2Fmarkup-cyclic-reference.ly;h=9ca834b542d9a45fa56d0a87db907b1c81c8d10d;hb=32a34dcef0c0041c6d62677487a380b5c8b85712;hp=0000000000000000000000000000000000000000;hpb=f41973ff763d5972a85995b6d40c864281ec6714;p=lilypond.git diff --git a/input/regression/markup-cyclic-reference.ly b/input/regression/markup-cyclic-reference.ly new file mode 100644 index 0000000000..9ca834b542 --- /dev/null +++ b/input/regression/markup-cyclic-reference.ly @@ -0,0 +1,26 @@ +\version "2.16.0" +#(ly:set-option 'warning-as-error #f) +#(ly:expect-warning (ly:translate-cpp-warning-scheme "Cyclic markup detected: %s") 'cycle-markup) +#(ly:expect-warning (ly:translate-cpp-warning-scheme "Cyclic markup detected: %s") 'cycleI-markup) + +\header { + texidoc = "Cyclic markup definitions should cause a warning, but +not crash LilyPond with an endless loop" +} + +% A simple markup function that calls itself in a loop. +#(define-markup-command (cycle layout props m) + (markup?) + (interpret-markup layout props (make-cycle-markup m))) + +% Two simple markup functions that call each other in a loop. +#(define-markup-command (cycleI layout props m) + (markup?) + (interpret-markup layout props (make-cycleII-markup m))) +#(define-markup-command (cycleII layout props m) + (markup?) + (interpret-markup layout props (make-cycleI-markup m))) + + +\markup { \cycle "a" } +\markup { \cycleI "a" }