music-encoding / sibmei

Sibelius MEI Plugin
MIT License
39 stars 16 forks source link

Strange behaviour of test-lyrics #150

Open annplaksin opened 4 years ago

annplaksin commented 4 years ago

To test pr #149 I deleted the @wordpos from that element in lyrics.mei:re,` And the test results where:

 1) Lyrics
       wordpos
         marks terminal syllables (@wordpos='t'):
     AssertionError [ERR_ASSERTION]: value for wordpos not found on element index 3 (syl) ("<syl xmlns="http://www.music-encoding.org/ns/mei" xml:id="m-50">re,</syl>")
      at Object.assertAttrOnElements (test\mocha\utils.js:21:16)
      at Context.it (test\mocha\test-lyrics.js:35:13)

  2) Lyrics
       wordpos
         handles single syllable words (omit @wordpos):
      AssertionError [ERR_ASSERTION]: value for wordpos unexpectedly found on element index 3 (syl) ("<syl xmlns="http://www.music-encoding.org/ns/mei" xml:id="m-50">re,</syl>")
      + expected - actual
      at Object.assertAttrOnElements (test\mocha\utils.js:23:16)
      at Context.it (test\mocha\test-lyrics.js:38:13)

Number 1 is totally obvious, I provoked that... but I don't understand why number 2 is showing up. It's kind of contradictory.
The arrays of indices seem fine to me... and when I put the attribute back, again all tests are running without errors.

As long as the tests don't fail to detect errors, it's not a huge problem, but it might be worth to look into this at some time in the future.