morgant / git-resource-fork-hooks

Git hooks for projects containing old Mac HFS/HFS+ resource forks
MIT License
10 stars 1 forks source link

Add test suite #2

Open morgant opened 5 years ago

morgant commented 5 years ago

I tested this when I wrote it, but—esp. since it’s relying on several third party tools—it really needs some functional tests to be implemented to try to catch any edge cases.

morgant commented 5 years ago

I have used & liked Blake Mizerany’s roundup for testing shell scripts, plus have used it with TravisCI (see realpath‘s .travis.yml).

morgant commented 5 years ago

In investigating today, I believe the best way to implement tests is to use Rez/DeRez to create & verify the resource fork data before & after any conversions (probably just a 'STR ' resource, or something). I'm having some difficulty digging up good documentation on the format, of course. I'll dig some more.

morgant commented 5 years ago

I was able to find enough information in the Rez manual and Inside Macintosh: More Macintosh Toolbox to piece together a Rez command to build a file with a resource fork. I've added a test for whether forks are split upon commit using that method.

morgant commented 5 years ago

I've added test suites for Rez, SplitForks, and FixupResourceForks to confirm they work as expected/documented, plus to confirm my methodology for testing resource forks & AppleDouble files. You can find them and my progress on tests for the hooks in my roundup_tests branch.