Skip to content

Commit

Permalink
[Truffle] - More Random specs passing.
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasallan committed Mar 17, 2015
1 parent 6d8b0eb commit 7c3b89b
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 2 deletions.
2 changes: 0 additions & 2 deletions spec/truffle/tags/core/random/new_seed_tags.txt
@@ -1,3 +1 @@
fails:Random.new_seed returns a Bignum
fails:Random.new_seed returns an arbitrary seed value each time
fails:Random.new_seed is not affected by Kernel#srand
1 change: 1 addition & 0 deletions truffle/src/main/ruby/core.rb
Expand Up @@ -74,6 +74,7 @@
require_relative 'core/rubinius/common/time'
require_relative 'core/rubinius/common/true'
require_relative 'core/rubinius/common/random'
require_relative 'core/rubinius/common/thread'

require_relative 'core/rubinius/common/rational'
require_relative 'core/rubinius/common/rationalizer'
Expand Down
37 changes: 37 additions & 0 deletions truffle/src/main/ruby/core/rubinius/common/thread.rb
@@ -0,0 +1,37 @@
# Copyright (c) 2007-2014, Evan Phoenix and contributors
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright notice
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
# * Neither the name of Rubinius nor the names of its contributors
# may be used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# Only part of Rubinius' thread.rb
# Extracted from https://github.com/rubinius/rubinius/blob/v2.4.1/kernel/common/thread.rb
#

class Thread

def randomizer
@randomizer ||= Rubinius::Randomizer.new
end

end

0 comments on commit 7c3b89b

Please sign in to comment.