So I'm writing my first serious test script for a module I've written, and I'm finding that I'm writing the same code in the test script as I did in the module.
Does this make me a bad person?
I realize that part of the point of a test is just to make sure the module is complete and in good shape. But it seems wrong to use the same logic. For example, in my module I stat a file to see if the permissions are acceptable, and if not, chmod it. So in my test script I create a file with bad permissions, run my module function to fix it, and then use basically the same code as I did in my module to see if the new permissions are acceptable.
I do hope this makes sense. It just seems to me that I'm not testing my logic very well in my test script if I'm using the same logic as I used in the module--of *course* it works great!
Any input would be greatly appreciated!