prop_check 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/run_tests.yaml +2 -3
- data/.tool-versions +1 -1
- data/CHANGELOG.md +8 -0
- data/lib/prop_check/generator.rb +2 -2
- data/lib/prop_check/generators.rb +1 -2
- data/lib/prop_check/property/configuration.rb +1 -2
- data/lib/prop_check/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d78c72da50f662a277a6e41039a55a9d60aa46551bf63c329fc0a4aae3121615
|
4
|
+
data.tar.gz: 7e50bafff5e1bd09058d28af48e418864d4bc7bcedbe9d96b1c44cd4d4cc1b84
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 45c7447b0243c42d8af51147395301010ccc8a9f1d7c63653af5c11d2b3f3dc65250f5a4f36f01548b2336f383a48089de6b10f73566ad0d4753523ff19bdcdc
|
7
|
+
data.tar.gz: 4392af75a1c220df90167bc008dcf02b9d6d2c5756582d1314f50df6e57d9b0e5d3fe8668dd887543aed65c5a1edca1800fccb0480a990eaf81e69ae8da96150
|
@@ -17,15 +17,14 @@ jobs:
|
|
17
17
|
matrix:
|
18
18
|
# NOTE: We're stopping testing Ruby < 3.0 since prop_check version 1.0.0
|
19
19
|
# It will _probably_ still work but as they're end-of-life, no guarantees!
|
20
|
-
ruby-version: ['3.0', '3.1', '3.2']
|
20
|
+
ruby-version: ['3.0', '3.1', '3.2', '3.3', '3.4']
|
21
21
|
|
22
22
|
steps:
|
23
23
|
- uses: actions/checkout@v3
|
24
24
|
- name: Set up Ruby
|
25
25
|
# To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
|
26
26
|
# change this to (see https://github.com/ruby/setup-ruby#versioning):
|
27
|
-
|
28
|
-
uses: ruby/setup-ruby@0a29871fe2b0200a17a4497bae54fe5df0d973aa # v1.115.3
|
27
|
+
uses: ruby/setup-ruby@v1
|
29
28
|
with:
|
30
29
|
ruby-version: ${{ matrix.ruby-version }}
|
31
30
|
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
data/.tool-versions
CHANGED
@@ -1 +1 @@
|
|
1
|
-
ruby 3.
|
1
|
+
ruby 3.2.2
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
- 1.0.2
|
2
|
+
- Fixes:
|
3
|
+
- When calling `Generator#sample` or `Generator#call`, the options are now merged with the default options _once_, resulting in a slight speedup. (c.f. [#24](https://github.com/Qqwy/ruby-prop_check/pull/24), thank you, @niku!)
|
4
|
+
- Documentation fixes:
|
5
|
+
- Ordering of Property::Configuration options is now alphabetical. (c.f. [#23](https://github.com/Qqwy/ruby-prop_check/pull/23). Thank you, @niku!)
|
6
|
+
- 1.0.1
|
7
|
+
- Fixes:
|
8
|
+
- The invariants of the of the `min` option for the `array` generator were not checked correctly, sometimes causing arrays with too small lengths to be generated. (c.f. [#26](https://github.com/Qqwy/ruby-prop_check/pull/26). Thank you, @olafura!)
|
1
9
|
- 1.0.0
|
2
10
|
- Changes:
|
3
11
|
- Pretty-print failures using Ruby's builtin `PP`, so `prop_check` no longer depends on the `awesome_print` gem. (c.f. #19)
|
data/lib/prop_check/generator.rb
CHANGED
@@ -55,7 +55,7 @@ module PropCheck
|
|
55
55
|
# >> Generators.integer.call(size: 1000, rng: Random.new(42))
|
56
56
|
# => 126
|
57
57
|
def call(**kwargs)
|
58
|
-
generate(
|
58
|
+
generate(**kwargs).root
|
59
59
|
end
|
60
60
|
|
61
61
|
##
|
@@ -63,7 +63,7 @@ module PropCheck
|
|
63
63
|
# This is mostly useful for debugging if a generator behaves as you intend it to.
|
64
64
|
def sample(num_of_samples = 10, **kwargs)
|
65
65
|
num_of_samples.times.map do
|
66
|
-
call(
|
66
|
+
call(**kwargs)
|
67
67
|
end
|
68
68
|
end
|
69
69
|
|
@@ -385,8 +385,7 @@ module PropCheck
|
|
385
385
|
end
|
386
386
|
|
387
387
|
private def make_array(element_generator, min, count, uniq)
|
388
|
-
amount = min if count
|
389
|
-
amount = min if count == min && min != 0
|
388
|
+
amount = min if min > (count - min)
|
390
389
|
amount ||= (count - min)
|
391
390
|
|
392
391
|
# Simple, optimized implementation:
|
@@ -12,13 +12,12 @@ module PropCheck
|
|
12
12
|
# - `max_generate_attempts:` The amount of times the library tries a generator in total
|
13
13
|
# before raising `Errors::GeneratorExhaustedError`. c.f. `PropCheck::Generator#where`. (Default: 10_000)
|
14
14
|
# - `max_shrink_steps:` The amount of times shrinking is attempted. (Default: 10_000)
|
15
|
-
# - `max_consecutive_attempts:`
|
16
15
|
# - `max_consecutive_attempts:` The amount of times the library tries a filtered generator consecutively
|
17
16
|
# again before raising `Errors::GeneratorExhaustedError`. c.f. `PropCheck::Generator#where`. (Default: 10_000)
|
18
17
|
# - `default_epoch:` The 'base' value to use for date/time generators like
|
19
18
|
# `PropCheck::Generators#date` `PropCheck::Generators#future_date` `PropCheck::Generators#time`, etc.
|
20
19
|
# (Default: `DateTime.now`)
|
21
|
-
# - `resize_function
|
20
|
+
# - `resize_function:` A proc that can be used to resize _all_ generators.
|
22
21
|
# Takes the current size as integer and should return a new integer.
|
23
22
|
# (Default: `proc { |size| size }`)
|
24
23
|
Configuration = Struct.new(
|
data/lib/prop_check/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: prop_check
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Qqwy/Marten Wijnja
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-03-14 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: PropCheck allows you to do property-based testing, including shrinking.
|
14
14
|
(akin to Haskell's QuickCheck, Erlang's PropEr, Elixir's StreamData). This means
|
@@ -70,7 +70,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
70
70
|
- !ruby/object:Gem::Version
|
71
71
|
version: '0'
|
72
72
|
requirements: []
|
73
|
-
rubygems_version: 3.
|
73
|
+
rubygems_version: 3.4.19
|
74
74
|
signing_key:
|
75
75
|
specification_version: 4
|
76
76
|
summary: PropCheck allows you to do property-based testing, including shrinking.
|