Add unit tests for tty module.