Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我看过一些范围的例子。
断言 (0.0 .. 1.0).contains(0.5)
我希望这个是真的,但我对此是假的?
任何线索为什么这个断言失败了?
Agroovy.lang.Range是一个值,在这种情况下是两个List。这就是Comparable为什么List.contains返回false. 0.5你想要的是Range.containsWithinBounds.
groovy.lang.Range
List
Comparable
List.contains
false
0.5
Range.containsWithinBounds