It seems the hidden test suite doesn't check order extensively since the reference solution shows inconsistent behavior with the handout. Here are some orderless test cases.
labt/ for sec2/
matcht/ for sec3/
Note1: Even reference solution failed some test cases, so... caveat emptor...
Note2: tests.sml
will be overwritten. If you want to keep it, please backup
Feel free to fork and make pull request to add more test cases