test sorting function with links