add test case for function