https://kotlinlang.org logo
Join Slack
Powered by
# power-assert
  • b

    bnorm

    04/23/2024, 12:50 PM
    set the channel topic: Kotlin Power-Assert compiler plugin (Doc link TBD)
  • b

    bnorm

    04/23/2024, 12:50 PM
    set the channel description: Discussion of the Power-Assert compiler plugin for Kotlin and all things related.
  • j

    jw

    05/23/2024, 1:08 PM
    set the channel topic: Kotlin Power-Assert compiler plugin (https://kotl.in/power-assert)
    thank you color 2
  • n

    natpryce

    05/23/2024, 1:28 PM
    Q: what’s the best way to configure power-assert once for every subproject of a multi-project Gradle build?
    h
    • 2
    • 2
  • b

    buszi0809

    05/23/2024, 4:01 PM
    Hi, I wanted to try out Power-Assert on my Android project, but it just does not work When I perform the same setup for a random JVM application on IntelliJ Idea it works correctly
    b
    • 2
    • 6
  • d

    Dmitry Kandalov

    05/29/2024, 9:16 PM
    👋 What about the old issues on GitHub https://github.com/bnorm/kotlin-power-assert/issues Should they be moved to Youtrack?
    b
    • 2
    • 1
  • n

    natpryce

    05/30/2024, 3:31 PM
    Feature request: documentation with examples of using and configuring power-assert in Maven builds
  • n

    natpryce

    05/31/2024, 9:45 AM
    Does anyone have an example of using power-assert in a Maven build? I cannot for the life of me configure the power-assert compiler plugin to instrument my tests
    b
    a
    • 3
    • 11
  • n

    natpryce

    05/31/2024, 9:45 AM
    and there is no documentation of using power-assert in Maven
  • n

    natpryce

    06/04/2024, 12:41 PM
    I’ve got a tiny project that reliably makes power-assert crash the Kotlin compiler. However, I cannot raise a defect in YouTrack, because YouTrack is throwing assertion failures:
    😂 1
  • n

    natpryce

    06/04/2024, 12:44 PM
    Anyone know if this is a known issue, and if there’s an ETA for YouTrack being available again?
  • n

    natpryce

    06/04/2024, 2:50 PM
    YouTrack is back.
  • n

    natpryce

    06/04/2024, 2:50 PM
    And I’ve reported the bug: https://youtrack.jetbrains.com/issue/KT-68807
    thank you color 1
  • c

    CLOVIS

    06/05/2024, 9:30 AM
    If anyone in this channel is using #kotest, you may want to follow https://github.com/kotest/kotest/issues/4044
  • d

    dmcg

    06/07/2024, 12:14 PM
    What’s that you say - you’d like to learn more about power-assert but can’t find any video content anywhere and JetBrains haven’t gotten round to publishing the KotlinConf presentation?

    https://youtu.be/ujxNvC_Q_cA▾

    🔥 1
    b
    • 2
    • 4
  • d

    dmcg

    06/10/2024, 7:11 AM
    Today I learned that c# implemented linq by enhancing the compiler to pass an AST to any function that takes Expression<T>. Is that a thing that could be done for Kotlin and used to implement power-assert in a more general way?
    b
    • 2
    • 1
  • d

    dmcg

    06/14/2024, 1:05 PM
    Hacking Kotlin Power Assert

    https://youtu.be/kqe7bVp_vYY▾

    🔥 1
    b
    • 2
    • 2
  • c

    CLOVIS

    06/15/2024, 4:13 PM
    It's not explicitly written in the doc: what is the versioning scheme? Will it always follow the Kotlin version?
    j
    b
    • 3
    • 2
  • c

    czuckie

    06/24/2024, 5:55 PM
    Just caught the kotlinconf talk on YouTube. Power-assert looks like a magic I'm scared of describing in 2024, amazing work!
    ➕ 1
  • d

    dewildte

    06/25/2024, 10:46 PM
    I am super excited about this! However I am not able to get it working and not sure why 😕 Does it work in the shared directory in a multiplatform app?
    c
    b
    • 3
    • 2
  • j

    Joao Parracho

    06/27/2024, 8:06 AM
    hello, I’m trying to use it in a multiplatform project, that only has android and ios, but it doesn’t seem to work even with the “includedSourceSets”, when I run the tests in commonTest I get the following options in the image, if I run with iosSimulatorArm64 it works, but with the android one it doesn’t, the issue is that we run the tests on a pipeline which always runs them in the android mode, can anyone help?
    b
    • 2
    • 5
  • b

    bnorm

    06/28/2024, 2:13 PM
    For anyone struggling with matching source set names with
    includedSourceSets
    , this task will print out all available options in a multiplatform project:
    Copy code
    tasks.create("printSourceSets") {
        doLast {
            kotlin.targets.forEach { target ->
                target.compilations.forEach { compilation ->
                    println(compilation.defaultSourceSet.name)
                }
            }
        }
    }
    ❤️ 2
  • j

    Joao Parracho

    07/01/2024, 8:18 AM
    Hello again, I’ve also included it on an Android project, and it seems to be working, but for instrumented tests I get a really messed up formatting. Example:
    b
    • 2
    • 6
  • c

    CLOVIS

    07/22/2024, 1:27 PM
    Where is the power assert issue tracker? I did a demo at my workplace today and… I have a few things to report 😇
    b
    • 2
    • 18
  • b

    bnorm

    08/22/2024, 2:45 PM
    Looking for a little feedback if people are willing to share! ✍️ For those that are using power-assert: 1. What functions do you most often configure for power-assert transformation? 2. What source sets do you most often configure for power-assert transformation?
    c
    • 2
    • 1
  • p

    PHondogo

    09/10/2024, 9:03 PM
    It would be nice to have arrays show content. Now it is like this:
    Copy code
    java.lang.AssertionError: 
    assertContentEquals(value, valueRet)
                        |      |
                        |      [B@6c1d2a61
                        [B@1840d643
    b
    • 2
    • 1
  • c

    CLOVIS

    09/21/2024, 12:10 PM
    Just to praise Power Assert a bit… Code:
    Copy code
    assertEquals(6.right(), 5.successful().withProgress(loading(0.2)).toEither())
    Before:
    Copy code
    Expected :Either.Right(6)
    Actual   :Either.Right(5)
    With Power Assert:
    Copy code
    assertEquals(6.right(), 5.successful().withProgress(loading(0.2)).toEither())
                   |          |            |            |             |
                   |          |            |            |             Either.Right(5)
                   |          |            |            Loading(20%)
                   |          |            Success(value=5, progress=Loading(20%))
                   |          Success(value=5)
                   Either.Right(6)
    Expected :Either.Right(6)
    Actual   :Either.Right(5)
    🚀 2
  • r

    rocketraman

    09/30/2024, 1:45 PM
    I've just added power assert to the shared sub-module of a multiplatform project, Kotlin 2.0.10 and the jetbrains power assert plugin. But, for some reason it is not working on my
    commonTest
    sources, even if I set
    commonTest
    explicitly in the
    includedSourceSets
    . It has worked for me on other projects... not sure why it isn't working on this one.
    b
    • 2
    • 5
  • r

    rocketraman

    10/25/2024, 4:31 PM
    Is there any way to avoid the
    ExperimentalKotlinGradlePluginApi
    warnings when power assert is loaded in a convention plugin? All builds get errors that look like this:
    Copy code
    w: file:///home/raman/.../buildSrc/build/generated-sources/kotlin-dsl-accessors/kotlin/gradle/kotlin/dsl/accessors/_b37aeb87f95e53da65bc4a78666b15f2/Accessorsatef9dvwop5esd1nvo708sdz1.kt:65:45 Experimental API in the Kotlin Gradle Plugin: No stability guarantees can be provided. The API could get removed in the future without replacement
    ➕ 1
    b
    • 2
    • 1
  • c

    CLOVIS

    07/18/2025, 7:37 PM
    What's the configuration to be able to use Power Assert in
    commonMain
    ? I have a module that contains fixtures. I have
    Copy code
    powerAssert {
    	functions = listOf("kotlin.check")
    	includedSourceSets = listOf("commonMain", "jvmMain", "jsMain", "nativeMain")
    }
    but I still get
    Copy code
    Check failed.
    java.lang.IllegalStateException: Check failed.
    	at opensavvy.ktmongo.bson.raw.TimestampTestKt.timestamp$lambda$9$lambda$5(TimestampTest.kt:69)
    without Power Assert's message
    b
    • 2
    • 26