I do this in Common Lisp. It also makes sense as a technique for documentation: why leave examples rusting in comments when you can incorporate them into the program?
Add a Quickcheck-ish type-based test case generator and you start to blur the line between tests and types.