]> git.donarmstrong.com Git - lilypond.git/blobdiff - input/regression/markup-depth-non-terminating.ly
Imported Upstream version 2.16.0
[lilypond.git] / input / regression / markup-depth-non-terminating.ly
diff --git a/input/regression/markup-depth-non-terminating.ly b/input/regression/markup-depth-non-terminating.ly
new file mode 100644 (file)
index 0000000..76db67f
--- /dev/null
@@ -0,0 +1,16 @@
+\version "2.16.0"
+#(ly:set-option 'warning-as-error #f)
+#(ly:expect-warning (ly:translate-cpp-warning-scheme "Markup depth exceeds maximal value of %d; Markup: %s") 1024 "recursive-explosion-markup")
+
+\header {
+  texidoc = "Markups have a maximum depth to prevent non-termination."
+
+}
+
+% A simple markup function that calls itself and increases its argument, so
+% it will grow forever, unless we terminate it.
+#(define-markup-command (recursive-explosion layout props nr)
+  (number?)
+  (interpret-markup layout props (make-recursive-explosion-markup (+ nr 1))))
+
+\markup { Test: \recursive-explosion #1 }