此代码不匹配.它是否正确?
List(1, List(2, 3, List(4)), 5) must containTheSameElementsAs(List(5, List(List(4), 2, 3), 1))
错误消息如下:
[error] x be available for elements in a sequence [error] List(1, List(2, 3, List(4)), 5) [error] is missing: List(List(4), 2, 3) [error] must not contain: List(2, 3, List(4)) (specs2test.scala:98)
小智.. 5
该containsTheSameElementsAs
匹配唯一无二一级深,所以比赛的嵌套列表上失败List(2, 3, List(4)) != List(List(4), 2, 3)
.在使用此匹配器之前简单地展平嵌套对象可能更好.
该containsTheSameElementsAs
匹配唯一无二一级深,所以比赛的嵌套列表上失败List(2, 3, List(4)) != List(List(4), 2, 3)
.在使用此匹配器之前简单地展平嵌套对象可能更好.