【发布时间】:2021-08-23 16:05:52
【问题描述】:
我想为 matcher_1 AND matcher_2 OR matcher_3 and matcher_4 这样的匹配器编写逻辑,其中 matcher_i 只是 hamcrest 匹配器的占位符。
我决定像这样使用CombinableMatcher 编写它-
new CombinableMatcher<String>(matcher_1).and(matcher_2).or(matcher_3).and(matcher_4)
现在,问题是匹配器的评估顺序是什么?
是((((matcher_1) AND matcher_2) OR matcher_3) and matcher_4) 还是
像((matcher_1 AND matcher_2) OR (matcher_3 and matcher_4)) 这样的任何其他订单?
【问题讨论】: