A test for rand function