Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Ovid (2709)

Ovid
  (email not shown publicly)
http://publius-ovidius.livejournal.com/
AOL IM: ovidperl (Add Buddy, Send Message)

Stuff with the Perl Foundation. A couple of patches in the Perl core. A few CPAN modules. That about sums it up.

Journal of Ovid (2709)

Tuesday July 25, 2006
09:40 AM

Testing fun!

[ #30418 ]

Since I'm trying to encourage testing at my new job, I check in code with plenty of tests. Some of today's code goes through directories and applies actions to the various files it finds in there, including moving them. A very common failure case when doing this is when the source and target have the same name. Today, I was asked what would happen if that occurs. I pointed out that this meant the file would be processed "in place" and that we needed this feature.

Him: OK, but this could break. Would you write some tests for it?
Me: Hmm, I guess I didn't do that.

... time passess ...

Me: I'll bet you enjoyed that.
Him: What?
Me: Having me write the tests because you saw the bug.
Him: What bug?

Silly me. I was writing out to the source file and then unlinking the target file. Oops. Neither of us noticed that.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.