diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2013-03-26 19:55:08 -0700 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2013-03-26 19:55:08 -0700 |
| commit | b23cf0965ecd9f2cd11aa3326ffc6a370ed71906 (patch) | |
| tree | fffb8be4f7b46ae21665eb1c9644778a6b41981b /mrbgems/mruby-random/test | |
| parent | 638c5a96d74d0825cc470825c98c94f7fc18bbc5 (diff) | |
| parent | 46c13080f98cf276d1a897fd6588282e84f59028 (diff) | |
| download | mruby-b23cf0965ecd9f2cd11aa3326ffc6a370ed71906.tar.gz mruby-b23cf0965ecd9f2cd11aa3326ffc6a370ed71906.zip | |
Merge pull request #1078 from mattn/test_mruby-random
Add test for mruby-random
Diffstat (limited to 'mrbgems/mruby-random/test')
| -rw-r--r-- | mrbgems/mruby-random/test/random.rb | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/mrbgems/mruby-random/test/random.rb b/mrbgems/mruby-random/test/random.rb new file mode 100644 index 000000000..ef3c6e482 --- /dev/null +++ b/mrbgems/mruby-random/test/random.rb @@ -0,0 +1,24 @@ +## +# Random Test + +assert("Random#srand") do + r1 = Random.new(123) + r2 = Random.new(123) + r1.rand == r2.rand +end + +assert("Kernel::srand") do + srand(234) + r1 = rand + srand(234) + r2 = rand + r1 == r2 +end + +assert("fixnum") do + rand(3).class == Fixnum +end + +assert("float") do + rand.class == Float +end |
