Sha256: 74e8608ee6e805f767f88b9f692ecfc3b4b6e78ec339743072654e1989b16401

Contents?: true

Size: 365 Bytes

Versions: 1

Compression:

Stored size: 365 Bytes

Contents

require 'queencheck/arbitrary'

class Integer
  arbitrary QueenCheck::Gen.quadratic(1<<20).bind { |n|
    QueenCheck::Gen.rand.resize(-(n.ceil), n.ceil)
  }
end

class Fixnum
  arbitrary Integer.arbitrary.gen
end

class Bignum
  arbitrary QueenCheck::Gen.quadratic(1<<20, 1, (1 << (0.size * 8))).bind {|n|
    QueenCheck::Gen.rand.resize(-(n.ceil), n.ceil)
  }
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
queencheck-1.0.0 lib/queencheck/arbitraries/integer.rb