question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Arb.set with a range hangs the test if the given gen inside the set cannot produce enough values for the range

See original GitHub issue

Found in Kotest version 4.3.2

Example

  "test set of enum with less than 3 elements hangs" {
                checkAll(Arb.set(Arb.enum<Enum>(), 1..3)) {
                    it shouldContain Enum.SingleValue
                }
            }

enum class Enum {
        SingleValue // I also tried this with 2 elements in the enum and it hangs. 3 elements would not hang.
    }

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
ataronetcommented, Dec 24, 2020

+1 for the second opinion from me too. This is a kind of wrongly using the Arbs so I’d understand much quicker what’s going on with a exception. Similarly there is an exception when you have too many edge cases with too few iterations for your test. To me it is the same thing - just the other way around, too few options for the test to run. Thank you both.

1reaction
sksamuelcommented, Jan 4, 2021

@myuwono Do you want to add a PR for this? If not I will try to find time before I release 4.4 in the next two days.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Arb.set with a range hangs the test if the given gen inside the set ...
Arb.set with a range hangs the test if the given gen inside the set cannot produce enough values for the range.
Read more >
Generators | Kotest
Kotest has two types of generators - Arb for generating arbitrary (random) values and Exhaustive for generating a finite set of values in...
Read more >
California Exhaust Emission Standards and Test Procedured ...
“All-Electric Range Test” or “AERT” means a test sequence used to determine the range of an electric vehicle or of a hybrid electric...
Read more >
Kotlin - Random numbers without repeating - Stack Overflow
with a medium size range of numbers, record the numbers you have picked, ... sort the values .sorted() // and collect them into...
Read more >
Math208 Discrete Mathematics - College of Arts & Sciences
in the statement If I study, then I will pass the test, there is an assumed ... With a given predicate, there is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found