I'm building a dotfiles manager program for uni in rust, and looking for ways to test aspects of the program. As far as I can see, it can be broken into 2 parts:
- unit testing for logic and individual functions
- testing that it does what it should do irl (eg. correctly moving/renaming/linking files)
The first one isn't a problem, but for the second one I'm at a loss. It needs to be able to run in a confined environment, so if it does do something stupid it won't rm -rf $HOME
or worse on me.
So my question is, are there any standard/good methods of testing programs like this? Are there tools available that would do what I'm wanting?
The only tools I've found so far seem to be custom built (like the test scripts for rcm for example), or Aruba (which seems like it could work, but I'm struggling to see how this could be used effectively in this case - especially since it involves heaps of files and directories.
Thanks.
EDIT: seems stackoveflow doesn't like this style of question (asking for opinions). Still interested in a definitive answer to this, assuming one exists of course. Maybe this is a program that needs to be written? For my project I ended up using custom bash scripts - not super ideal and doesn't run in a confined environment, but was the best option I could come up with.