Print r to check the o/p and write tests accordingly