Add test for rank()