Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //
- //範囲オブジェクトの確認(日付を使って)
- //
- def a = new Date()
- def b = today + 30
- def range = (a..b)
- assert range.getClass() == groovy.lang.ObjectRange
- assert range.contains(a)==true
- // ここがポイント
- assert range.contains( new Date()+1 ) == false
- assert range.containsWithinBounds( new Date()+1 ) == true
Add Comment
Please, Sign In to add comment