Add test case for nd array sorting