Add unit tests.

Thanks! I knew something was wrong, but I didn't know the correct idiom.