add test for CLEARERR
CLEAR_ERR implemented
tests: don't print tty errors which mean that test passed
add pre-commit hook with tests