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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d97039234e58c965b91cba40c589808d7ac1e4b559355fd4df719edb89f7b837
4
- data.tar.gz: a87f0c2377918f4d05c6b1d06838b0581a01b21ddba4a1e74929e046cc33f5d0
3
+ metadata.gz: d78c72da50f662a277a6e41039a55a9d60aa46551bf63c329fc0a4aae3121615
4
+ data.tar.gz: 7e50bafff5e1bd09058d28af48e418864d4bc7bcedbe9d96b1c44cd4d4cc1b84
5
5
  SHA512:
6
- metadata.gz: 6821b9be704593dcf577c8b9e29191e731009358faf0f3f4405b8333e8246681cbc76327bbb4f74d9a748f255ba65e2379cdadf51b3fa601746f2db89ba5e906
7
- data.tar.gz: 3aa1b4d7313e5713ec9a2960461f89b7b14f265dabe57fe8c5040ce99450f66a61280e903df50879176a5850c56e802d9650f4c952968ab69c5b0030c1349d74
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
- # uses: ruby/setup-ruby@v1
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.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)
@@ -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(**@@default_kwargs.merge(kwargs)).root
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(**@@default_kwargs.merge(kwargs))
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 < min
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` A proc that can be used to resize _all_ generators.
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(
@@ -1,3 +1,3 @@
1
1
  module PropCheck
2
- VERSION = '1.0.0'
2
+ VERSION = '1.0.2'
3
3
  end
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.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: 2024-02-17 00:00:00.000000000 Z
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.3.26
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.