Skip to content

The Fairy Tale Beauty of Unit Testing

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.isfull():
    elf.makeshoe()
ok(shelf.is_full())

Yea, I’m weird. I know.