• breandan

    breandan

    2 years ago
    Are there any good resources for writing shrinkers in a more principled way? It seems like writing a shrinker for custom datatypes is usually more efficient than using a predefined shrinker. But some PBT tools attempt to use automatic shrinking and caching, so maybe the benefits are negligible, cf. https://github.com/JetBrains/jetCheck. There is an interesting discussion about the benefits of integrating shrinking vs. using a predefined strategy: https://hypothesis.works/articles/integrated-shrinking/ https://www.well-typed.com/blog/2019/05/integrated-shrinking/ I was curious about the default shrinker implementations in KotlinTest: https://github.com/kotlintest/kotlintest/blob/master/kotest-assertions/src/commonMain/kotlin/io/kotest/properties/shrinking/DoubleShrinker.kt https://github.com/kotlintest/kotlintest/blob/master/kotest-assertions/src/commonMain/kotlin/io/kotest/properties/shrinking/IntShrinker.kt Is there a good reason for using those ratios in the geometric series?
    breandan
    j
    2 replies
    Copy to Clipboard
  • simon.vergauwen

    simon.vergauwen

    2 years ago
    Is there a way to get more descriptive error messages in KotlinTest when using property based testing?
    Property failed for
    Arg 0: Tuple3(a=1892782087, b=-1623939597, c=833942858)
    after 1 attempts
    Caused by: expected: true but was: false
    java.lang.AssertionError: Property failed for
    Arg 0: Tuple3(a=1892782087, b=-1623939597, c=833942858)
    after 1 attempts
    Caused by: expected: true but was: false
    simon.vergauwen
    sam
    13 replies
    Copy to Clipboard
  • simon.vergauwen

    simon.vergauwen

    2 years ago
    Also I am seeing something where were not tests finish in IntelliJ until all finish
    simon.vergauwen
    sam
    3 replies
    Copy to Clipboard
  • LeoColman

    LeoColman

    2 years ago
    This seems to be an issue with Android Studio integration with JUnit... If you run via
    ./gradlew test
    do all tests run?
    LeoColman
    dave08
    +1
    88 replies
    Copy to Clipboard
  • r

    Ricjhill

    2 years ago
    in kotlin test they seem to be there for readability
    r
    1 replies
    Copy to Clipboard
  • t

    thanksforallthefish

    2 years ago
    I’d like to show kotlintest to my new peer (currently we are using junit+assertj but I had this experience in previous company with kotlintest and like it more), however I am still having some issues with intellij plugin. for instance, I cannot run single tests, it always run the entire class (I see https://github.com/kotlintest/kotlintest-intellij-plugin/issues/23 so I guess I am not alone) and the integration with the run window (right click on a single test to re-run it or jumping from failing test to failing assertion for instance) does not work. are these problems known or should I invest some time to describe them in more details in an official github issue? to complicate things (maybe) I am on mac
    t
    wasyl
    +1
    16 replies
    Copy to Clipboard
  • sam

    sam

    2 years ago
    Try the assertions 4.0 snapshot
    sam
    simon.vergauwen
    4 replies
    Copy to Clipboard
  • sam

    sam

    2 years ago
    I’ll include this in the 4.0 beta
    sam
    1 replies
    Copy to Clipboard
  • Sam Garfinkel

    Sam Garfinkel

    2 years ago
    There’s a matcher
    beOfType(expected: KClass<*>)
    which does this, so I guess you can just use
    shouldBe beOfType(clazz)
    Sam Garfinkel
    1 replies
    Copy to Clipboard
  • m

    Mike

    2 years ago
    Awesome! Just keeps getting better and better. Thank you.
    m
    1 replies
    Copy to Clipboard