Small fix: avoid leaving files after tests run
Description
Problem: after I run tests, I constantly get Sample.tz
and
Sample2.tz
files appearing as unstaged in git status.
Solution: normally tests should not leave any files, maybe except for in the temp directory.
Here we rather check that files are created and simultaneously delete them.
Also applied some minor refactoring, namely to avoid using
Control.Exception
and use try
and throwM
from Prelude
's (which
re-exports methods from exceptions-safe
package). This is pretty
actual here since we don't want to catch user interrupts and other async
exceptions, rather only exceptions related to the current test suite.
Related issue(s)
✅ Checklist for your Merge Request
Related changes (conditional)
-
Tests (see short guidelines)
-
If I added new functionality, I added tests covering it. -
If I fixed a bug, I added a regression test to prevent the bug from silently reappearing again.
-
-
Documentation
Stylistic guide (mandatory)
-
My commits comply with the following policy. -
My code complies with the style guide.
Edited by Konstantin Ivanov