Add test for clearing buffer