Ed The Dev .com

Edward Delaporte's Technical Journal

The Fairy Tale Beauty of Unit Testing

no comment

To demonstrate the incredible beauty of unit testing, I have composed this short script. Imagine how much better your favorite fairy-tales would be if they conformed to modern programming best practices!

ok(here.contains('shoemaker'))
ok(now() >= midnight)
ok(now() <= sunrise)
elf.enter()
while not shelf.is_full():
    elf.make_shoe()
ok(shelf.is_full())

Yea, I’m weird. I know.

Leave a Reply

You must be logged in to post a comment.