LoginSignup
0
1

More than 5 years have passed since last update.

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

Posted at

Rantly#range で特定の範囲内でランダムな数値データを作ります

関連記事

tbpgr の rantly 関連記事

サンプル

# 引数を指定しないと INTEGER_MIN と INTEGER_MAX の範囲になる

Rantly(5){range}
# => [955873802895676542, -73831445360495690, -650533643963764624, 1819011983809745432, -931918409250267397]
Rantly(5){range}
# => [-288673784518865905, 1725913149165221655, -909904039256897699, 1826331295261411002, -894810853381165639]

# min と max を指定
Rantly(5){range(2, 5)}
# => [4, 4, 5, 3, 3]
Rantly(5){range(2, 5)}
# => [3, 4, 5, 4, 4]

外部資料

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