Add tests for array sorting