quick-sampler 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/quick/sampler/dsl/simple_combinators.rb +3 -17
- data/lib/quick/sampler/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7f81ad0d5f37da0956dca3b19ec8734ae4ddb673
|
4
|
+
data.tar.gz: 12467152b7750200a431b2fb4a331687e37cf8b4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 33f9a893f91e642315d47e8b5b8f72b95fda8fdb3e9683f38ccda63e792547a5a97a0c341905e2977b7dcdca501e9a86a8eb2c6cc32fd918053c43883e2aa606
|
7
|
+
data.tar.gz: ab1d83d5bd017cff91ca39c285eba42c98878ba2e821019f6b24cbdfd1b5c166c667653a9a1e5b424c0ba7422266bfe8a7faa002a367d4dc966a350e032f0fb5
|
@@ -45,31 +45,17 @@ module Quick
|
|
45
45
|
|
46
46
|
# Sampler of uniform arrays
|
47
47
|
#
|
48
|
-
# **Rosetta stone** the single argument version corresponds to QuickCheck's `listOf`.
|
49
|
-
# Passing `non_empty: true` turns it into QuickCheck's `listOf1`.
|
50
|
-
#
|
51
48
|
# @return [Quick::Sampler]
|
52
49
|
# a sampler that produces arrays of values sampled from its argument
|
53
50
|
# @param [Quick::Sampler] sampler
|
54
51
|
# a sampler to sample array elements from
|
52
|
+
# @param [Integer, Range, Quick::Sampler<Intger>] size
|
53
|
+
# value to use as, range to pick from or sampler to sample from the list size
|
55
54
|
def list_of sampler, size: 1..10
|
55
|
+
size = pick_from(size) if Range === size
|
56
56
|
send_to(sampler, :first, size)
|
57
57
|
end
|
58
58
|
|
59
|
-
# Sampler of uniform fixed size arrays
|
60
|
-
#
|
61
|
-
# **Rosetta stone** this sampler corresponds to QuickCheck's `vectorOf`.
|
62
|
-
#
|
63
|
-
# @return [Quick::Sampler]
|
64
|
-
# a sampler that produces arrays of `size` of values sampled from `sampler`
|
65
|
-
# @param [Integer] size
|
66
|
-
# sample array size
|
67
|
-
# @param [Quick::Sampler] sampler
|
68
|
-
# a sampler to sample array elements from
|
69
|
-
def vector_of size, sampler
|
70
|
-
feed { sampler.take(size).force }
|
71
|
-
end
|
72
|
-
|
73
59
|
# Sampler of arbitrary nested structures made up of `Array`s, `Hash`es, `Quick::Sampler`s and
|
74
60
|
# non-sampler values
|
75
61
|
#
|