mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
random.c : fix Random#rand not returning value
This commit is contained in:
@@ -243,7 +243,7 @@ static mrb_value
|
||||
random_m_rand(mrb_state *mrb, mrb_value self)
|
||||
{
|
||||
rand_state *t = random_ptr(self);
|
||||
random_rand_impl(mrb, t, self);
|
||||
return random_rand_impl(mrb, t, self);
|
||||
}
|
||||
|
||||
static mrb_value
|
||||
|
||||
@@ -137,8 +137,8 @@ assert('Array#sample(random)') do
|
||||
end
|
||||
|
||||
assert("Kernel#rand()") do
|
||||
100.times {
|
||||
assert_include(0.0..1.0, rand)
|
||||
100.times {
|
||||
assert_include(0.0..1.0, rand)
|
||||
assert_include(0...100, rand(0...100))
|
||||
assert_include(0...100, rand(100))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user