LoginSignup
0
1

More than 5 years have passed since last update.

Rantly(property based testing tool)でテストデータ生成 - guard

Posted at

Rantly#guard でランダムに生成されたデータに特定の条件をつけます

関連記事

tbpgr の rantly 関連記事

サンプル

Rantly(5) { i = range(1, 10); guard i.even?; i }
# => [8, 4, 2, 2, 4]
Rantly(5) { i = range(1, 10); guard i.even?; i }
# => [6, 2, 8, 4, 10]
Rantly(5) { i = range(1, 10); guard i.odd?; i }
# => [9, 5, 3, 1, 7]
Rantly(5) { i = range(1, 10); guard i.odd?; i }
# => [3, 7, 3, 3, 9]

外部資料

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1