... This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
... If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.

(.using
 [library
  [lux (.except)
   [abstract
    ["[0]" monad]]
   [data
    [collection
     ["[0]" list]
     ["[0]" set]]]
   [math
    ["[0]" random (.only Random)]
    [number
     [/64
      ["[0]" natural]]]]
   [macro
    ["[0]" expansion]
    ["[0]" template]]
   [test
    ["_" property (.only Test)]]]]
 [\\library
  ["[0]" /]])

(expansion.let [<options> (these /.mute

                                 /.ppp
                                 /.pp
                                 /.p
                                 /.mp
                                 
                                 /.mf
                                 /.f
                                 /.ff
                                 /.fff
                                 )]
  (the .public test
    Test
    (<| (_.covering /._)
        (monad.let [! random.monad]
          [])
        (_.for [/.Velocity])
        (`` (all _.and
                 (_.coverage [<options>]
                   (let [options (is (List /.Velocity)
                                     (list <options>))
                         uniques (set.of_list natural.hash options)]
                     (natural.= (list.size options)
                                (set.size uniques))))
                 (,, (template.with [<short> <long>]
                       [(_.coverage [<long>]
                          (same? <short>
                                 <long>))]

                       [[/.ppp /.pianississimo]
                        [/.pp /.pianissimo]
                        [/.p /.piano]
                        [/.mp /.mezzo_piano]
                        
                        [/.mf /.mezzo_forte]
                        [/.f /.forte]
                        [/.ff /.fortissimo]
                        [/.fff /.fortississimo]]))
                 )))))
