How to use ScalaTest “contain allOf” on two lists?

前端 未结 3 1186
礼貌的吻别
礼貌的吻别 2021-01-17 13:45

I was looking for a ScalaTest matcher to check that a list contains all of the needed elements (given within another list), but that may also be others.

contai

3条回答
  •  鱼传尺愫
    2021-01-17 14:23

    Bill Venners had this to say on the ScalaTest mailing list:

    Yes, we didn't want to hold up the 2.0 release to add that, but have since added it. I believe we added it to master, though, not the 2.2.x branch. Regardless, the syntax looks like:

    xSet should contain allElementsOf (ySet)

    Link to the message.

提交回复
热议问题