Open rsto opened 7 years ago
It's not just the JMAPCalendars tests, so changing the topic to cover all tests :)
Issue: "assert" statements are supposed to be $self->assert_thing('expected', $actual, 'Description'); but many tests are currently of the form $self->assert_thing($actual, 'expected');
It would be great to correct these so that debugging is clearer, and also describe the tests. Have added "help wanted" flag.
To make things worst, argument order in the asserts is not even consistently wrong: I think to recall that I once reordered the JMAPMail tests, and new tests should have the right order across all the contacts, calendar and mail JMAP tests. But there's still older tests with the wrong order. So there isn't really an obvious way to automate the reordering :(
Yeah, this will be a matter of laboriously picking through by hand. We talked about this before, I think that was the reason we raised an issue and kicked it down the road rather than just getting it done! :)
For what it's worth, I will probably get around to this eventually if no-one else does, cause futzing with Cassandane is what I seem to do when I can't focus on real work! :P
Are there any other files that we know to be problematic in this way? My understanding was it was just the JMAP ones, which are now fixed.
Due to historical reasons, the asserts in JMAPCalendars.pm test for the right results, but the parameters for expected vs test result are flipped. This produces confusing error messages in case a test goes wrong.
Solution: fix argument order in JMAPCalendar asserts.