News for hackers. Stuff that matters.
Re:I_suck_and_my_tests_are_order_dependent by IgorPartola on Thursday February 16, 2023 @09:09PM (#34829787)
An even better design is to have the command write out essentially a script file for what it is about to do, then the —-force flag would execute that script rather than start from scratch. That way you avoid having things come up between when you do a dry run and the real deal. This isn’t always applicable but sometimes can be a really nice pattern.
Re:I_suck_and_my_tests_are_order_dependent by calvinmorrison on Thursday February 16, 2023 @09:12PM (#34829809)
this works well for things that are shell scripts, and we certainly had at least one " check the output and then pipe it into sh". But for the most part that falls away when you have a lot of objects and abstractions and stuff.