tests: Add test for print_exception() function.