%% Generated by lilypond-book
%% Options: [exampleindent=10.16\mm,indent=0\mm,line-width=160\mm,paper-height=845.047\pt,paper-width=597.508\pt,papersize='(cons (* 597.508 pt) (* 845.047 pt))]
\include "lilypond-book-preamble.ly"


% ****************************************************************
% Start cut-&-pastable-section
% ****************************************************************

#(ly:set-option 'eps-box-padding 3.000000)



\paper {
  #(set-paper-size '(cons (* 597.508 pt) (* 845.047 pt)))
  indent = 0\mm
  line-width = 160\mm
  % offset the left padding, also add 1mm as lilypond creates cropped
  % images with a little space on the right
  line-width = #(- line-width (* mm  3.000000) (* mm 1))
}

\layout {
  
}




% ****************************************************************
% ly snippet:
% ****************************************************************
\sourcefilename "/lilypond-2.26.0/input/regression/other/beat-base-alternating.ly"
\sourcefileline 0
\version "2.25.27"

\header {
  texidoc = "This is a set of tests of the @code{beat-base} Scheme function for
strictly alternating time signatures.  Problems are reported in the standard
error stream."
}

\include "testing-functions.ily"
#(ly:set-option 'warning-as-error #t)

#(expect-equal "no signatures found in settings"
  (beat-base
   '((1 . 11) (4 . 17) ((2 3) . 7))
   '())
  1/17)
#(expect-equal "no signatures found in settings; one denominator zero"
  (beat-base
   '((1 . 11) (4 . 0) ((2 3) . 7))
   '())
  1/11)
#(expect-equal "no signatures found in settings; all denominators zero"
  (beat-base
   '((1 . 0) (2 . 0))
   '())
  +inf.0)

%% We don't expect a strictly alternating time signature to have its own entry
%% in the settings, but there is value in testing it.
#(expect-equal "full signature found in settings; no base found"
  (beat-base
   '((1 . 11) (4 . 17))
   '((((1 . 11) (4 . 17)) . ())))
  1/17)
#(expect-equal "full signature found in settings; base found"
  (beat-base
   '((1 . 11) (4 . 17))
   '((((1 . 11) (4 . 17)) . ((beatBase . 1/13)))))
  1/13)

#(expect-equal "first component base found in settings"
  (beat-base
   '((1 . 2) (3 . 4))
   '(((1 . 2) . ((beatBase . 1/5)))))
  1/5)
#(expect-equal "second component base found in settings"
  (beat-base
   '((1 . 2) (3 . 4))
   '(((3 . 4) . ((beatBase . 1/7)))))
  1/7)
#(expect-equal "all component bases found in settings; all finite"
  (beat-base
   '((1 . 2) (3 . 4) (5 . 6))
   '(((1 . 2) . ((beatBase . 1/11)))
     ((3 . 4) . ((beatBase . 1/5)))
     ((5 . 6) . ((beatBase . 1/7)))))
  1/11)
#(expect-equal "all component bases found in settings; one +inf.0"
  (beat-base
   '((1 . 2) (3 . 4))
   '(((1 . 2) . ((beatBase . 1/9)))
     ((3 . 4) . ((beatBase . +inf.0)))))
  1/9)
#(expect-equal "all component bases found in settings; all +inf.0"
  (beat-base
   '((1 . 2) (3 . 4))
   '(((1 . 2) . ((beatBase . +inf.0)))
     ((3 . 4) . ((beatBase . +inf.0)))))
  +inf.0)



% ****************************************************************
% end ly snippet
% ****************************************************************
