From 42c92458b243a00aa1394756db297f8e5e60eabd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivan=20=E2=80=9CCLOVIS=E2=80=9D=20Canet?= Date: Thu, 19 Oct 2023 13:43:03 +0200 Subject: [PATCH 1/5] Mention ignoreErrors in nullable's documentation (#3139) Co-authored-by: Simon Vergauwen --- .../src/commonMain/kotlin/arrow/core/raise/Builders.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/raise/Builders.kt b/arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/raise/Builders.kt index 3acfc9fdaae..5d2e0d4cec0 100644 --- a/arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/raise/Builders.kt +++ b/arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/raise/Builders.kt @@ -42,6 +42,9 @@ public inline fun either(@BuilderInference block: Raise.() -> * * Read more about running a [Raise] computation in the * [Arrow docs](https://arrow-kt.io/learn/typed-errors/working-with-typed-errors/#running-and-inspecting-results). + * + * @see NullableRaise.ignoreErrors By default, `nullable` only allows raising `null`. + * Calling [ignoreErrors][NullableRaise.ignoreErrors] inside `nullable` allows to raise any error, which will be returned to the caller as if `null` was raised. */ public inline fun nullable(block: NullableRaise.() -> A): A? = merge { block(NullableRaise(this)) } From ac8e7df76ad240ebd43db1df316a3ff8b5bb66cb Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 19 Oct 2023 16:27:41 +0200 Subject: [PATCH 2/5] Update all dependencies (#3132) * Update all dependencies | datasource | package | from | to | | -------------- | --------------------------------------------------------------------- | ------- | ------- | | gradle-version | gradle | 8.3 | 8.4 | | maven | com.diffplug.spotless:com.diffplug.spotless.gradle.plugin | 6.21.0 | 6.22.0 | | maven | com.squareup.okhttp3:mockwebserver | 4.11.0 | 4.12.0 | | maven | com.gradle.enterprise:com.gradle.enterprise.gradle.plugin | 3.15 | 3.15.1 | | maven | org.jetbrains.kotlinx.kover:org.jetbrains.kotlinx.kover.gradle.plugin | 0.7.3 | 0.7.4 | | maven | org.jetbrains.dokka:org.jetbrains.dokka.gradle.plugin | 1.9.0 | 1.9.10 | | maven | io.github.classgraph:classgraph | 4.8.162 | 4.8.163 | * Update EvalJvmTest.kt * Update EvalJvmTest.kt * Fix remaining Spotless problems * Upgrade yarn.lock --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Alejandro Serrano --- .../jvmTest/java/arrow/core/EvalJvmTest.kt | 6 +- .../arrow/optics/plugin/internals/domain.kt | 3 + .../arrow/optics/plugin/internals/utils.kt | 4 +- .../test/kotlin/arrow/optics/plugin/Utils.kt | 2 + gradle/libs.versions.toml | 10 +- gradle/wrapper/gradle-wrapper.properties | 2 +- gradlew | 14 +- kotlin-js-store/yarn.lock | 298 +----------------- settings.gradle.kts | 2 +- 9 files changed, 28 insertions(+), 313 deletions(-) diff --git a/arrow-libs/core/arrow-core/src/jvmTest/java/arrow/core/EvalJvmTest.kt b/arrow-libs/core/arrow-core/src/jvmTest/java/arrow/core/EvalJvmTest.kt index 382cf99e237..269abf2acf0 100644 --- a/arrow-libs/core/arrow-core/src/jvmTest/java/arrow/core/EvalJvmTest.kt +++ b/arrow-libs/core/arrow-core/src/jvmTest/java/arrow/core/EvalJvmTest.kt @@ -14,7 +14,7 @@ class EvalJvmTest : StringSpec({ try { d.eval.value() } catch (e: StackOverflowError) { - fail("stack overflowed with eval-depth ${DeepEval.maxDepth}") + fail("stack overflowed with eval-depth ${DeepEval.MAX_DEPTH}") } } } @@ -38,7 +38,7 @@ private data class DeepEval(val eval: Eval) { } companion object { - const val maxDepth = 10000 + const val MAX_DEPTH = 10000 fun build(leaf: () -> Eval, os: List) = run { tailrec fun step(i: Int, leaf: () -> Eval, cbs: MutableList<(Eval) -> Eval>): Eval = @@ -62,7 +62,7 @@ private data class DeepEval(val eval: Eval) { val gen = arbitrary { rs -> val leaf = { Eval.Now(0) } - val eval = build(leaf, O.gen.samples().map(Sample::value).take(maxDepth).toList()) + val eval = build(leaf, O.gen.samples().map(Sample::value).take(MAX_DEPTH).toList()) DeepEval(eval) } } diff --git a/arrow-libs/optics/arrow-optics-ksp-plugin/src/main/kotlin/arrow/optics/plugin/internals/domain.kt b/arrow-libs/optics/arrow-optics-ksp-plugin/src/main/kotlin/arrow/optics/plugin/internals/domain.kt index 429ab8eb40b..712ce155029 100644 --- a/arrow-libs/optics/arrow-optics-ksp-plugin/src/main/kotlin/arrow/optics/plugin/internals/domain.kt +++ b/arrow-libs/optics/arrow-optics-ksp-plugin/src/main/kotlin/arrow/optics/plugin/internals/domain.kt @@ -1,3 +1,5 @@ +@file:Suppress("ktlint:standard:property-naming") + package arrow.optics.plugin.internals import arrow.optics.plugin.companionObject @@ -28,6 +30,7 @@ data class ADT(val pckg: KSName, val declaration: KSClassDeclaration, val target copy(imports = imports + snippet.imports, content = "$content\n${snippet.content}") } +@Suppress("RecursivePropertyAccessor") val KSClassDeclaration.nameWithParentClass: String get() = when (val parent = parentDeclaration) { is KSClassDeclaration -> parent.nameWithParentClass + "." + simpleName.asString() diff --git a/arrow-libs/optics/arrow-optics-ksp-plugin/src/main/kotlin/arrow/optics/plugin/internals/utils.kt b/arrow-libs/optics/arrow-optics-ksp-plugin/src/main/kotlin/arrow/optics/plugin/internals/utils.kt index edacd98bcd8..920d276d5ea 100644 --- a/arrow-libs/optics/arrow-optics-ksp-plugin/src/main/kotlin/arrow/optics/plugin/internals/utils.kt +++ b/arrow-libs/optics/arrow-optics-ksp-plugin/src/main/kotlin/arrow/optics/plugin/internals/utils.kt @@ -13,9 +13,9 @@ fun String.plusIfNotBlank(prefix: String = "", postfix: String = "") = * Sanitizes each delimited section if it matches with Kotlin reserved keywords. */ fun KSName.asSanitizedString(delimiter: String = ".", prefix: String = "") = - asString().splitToSequence(delimiter).joinToString(delimiter, prefix) { if (it in kotlinKeywords) "`$it`" else it } + asString().splitToSequence(delimiter).joinToString(delimiter, prefix) { if (it in KOTLIN_KEYWORDS) "`$it`" else it } -private val kotlinKeywords = setOf( +private val KOTLIN_KEYWORDS = setOf( // Hard keywords "as", "break", diff --git a/arrow-libs/optics/arrow-optics-ksp-plugin/src/test/kotlin/arrow/optics/plugin/Utils.kt b/arrow-libs/optics/arrow-optics-ksp-plugin/src/test/kotlin/arrow/optics/plugin/Utils.kt index 819a78a3555..53d4fffdd1c 100644 --- a/arrow-libs/optics/arrow-optics-ksp-plugin/src/test/kotlin/arrow/optics/plugin/Utils.kt +++ b/arrow-libs/optics/arrow-optics-ksp-plugin/src/test/kotlin/arrow/optics/plugin/Utils.kt @@ -1,3 +1,5 @@ +@file:Suppress("ktlint:standard:property-naming") + package arrow.optics.plugin const val `package` = "package `if`.`this`.`object`.`is`.`finally`.`null`.`expect`.`annotation`" diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 142a40803ae..a7d246bec2a 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -3,14 +3,14 @@ animalSniffer = "1.7.1" arrowGradleConfig = "0.12.0-rc.6" assertj = "3.24.2" coroutines = "1.7.3" -classgraph = "4.8.162" -dokka = "1.9.0" +classgraph = "4.8.163" +dokka = "1.9.10" jUnit = "4.13.2" jUnitJupiter = "5.10.0" jUnitVintage = "5.10.0" kotest = "5.7.2" kotestGradle = "5.7.2" -kover = "0.7.3" +kover = "0.7.4" kotlin = "1.9.10" kotlinxSerializationPlugin = "1.9.10" kotlinBinaryCompatibilityValidator = "0.13.2" @@ -18,10 +18,10 @@ kotlinCompileTesting = "1.5.0" knit = "0.4.0" kspVersion = "1.9.10-1.0.13" kotlinxSerialization = "1.6.0" -mockWebServer = "4.11.0" +mockWebServer = "4.12.0" retrofit = "2.9.0" retrofitKotlinxSerialization = "1.0.0" -spotlessVersion = "6.21.0" +spotlessVersion = "6.22.0" [libraries] coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "coroutines" } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index ac72c34e8ac..3fa8f862f75 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew index 0adc8e1a532..1aa94a42690 100755 --- a/gradlew +++ b/gradlew @@ -145,7 +145,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac @@ -153,7 +153,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then '' | soft) :;; #( *) # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -202,11 +202,11 @@ fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ diff --git a/kotlin-js-store/yarn.lock b/kotlin-js-store/yarn.lock index 80330625719..414d13d1d65 100644 --- a/kotlin-js-store/yarn.lock +++ b/kotlin-js-store/yarn.lock @@ -2,27 +2,6 @@ # yarn lockfile v1 -"@babel/code-frame@^7.10.4": - version "7.21.4" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.21.4.tgz#d0fa9e4413aca81f2b23b9442797bda1826edb39" - integrity sha512-LYvhNKfwWSPpocw8GI7gpK2nq3HSDuEPC/uSYaALSJu9xjsalaaYFOq0Pwt5KmVqwEbZlDu81aLXwBOmD/Fv9g== - dependencies: - "@babel/highlight" "^7.18.6" - -"@babel/helper-validator-identifier@^7.18.6": - version "7.19.1" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz#7eea834cf32901ffdc1a7ee555e2f9c27e249ca2" - integrity sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w== - -"@babel/highlight@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.18.6.tgz#81158601e93e2563795adcbfbdf5d64be3f2ecdf" - integrity sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g== - dependencies: - "@babel/helper-validator-identifier" "^7.18.6" - chalk "^2.0.0" - js-tokens "^4.0.0" - "@colors/colors@1.5.0": version "1.5.0" resolved "https://registry.yarnpkg.com/@colors/colors/-/colors-1.5.0.tgz#bb504579c1cae923e6576a4f5da43d25f97bdbd9" @@ -52,14 +31,6 @@ resolved "https://registry.yarnpkg.com/@jridgewell/set-array/-/set-array-1.1.2.tgz#7c6cf998d6d20b914c0a55a91ae928ff25965e72" integrity sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw== -"@jridgewell/source-map@^0.3.2": - version "0.3.2" - resolved "https://registry.yarnpkg.com/@jridgewell/source-map/-/source-map-0.3.2.tgz#f45351aaed4527a298512ec72f81040c998580fb" - integrity sha512-m7O9o2uR8k2ObDysZYzdfhb08VuEml5oWGiosa1VdaPZ/A6QyPkAJuwN0Q1lhULOf6B7MtQmHENS743hWtCrgw== - dependencies: - "@jridgewell/gen-mapping" "^0.3.0" - "@jridgewell/trace-mapping" "^0.3.9" - "@jridgewell/source-map@^0.3.3": version "0.3.5" resolved "https://registry.yarnpkg.com/@jridgewell/source-map/-/source-map-0.3.5.tgz#a3bb4d5c6825aab0d281268f47f6ad5853431e91" @@ -89,48 +60,6 @@ "@jridgewell/resolve-uri" "^3.0.3" "@jridgewell/sourcemap-codec" "^1.4.10" -"@rollup/plugin-commonjs@^21.0.1": - version "21.1.0" - resolved "https://registry.yarnpkg.com/@rollup/plugin-commonjs/-/plugin-commonjs-21.1.0.tgz#45576d7b47609af2db87f55a6d4b46e44fc3a553" - integrity sha512-6ZtHx3VHIp2ReNNDxHjuUml6ur+WcQ28N1yHgCQwsbNkQg2suhxGMDQGJOn/KuDxKtd1xuZP5xSTwBA4GQ8hbA== - dependencies: - "@rollup/pluginutils" "^3.1.0" - commondir "^1.0.1" - estree-walker "^2.0.1" - glob "^7.1.6" - is-reference "^1.2.1" - magic-string "^0.25.7" - resolve "^1.17.0" - -"@rollup/plugin-node-resolve@^13.1.3": - version "13.3.0" - resolved "https://registry.yarnpkg.com/@rollup/plugin-node-resolve/-/plugin-node-resolve-13.3.0.tgz#da1c5c5ce8316cef96a2f823d111c1e4e498801c" - integrity sha512-Lus8rbUo1eEcnS4yTFKLZrVumLPY+YayBdWXgFSHYhTT2iJbMhoaaBL3xl5NCdeRytErGr8tZ0L71BMRmnlwSw== - dependencies: - "@rollup/pluginutils" "^3.1.0" - "@types/resolve" "1.17.1" - deepmerge "^4.2.2" - is-builtin-module "^3.1.0" - is-module "^1.0.0" - resolve "^1.19.0" - -"@rollup/plugin-typescript@^8.3.0": - version "8.5.0" - resolved "https://registry.yarnpkg.com/@rollup/plugin-typescript/-/plugin-typescript-8.5.0.tgz#7ea11599a15b0a30fa7ea69ce3b791d41b862515" - integrity sha512-wMv1/scv0m/rXx21wD2IsBbJFba8wGF3ErJIr6IKRfRj49S85Lszbxb4DCo8iILpluTjk2GAAu9CoZt4G3ppgQ== - dependencies: - "@rollup/pluginutils" "^3.1.0" - resolve "^1.17.0" - -"@rollup/pluginutils@^3.0.9", "@rollup/pluginutils@^3.1.0": - version "3.1.0" - resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-3.1.0.tgz#706b4524ee6dc8b103b3c995533e5ad680c02b9b" - integrity sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg== - dependencies: - "@types/estree" "0.0.39" - estree-walker "^1.0.1" - picomatch "^2.2.2" - "@socket.io/component-emitter@~3.1.0": version "3.1.0" resolved "https://registry.yarnpkg.com/@socket.io/component-emitter/-/component-emitter-3.1.0.tgz#96116f2a912e0c02817345b3c10751069920d553" @@ -167,11 +96,6 @@ resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.52.tgz#7f1f57ad5b741f3d5b210d3b1f145640d89bf8fe" integrity sha512-BZWrtCU0bMVAIliIV+HJO1f1PR41M7NKjfxrFJwwhKI1KwhwOxYw1SXg9ao+CIMt774nFuGiG6eU+udtbEI9oQ== -"@types/estree@0.0.39": - version "0.0.39" - resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.39.tgz#e177e699ee1b8c22d23174caaa7422644389509f" - integrity sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw== - "@types/estree@^1.0.0": version "1.0.1" resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.1.tgz#aa22750962f3bf0e79d753d3cc067f010c95f194" @@ -187,18 +111,6 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-18.0.3.tgz#463fc47f13ec0688a33aec75d078a0541a447199" integrity sha512-HzNRZtp4eepNitP+BD6k2L6DROIDG4Q0fm4x+dwfsr6LGmROENnok75VGw40628xf+iR24WeMFcHuuBDUAzzsQ== -"@types/node@^12.12.14": - version "12.20.55" - resolved "https://registry.yarnpkg.com/@types/node/-/node-12.20.55.tgz#c329cbd434c42164f846b909bd6f85b5537f6240" - integrity sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ== - -"@types/resolve@1.17.1": - version "1.17.1" - resolved "https://registry.yarnpkg.com/@types/resolve/-/resolve-1.17.1.tgz#3afd6ad8967c77e4376c598a82ddd58f46ec45d6" - integrity sha512-yy7HuzQhj0dhGpD8RLXSZWEkLsV9ibvxvi6EiJ3bkqLAO1RGo0WbkWQiwpRlSFymTJRz0d3k5LM3kkx8ArDbLw== - dependencies: - "@types/node" "*" - "@webassemblyjs/ast@1.11.6", "@webassemblyjs/ast@^1.11.5": version "1.11.6" resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.11.6.tgz#db046555d3c413f8966ca50a95176a0e2c642e24" @@ -363,11 +275,6 @@ acorn-import-assertions@^1.7.6: resolved "https://registry.yarnpkg.com/acorn-import-assertions/-/acorn-import-assertions-1.9.0.tgz#507276249d684797c84e0734ef84860334cfb1ac" integrity sha512-cmMwop9x+8KFhxvKrKfPYmN6/pKTYYHBqLa0DfvVZcKMJWNyWLnaqND7dx/qn66R7ewM1UX5XMaDVP5wlVTaVA== -acorn@^8.5.0: - version "8.7.1" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.7.1.tgz#0197122c843d1bf6d0a5e83220a788f278f63c30" - integrity sha512-Xx54uLJQZ19lKygFXOWsscKUbsBZW0CPykPhVQdhIeIwrbPmJzqeASDInc8nKBnp/JT6igTs82qPXz069H8I/A== - acorn@^8.7.1: version "8.8.1" resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.8.1.tgz#0a3f9cbecc4ec3bea6f0a80b66ae8dd2da250b73" @@ -403,13 +310,6 @@ ansi-regex@^5.0.1: resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== -ansi-styles@^3.2.1: - version "3.2.1" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" - integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== - dependencies: - color-convert "^1.9.0" - ansi-styles@^4.0.0, ansi-styles@^4.1.0: version "4.3.0" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" @@ -430,11 +330,6 @@ argparse@^2.0.1: resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== -atob@^2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9" - integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg== - balanced-match@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" @@ -510,11 +405,6 @@ buffer-from@^1.0.0: resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5" integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ== -builtin-modules@^3.3.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-3.3.0.tgz#cae62812b89801e9656336e46223e030386be7b6" - integrity sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw== - bytes@3.1.2: version "3.1.2" resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.2.tgz#8b0beeb98605adf1b128fa4386403c009e0221a5" @@ -538,15 +428,6 @@ caniuse-lite@^1.0.30001359: resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001363.tgz#26bec2d606924ba318235944e1193304ea7c4f15" integrity sha512-HpQhpzTGGPVMnCjIomjt+jvyUu8vNFo3TaDiZ/RcoTrlOq/5+tC8zHdsbgFB6MxmaY+jCpsH09aD80Bb4Ow3Sg== -chalk@^2.0.0: - version "2.4.2" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" - integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== - dependencies: - ansi-styles "^3.2.1" - escape-string-regexp "^1.0.5" - supports-color "^5.3.0" - chalk@^4.1.0: version "4.1.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" @@ -593,13 +474,6 @@ clone-deep@^4.0.1: kind-of "^6.0.2" shallow-clone "^3.0.0" -color-convert@^1.9.0: - version "1.9.3" - resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" - integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== - dependencies: - color-name "1.1.3" - color-convert@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" @@ -607,11 +481,6 @@ color-convert@^2.0.1: dependencies: color-name "~1.1.4" -color-name@1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" - integrity sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw== - color-name@~1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" @@ -632,11 +501,6 @@ commander@^2.20.0: resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== -commondir@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b" - integrity sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg== - concat-map@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" @@ -708,16 +572,6 @@ decamelize@^4.0.0: resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-4.0.0.tgz#aa472d7bf660eb15f3494efd531cab7f2a709837" integrity sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ== -decode-uri-component@^0.2.0: - version "0.2.2" - resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.2.tgz#e69dbe25d37941171dd540e024c444cd5188e1e9" - integrity sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ== - -deepmerge@^4.2.2: - version "4.3.1" - resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-4.3.1.tgz#44b5f2147cd3b00d4b56137685966f26fd25dd4a" - integrity sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A== - depd@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/depd/-/depd-2.0.0.tgz#b696163cc757560d09cf22cc8fad1571b79e76df" @@ -827,11 +681,6 @@ escape-string-regexp@4.0.0: resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== -escape-string-regexp@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" - integrity sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg== - eslint-scope@5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.1.tgz#e786e59a66cb92b3f6c1fb0d508aab174848f48c" @@ -857,16 +706,6 @@ estraverse@^5.2.0: resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.3.0.tgz#2eea5290702f26ab8fe5370370ff86c965d21123" integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA== -estree-walker@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-1.0.1.tgz#31bc5d612c96b704106b477e6dd5d8aa138cb700" - integrity sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg== - -estree-walker@^2.0.1: - version "2.0.2" - resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-2.0.2.tgz#52f010178c2a4c117a7757cfe942adb7d2da4cac" - integrity sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w== - eventemitter3@^4.0.0: version "4.0.7" resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-4.0.7.tgz#2de9b68f6528d5644ef5c59526a1b4a07306169f" @@ -1015,7 +854,7 @@ glob@7.2.0: once "^1.3.0" path-is-absolute "^1.0.0" -glob@^7.1.3, glob@^7.1.6, glob@^7.1.7: +glob@^7.1.3, glob@^7.1.7: version "7.2.3" resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b" integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q== @@ -1037,11 +876,6 @@ graceful-fs@^4.2.10: resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3" integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ== -has-flag@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" - integrity sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw== - has-flag@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" @@ -1131,13 +965,6 @@ is-binary-path@~2.1.0: dependencies: binary-extensions "^2.0.0" -is-builtin-module@^3.1.0: - version "3.2.1" - resolved "https://registry.yarnpkg.com/is-builtin-module/-/is-builtin-module-3.2.1.tgz#f03271717d8654cfcaf07ab0463faa3571581169" - integrity sha512-BSLE3HnV2syZ0FK0iMA/yUGplUeMmNz4AW5fnTunbCIqZi4vG3WjJT9FHMy5D69xmAYBHXQhJdALdpwVxV501A== - dependencies: - builtin-modules "^3.3.0" - is-core-module@^2.11.0: version "2.12.0" resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.12.0.tgz#36ad62f6f73c8253fd6472517a12483cf03e7ec4" @@ -1145,11 +972,6 @@ is-core-module@^2.11.0: dependencies: has "^1.0.3" -is-docker@^2.0.0: - version "2.2.1" - resolved "https://registry.yarnpkg.com/is-docker/-/is-docker-2.2.1.tgz#33eeabe23cfe86f14bde4408a02c0cfb853acdaa" - integrity sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ== - is-extglob@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" @@ -1167,11 +989,6 @@ is-glob@^4.0.1, is-glob@~4.0.1: dependencies: is-extglob "^2.1.1" -is-module@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-module/-/is-module-1.0.0.tgz#3258fb69f78c14d5b815d664336b4cffb6441591" - integrity sha512-51ypPSPCoTEIN9dy5Oy+h4pShgJmPCygKfyRCISBI+JoWT/2oJvK8QPxmwv7b/p239jXrm9M1mlQbyKJ5A152g== - is-number@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" @@ -1189,25 +1006,11 @@ is-plain-object@^2.0.4: dependencies: isobject "^3.0.1" -is-reference@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/is-reference/-/is-reference-1.2.1.tgz#8b2dac0b371f4bc994fdeaba9eb542d03002d0b7" - integrity sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ== - dependencies: - "@types/estree" "*" - is-unicode-supported@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz#3f26c76a809593b52bfa2ecb5710ed2779b522a7" integrity sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw== -is-wsl@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-2.2.0.tgz#74a4c76e77ca9fd3f932f290c17ea326cd157271" - integrity sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww== - dependencies: - is-docker "^2.0.0" - isbinaryfile@^4.0.8: version "4.0.10" resolved "https://registry.yarnpkg.com/isbinaryfile/-/isbinaryfile-4.0.10.tgz#0c5b5e30c2557a2f06febd37b7322946aaee42b3" @@ -1223,15 +1026,6 @@ isobject@^3.0.1: resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" integrity sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg== -jest-worker@^26.2.1: - version "26.6.2" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-26.6.2.tgz#7f72cbc4d643c365e27b9fd775f9d0eaa9c7a8ed" - integrity sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ== - dependencies: - "@types/node" "*" - merge-stream "^2.0.0" - supports-color "^7.0.0" - jest-worker@^27.4.5: version "27.5.1" resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-27.5.1.tgz#8d146f0900e8973b106b6f73cc1e9a8cb86f8db0" @@ -1241,11 +1035,6 @@ jest-worker@^27.4.5: merge-stream "^2.0.0" supports-color "^8.0.0" -js-tokens@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" - integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== - js-yaml@4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602" @@ -1378,13 +1167,6 @@ log4js@^6.4.1: rfdc "^1.3.0" streamroller "^3.1.3" -magic-string@^0.25.7: - version "0.25.9" - resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.25.9.tgz#de7f9faf91ef8a1c91d02c2e5314c8277dbcdd1c" - integrity sha512-RmF0AsMzgt25qzqqLc1+MbHmhdx0ojF2Fvs4XnOqz2ZOBXzzkEwc/dJQZCYHAn7v1jbVOjAZfK8msRn4BxO4VQ== - dependencies: - sourcemap-codec "^1.4.8" - media-typer@0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" @@ -1604,7 +1386,7 @@ picocolors@^1.0.0: resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c" integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ== -picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.2: +picomatch@^2.0.4, picomatch@^2.2.1: version "2.3.1" resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== @@ -1691,7 +1473,7 @@ resolve-from@^5.0.0: resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-5.0.0.tgz#c35225843df8f776df21c57557bc087e9dfdfc69" integrity sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw== -resolve@^1.17.0, resolve@^1.19.0, resolve@^1.20.0: +resolve@^1.20.0: version "1.22.2" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.2.tgz#0ed0943d4e301867955766c9f3e1ae6d01c6845f" integrity sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g== @@ -1712,31 +1494,6 @@ rimraf@^3.0.0, rimraf@^3.0.2: dependencies: glob "^7.1.3" -rollup-plugin-sourcemaps@^0.6.3: - version "0.6.3" - resolved "https://registry.yarnpkg.com/rollup-plugin-sourcemaps/-/rollup-plugin-sourcemaps-0.6.3.tgz#bf93913ffe056e414419607f1d02780d7ece84ed" - integrity sha512-paFu+nT1xvuO1tPFYXGe+XnQvg4Hjqv/eIhG8i5EspfYYPBKL57X7iVbfv55aNVASg3dzWvES9dmWsL2KhfByw== - dependencies: - "@rollup/pluginutils" "^3.0.9" - source-map-resolve "^0.6.0" - -rollup-plugin-terser@^7.0.2: - version "7.0.2" - resolved "https://registry.yarnpkg.com/rollup-plugin-terser/-/rollup-plugin-terser-7.0.2.tgz#e8fbba4869981b2dc35ae7e8a502d5c6c04d324d" - integrity sha512-w3iIaU4OxcF52UUXiZNsNeuXIMDvFrr+ZXK6bFZ0Q60qyVfq4uLptoS4bbq3paG3x216eQllFZX7zt6TIImguQ== - dependencies: - "@babel/code-frame" "^7.10.4" - jest-worker "^26.2.1" - serialize-javascript "^4.0.0" - terser "^5.0.0" - -rollup@^2.68.0: - version "2.79.1" - resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.79.1.tgz#bedee8faef7c9f93a2647ac0108748f497f081c7" - integrity sha512-uKxbd0IhMZOhjAiD5oAFp7BqvkA4Dv47qpOCtaNvng4HBwdbWtdOh8f5nZNuk2rp51PMGk3bzfWu5oayNEuYnw== - optionalDependencies: - fsevents "~2.3.2" - safe-buffer@^5.1.0: version "5.2.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" @@ -1772,13 +1529,6 @@ serialize-javascript@6.0.0: dependencies: randombytes "^2.1.0" -serialize-javascript@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-4.0.0.tgz#b525e1238489a5ecfc42afacc3fe99e666f4b1aa" - integrity sha512-GaNA54380uFefWghODBWEGisLZFj00nS5ACs6yHa9nLqlLpVLO8ChDGeKRjZnV4Nh4n0Qi7nhYZD/9fCPzEqkw== - dependencies: - randombytes "^2.1.0" - serialize-javascript@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-6.0.1.tgz#b206efb27c3da0b0ab6b52f48d170b7996458e5c" @@ -1858,14 +1608,6 @@ source-map-loader@4.0.1: iconv-lite "^0.6.3" source-map-js "^1.0.2" -source-map-resolve@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.6.0.tgz#3d9df87e236b53f16d01e58150fc7711138e5ed2" - integrity sha512-KXBr9d/fO/bWo97NXsPIAW1bFSBOuCnjbNTBMO7N59hsv5i9yzRDfcYwwt0l04+VqnKC+EwzvJZIP/qkuMgR/w== - dependencies: - atob "^2.1.2" - decode-uri-component "^0.2.0" - source-map-support@0.5.21, source-map-support@~0.5.20: version "0.5.21" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.21.tgz#04fe7c7f9e1ed2d662233c28cb2b35b9f63f6e4f" @@ -1879,11 +1621,6 @@ source-map@^0.6.0, source-map@^0.6.1: resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== -sourcemap-codec@^1.4.8: - version "1.4.8" - resolved "https://registry.yarnpkg.com/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz#ea804bd94857402e6992d05a38ef1ae35a9ab4c4" - integrity sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA== - statuses@2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/statuses/-/statuses-2.0.1.tgz#55cb000ccf1d48728bd23c685a063998cf1a1b63" @@ -1931,14 +1668,7 @@ supports-color@8.1.1, supports-color@^8.0.0: dependencies: has-flag "^4.0.0" -supports-color@^5.3.0: - version "5.5.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" - integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== - dependencies: - has-flag "^3.0.0" - -supports-color@^7.0.0, supports-color@^7.1.0: +supports-color@^7.1.0: version "7.2.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== @@ -1966,16 +1696,6 @@ terser-webpack-plugin@^5.3.7: serialize-javascript "^6.0.1" terser "^5.16.8" -terser@^5.0.0: - version "5.17.1" - resolved "https://registry.yarnpkg.com/terser/-/terser-5.17.1.tgz#948f10830454761e2eeedc6debe45c532c83fd69" - integrity sha512-hVl35zClmpisy6oaoKALOpS0rDYLxRFLHhRuDlEGTKey9qHjS1w9GMORjuwIMt70Wan4lwsLYyWDVnWgF+KUEw== - dependencies: - "@jridgewell/source-map" "^0.3.2" - acorn "^8.5.0" - commander "^2.20.0" - source-map-support "~0.5.20" - terser@^5.16.8: version "5.18.2" resolved "https://registry.yarnpkg.com/terser/-/terser-5.18.2.tgz#ff3072a0faf21ffd38f99acc9a0ddf7b5f07b948" @@ -2005,11 +1725,6 @@ toidentifier@1.0.1: resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.1.tgz#3be34321a88a820ed1bd80dfaa33e479fbb8dd35" integrity sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA== -tslib@^2.3.1: - version "2.5.0" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.5.0.tgz#42bfed86f5787aeb41d031866c8f402429e0fddf" - integrity sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg== - type-is@~1.6.18: version "1.6.18" resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.18.tgz#4e552cd05df09467dcbc4ef739de89f2cf37c131" @@ -2023,11 +1738,6 @@ typescript@5.0.4: resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.0.4.tgz#b217fd20119bd61a94d4011274e0ab369058da3b" integrity sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw== -typescript@^3.7.2: - version "3.9.10" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.9.10.tgz#70f3910ac7a51ed6bef79da7800690b19bf778b8" - integrity sha512-w6fIxVE/H1PkLKcCPsFqKE7Kv7QUwhU8qQY2MueZXWx5cPZdwFupLgKK3vntcK98BtNHZtAF4LA/yl2a7k8R6Q== - ua-parser-js@^0.7.30: version "0.7.32" resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.32.tgz#cd8c639cdca949e30fa68c44b7813ef13e36d211" diff --git a/settings.gradle.kts b/settings.gradle.kts index 771956c34f2..3957a87e1a0 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -13,7 +13,7 @@ pluginManagement { } plugins { - id("com.gradle.enterprise") version "3.15" + id("com.gradle.enterprise") version "3.15.1" id("org.gradle.toolchains.foojay-resolver-convention") version("0.7.0") } From fa93b17e16463ca0d40a155cfc2eae4b4bd14f52 Mon Sep 17 00:00:00 2001 From: Alejandro Serrano Date: Thu, 19 Oct 2023 16:28:02 +0200 Subject: [PATCH 3/5] Use new Atomic types from Kotlin 1.9 (#3220) * Use new Atomic types from Kotlin 1.9 * Fix problematic test --- .../nativeMain/kotlin/arrow/atomic/Atomic.kt | 21 ++++++------------- .../kotlin/arrow/atomic/AtomicInt.kt | 18 +++++----------- .../kotlin/arrow/atomic/AtomicLong.kt | 18 +++++----------- .../arrow/fx/coroutines/RaceNJvmTest.kt | 2 ++ 4 files changed, 18 insertions(+), 41 deletions(-) diff --git a/arrow-libs/core/arrow-atomic/src/nativeMain/kotlin/arrow/atomic/Atomic.kt b/arrow-libs/core/arrow-atomic/src/nativeMain/kotlin/arrow/atomic/Atomic.kt index 8ec8c45588c..117a128b971 100644 --- a/arrow-libs/core/arrow-atomic/src/nativeMain/kotlin/arrow/atomic/Atomic.kt +++ b/arrow-libs/core/arrow-atomic/src/nativeMain/kotlin/arrow/atomic/Atomic.kt @@ -1,28 +1,19 @@ -@file:OptIn(FreezingIsDeprecated::class) package arrow.atomic -import kotlin.native.concurrent.AtomicReference -import kotlin.native.concurrent.freeze -import kotlin.native.concurrent.isFrozen +import kotlin.concurrent.AtomicReference public actual class Atomic actual constructor(initialValue: V) { - private val inner = AtomicReference(initialValue.freeze()) + private val inner = AtomicReference(initialValue) public actual fun get(): V = inner.value public actual fun set(value: V) { - inner.value = value.freeze() + inner.value = value } public actual fun compareAndSet(expected: V, new: V): Boolean = - inner.compareAndSet(expected, new.freeze()) + inner.compareAndSet(expected, new) - public actual fun getAndSet(value: V): V { - if (inner.isFrozen) value.freeze() - while (true) { - val cur = inner.value - if (cur === value) return cur - if (inner.compareAndSwap(cur, value) === cur) return cur - } - } + public actual fun getAndSet(value: V): V = + inner.getAndSet(value) } diff --git a/arrow-libs/core/arrow-atomic/src/nativeMain/kotlin/arrow/atomic/AtomicInt.kt b/arrow-libs/core/arrow-atomic/src/nativeMain/kotlin/arrow/atomic/AtomicInt.kt index c94040a9dc6..9b3ec716938 100644 --- a/arrow-libs/core/arrow-atomic/src/nativeMain/kotlin/arrow/atomic/AtomicInt.kt +++ b/arrow-libs/core/arrow-atomic/src/nativeMain/kotlin/arrow/atomic/AtomicInt.kt @@ -1,8 +1,6 @@ package arrow.atomic -import kotlin.native.concurrent.AtomicInt -import kotlin.native.concurrent.freeze -import kotlin.native.concurrent.isFrozen +import kotlin.concurrent.AtomicInt public actual class AtomicInt actual constructor(initialValue: Int) { private val inner = AtomicInt(initialValue) @@ -14,10 +12,10 @@ public actual class AtomicInt actual constructor(initialValue: Int) { } public actual fun incrementAndGet(): Int = - inner.addAndGet(1) + inner.incrementAndGet() public actual fun decrementAndGet(): Int = - inner.addAndGet(-1) + inner.decrementAndGet() public actual fun addAndGet(delta: Int): Int = inner.addAndGet(delta) @@ -25,12 +23,6 @@ public actual class AtomicInt actual constructor(initialValue: Int) { public actual fun compareAndSet(expected: Int, new: Int): Boolean = inner.compareAndSet(expected, new) - public actual fun getAndSet(value: Int): Int { - if (inner.isFrozen) value.freeze() - while (true) { - val cur = inner.value - if (cur == value) return cur - if (inner.compareAndSwap(cur, value) == cur) return cur - } - } + public actual fun getAndSet(value: Int): Int = + inner.getAndSet(value) } diff --git a/arrow-libs/core/arrow-atomic/src/nativeMain/kotlin/arrow/atomic/AtomicLong.kt b/arrow-libs/core/arrow-atomic/src/nativeMain/kotlin/arrow/atomic/AtomicLong.kt index ea370e5724f..e0d099c1831 100644 --- a/arrow-libs/core/arrow-atomic/src/nativeMain/kotlin/arrow/atomic/AtomicLong.kt +++ b/arrow-libs/core/arrow-atomic/src/nativeMain/kotlin/arrow/atomic/AtomicLong.kt @@ -1,8 +1,6 @@ package arrow.atomic -import kotlin.native.concurrent.AtomicLong -import kotlin.native.concurrent.freeze -import kotlin.native.concurrent.isFrozen +import kotlin.concurrent.AtomicLong public actual class AtomicLong actual constructor(initialValue: Long) { private val inner = AtomicLong(initialValue) @@ -14,10 +12,10 @@ public actual class AtomicLong actual constructor(initialValue: Long) { } public actual fun incrementAndGet(): Long = - inner.addAndGet(1) + inner.incrementAndGet() public actual fun decrementAndGet(): Long = - inner.addAndGet(-1) + inner.decrementAndGet() public actual fun addAndGet(delta: Long): Long = inner.addAndGet(delta) @@ -25,13 +23,7 @@ public actual class AtomicLong actual constructor(initialValue: Long) { public actual fun compareAndSet(expected: Long, new: Long): Boolean = inner.compareAndSet(expected, new) - public actual fun getAndSet(value: Long): Long { - if (inner.isFrozen) value.freeze() - while (true) { - val cur = inner.value - if (cur == value) return cur - if (inner.compareAndSwap(cur, value) == cur) return cur - } - } + public actual fun getAndSet(value: Long): Long = + inner.getAndSet(value) } diff --git a/arrow-libs/fx/arrow-fx-coroutines/src/jvmTest/kotlin/arrow/fx/coroutines/RaceNJvmTest.kt b/arrow-libs/fx/arrow-fx-coroutines/src/jvmTest/kotlin/arrow/fx/coroutines/RaceNJvmTest.kt index 45a7761fb68..fdaab4df01c 100644 --- a/arrow-libs/fx/arrow-fx-coroutines/src/jvmTest/kotlin/arrow/fx/coroutines/RaceNJvmTest.kt +++ b/arrow-libs/fx/arrow-fx-coroutines/src/jvmTest/kotlin/arrow/fx/coroutines/RaceNJvmTest.kt @@ -119,10 +119,12 @@ class RaceNJvmTest : StringSpec({ } } + /* This seems to not be true anymore "first racer out of 3 always wins on a single thread" { (single.use { ctx -> raceN(ctx, { threadName() }, { threadName() }, { threadName() }) } as? Race3.First)?.winner shouldStartWith "single" } + */ } ) From 89205f6a963610a7adf605c875f204631446b589 Mon Sep 17 00:00:00 2001 From: "HyunWoo Lee (Nunu Lee)" <54518925+l2hyunwoo@users.noreply.github.com> Date: Fri, 20 Oct 2023 01:15:21 +0900 Subject: [PATCH 4/5] Provide test coverage for NonEmptyList (#3135) * [feature/add_non_empty_list_test] Add Method Tests - lastOrNull - extract * add nonemptylist test (operator plus function) * add coflatmap test * add foldLeft test * fix lint * fix foldLeft unit test logic --------- Co-authored-by: Alejandro Serrano --- .../kotlin/arrow/core/NonEmptyListTest.kt | 57 +++++++++++++++++-- 1 file changed, 53 insertions(+), 4 deletions(-) diff --git a/arrow-libs/core/arrow-core/src/commonTest/kotlin/arrow/core/NonEmptyListTest.kt b/arrow-libs/core/arrow-core/src/commonTest/kotlin/arrow/core/NonEmptyListTest.kt index cecd2561d29..cbb7f8b68c0 100644 --- a/arrow-libs/core/arrow-core/src/commonTest/kotlin/arrow/core/NonEmptyListTest.kt +++ b/arrow-libs/core/arrow-core/src/commonTest/kotlin/arrow/core/NonEmptyListTest.kt @@ -12,10 +12,7 @@ import io.kotest.matchers.booleans.shouldBeTrue import io.kotest.matchers.nulls.shouldNotBeNull import io.kotest.matchers.shouldBe import io.kotest.property.Arb -import io.kotest.property.arbitrary.boolean -import io.kotest.property.arbitrary.int -import io.kotest.property.arbitrary.negativeInt -import io.kotest.property.arbitrary.pair +import io.kotest.property.arbitrary.* import io.kotest.property.checkAll import kotlin.math.max import kotlin.math.min @@ -445,4 +442,56 @@ class NonEmptyListTest : StringSpec({ } } } + + "lastOrNull" { + checkAll( + Arb.nonEmptyList(Arb.int()) + ) { a -> + val result = a.lastOrNull() + val expected = a.last() + result shouldBe expected + } + } + + "extract" { + checkAll( + Arb.nonEmptyList(Arb.int()) + ) { a -> + val result = a.extract() + val expected = a.head + result shouldBe expected + } + } + + "plus" { + checkAll( + Arb.nonEmptyList(Arb.int()), + Arb.int() + ) { a, b -> + val result = a + b + val expected = a.all + b + result shouldBe expected + } + } + + "coflatMap should retain the same length as the original list" { + checkAll( + Arb.nonEmptyList(Arb.int()) + ) { a -> + val result = a.coflatMap { it.all } + val expected = a.all + result.size shouldBe expected.size + } + } + + "foldLeft should sum up correctly for addition" { + checkAll( + Arb.nonEmptyList(Arb.int()), + Arb.int() + ) { list, initial -> + val result = list.foldLeft(initial) { acc, i -> acc + i } + val expected = initial + list.all.sum() + result shouldBe expected + } + } }) From a65a8336a3490ec24aae6d2356f1abfb23cefc4b Mon Sep 17 00:00:00 2001 From: Simon Vergauwen Date: Tue, 24 Oct 2023 22:17:58 +0200 Subject: [PATCH 5/5] Update Arrow-Atomic (#3225) Co-authored-by: Alejandro Serrano --- .../core/arrow-annotations/build.gradle.kts | 9 +-- arrow-libs/core/arrow-atomic/build.gradle.kts | 27 +------- .../kotlin/arrow/atomic/AtomicBooleanTest.kt | 38 +++++----- .../kotlin/arrow/atomic/AtomicIntTest.kt | 39 ++++++----- .../kotlin/arrow/atomic/AtomicLongTest.kt | 41 ++++++----- .../kotlin/arrow/atomic/AtomicTest.kt | 35 ++++++---- .../kotlin/arrow/atomic/Platform.kt | 19 +++++ .../fx/arrow-fx-coroutines/build.gradle.kts | 3 + .../kotlin/arrow/fx/coroutines/ParMapTest.kt | 69 ++++++++++--------- .../kotlin/arrow/fx/coroutines/Platform.kt | 12 +++- .../arrow/fx/coroutines/RaceNJvmTest.kt | 21 +++--- gradle/libs.versions.toml | 1 + 12 files changed, 171 insertions(+), 143 deletions(-) create mode 100644 arrow-libs/core/arrow-atomic/src/commonTest/kotlin/arrow/atomic/Platform.kt diff --git a/arrow-libs/core/arrow-annotations/build.gradle.kts b/arrow-libs/core/arrow-annotations/build.gradle.kts index 53ddc3b9140..4b2e4fd5171 100644 --- a/arrow-libs/core/arrow-annotations/build.gradle.kts +++ b/arrow-libs/core/arrow-annotations/build.gradle.kts @@ -13,6 +13,8 @@ spotless { } } +apply(from = property("ANIMALSNIFFER_MPP")) + kotlin { sourceSets { commonMain { @@ -25,11 +27,6 @@ kotlin { implementation(libs.kotlin.stdlib) } } - jvmTest { - dependencies { - runtimeOnly(libs.kotest.runnerJUnit5) - } - } jsMain { dependencies { implementation(libs.kotlin.stdlibJS) @@ -45,5 +42,3 @@ kotlin { } } } - -apply(from = property("ANIMALSNIFFER_MPP")) diff --git a/arrow-libs/core/arrow-atomic/build.gradle.kts b/arrow-libs/core/arrow-atomic/build.gradle.kts index 53e4715ae43..4e2275757b3 100644 --- a/arrow-libs/core/arrow-atomic/build.gradle.kts +++ b/arrow-libs/core/arrow-atomic/build.gradle.kts @@ -2,13 +2,10 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile - plugins { id(libs.plugins.kotlin.multiplatform.get().pluginId) alias(libs.plugins.arrowGradleConfig.kotlin) alias(libs.plugins.arrowGradleConfig.publish) - - alias(libs.plugins.kotest.multiplatform) alias(libs.plugins.kotlinx.kover) alias(libs.plugins.spotless) } @@ -32,15 +29,10 @@ kotlin { commonTest { dependencies { implementation(projects.arrowFxCoroutines) - implementation(libs.kotest.frameworkEngine) + implementation(libs.kotlin.test) implementation(libs.kotest.assertionsCore) implementation(libs.kotest.property) - } - } - - jvmTest { - dependencies { - runtimeOnly(libs.kotest.runnerJUnit5) + implementation(libs.coroutines.test) } } @@ -55,21 +47,6 @@ kotlin { implementation(libs.kotlin.stdlibJS) } } - - commonTest { - dependencies { - implementation(projects.arrowFxCoroutines) - implementation(libs.kotest.frameworkEngine) - implementation(libs.kotest.assertionsCore) - implementation(libs.kotest.property) - } - } - - jvmTest { - dependencies { - runtimeOnly(libs.kotest.runnerJUnit5) - } - } } jvm { diff --git a/arrow-libs/core/arrow-atomic/src/commonTest/kotlin/arrow/atomic/AtomicBooleanTest.kt b/arrow-libs/core/arrow-atomic/src/commonTest/kotlin/arrow/atomic/AtomicBooleanTest.kt index ab175ba7e50..58bff0e85d0 100644 --- a/arrow-libs/core/arrow-atomic/src/commonTest/kotlin/arrow/atomic/AtomicBooleanTest.kt +++ b/arrow-libs/core/arrow-atomic/src/commonTest/kotlin/arrow/atomic/AtomicBooleanTest.kt @@ -1,21 +1,16 @@ package arrow.atomic -import arrow.fx.coroutines.parMap -import io.kotest.core.spec.style.StringSpec +import kotlin.test.Test +import kotlinx.coroutines.test.runTest import io.kotest.matchers.shouldBe import io.kotest.property.Arb import io.kotest.property.arbitrary.boolean -import io.kotest.property.arbitrary.int -import io.kotest.property.arbitrary.long -import io.kotest.property.arbitrary.string import io.kotest.property.checkAll -import kotlin.coroutines.Continuation -import kotlin.coroutines.EmptyCoroutineContext -import kotlin.coroutines.intrinsics.startCoroutineUninterceptedOrReturn -class AtomicBooleanTest : StringSpec({ +class AtomicBooleanTest { - "set get - successful" { + @Test + fun setGetSuccessful() = runTest { checkAll(Arb.boolean(), Arb.boolean()) { x, y -> val r = AtomicBoolean(x) r.value = y @@ -23,7 +18,8 @@ class AtomicBooleanTest : StringSpec({ } } - "update get - successful" { + @Test + fun updateGetSuccessful() = runTest { checkAll(Arb.boolean(), Arb.boolean()) { x, y -> val r = AtomicBoolean(x) r.update { y } @@ -31,7 +27,8 @@ class AtomicBooleanTest : StringSpec({ } } - "getAndSet - successful" { + @Test + fun getAndSetSuccessful() = runTest { checkAll(Arb.boolean(), Arb.boolean()) { x, y -> val ref = AtomicBoolean(x) ref.getAndSet(y) shouldBe x @@ -39,7 +36,8 @@ class AtomicBooleanTest : StringSpec({ } } - "getAndUpdate - successful" { + @Test + fun getAndUpdateSuccessful() = runTest { checkAll(Arb.boolean(), Arb.boolean()) { x, y -> val ref = AtomicBoolean(x) ref.getAndUpdate { y } shouldBe x @@ -47,7 +45,8 @@ class AtomicBooleanTest : StringSpec({ } } - "updateAndGet - successful" { + @Test + fun updateAndGetSuccessful() = runTest { checkAll(Arb.boolean(), Arb.boolean()) { x, y -> val ref = AtomicBoolean(x) ref.updateAndGet { @@ -57,7 +56,8 @@ class AtomicBooleanTest : StringSpec({ } } - "tryUpdate - modification occurs successfully" { + @Test + fun tryUpdateModificationOccursSuccessfully() = runTest { checkAll(Arb.boolean()) { x -> val ref = AtomicBoolean(x) ref.tryUpdate { !it } @@ -65,7 +65,8 @@ class AtomicBooleanTest : StringSpec({ } } - "tryUpdate - should fail to update if modification has occurred" { + @Test + fun tryUpdateShouldFailToUpdateIfModificationHasOccurred() = runTest { checkAll(Arb.boolean()) { x -> val ref = AtomicBoolean(x) ref.tryUpdate { @@ -75,7 +76,8 @@ class AtomicBooleanTest : StringSpec({ } } - "consistent set update on strings" { + @Test + fun consistentSetUpdateOnStrings() = runTest { checkAll(Arb.boolean(), Arb.boolean()) { x, y -> val set = { val r = AtomicBoolean(x) @@ -92,4 +94,4 @@ class AtomicBooleanTest : StringSpec({ set() shouldBe update() } } -}) +} diff --git a/arrow-libs/core/arrow-atomic/src/commonTest/kotlin/arrow/atomic/AtomicIntTest.kt b/arrow-libs/core/arrow-atomic/src/commonTest/kotlin/arrow/atomic/AtomicIntTest.kt index deead734bda..bb526f1c95a 100644 --- a/arrow-libs/core/arrow-atomic/src/commonTest/kotlin/arrow/atomic/AtomicIntTest.kt +++ b/arrow-libs/core/arrow-atomic/src/commonTest/kotlin/arrow/atomic/AtomicIntTest.kt @@ -1,19 +1,17 @@ package arrow.atomic import arrow.fx.coroutines.parMap -import io.kotest.core.spec.style.StringSpec +import kotlin.test.Test +import kotlinx.coroutines.test.runTest import io.kotest.matchers.shouldBe import io.kotest.property.Arb import io.kotest.property.arbitrary.int -import io.kotest.property.arbitrary.string import io.kotest.property.checkAll -import kotlin.coroutines.Continuation -import kotlin.coroutines.EmptyCoroutineContext -import kotlin.coroutines.intrinsics.startCoroutineUninterceptedOrReturn -class AtomicIntTest : StringSpec({ +class AtomicIntTest { - "set get - successful" { + @Test + fun setGetSuccessful() = runTest { checkAll(Arb.int(), Arb.int()) { x, y -> val r = AtomicInt(x) r.value = y @@ -21,7 +19,8 @@ class AtomicIntTest : StringSpec({ } } - "update get - successful" { + @Test + fun updateGetSuccessful() = runTest { checkAll(Arb.int(), Arb.int()) { x, y -> val r = AtomicInt(x) r.update { y } @@ -29,7 +28,8 @@ class AtomicIntTest : StringSpec({ } } - "getAndSet - successful" { + @Test + fun getAndSetSuccessful() = runTest { checkAll(Arb.int(), Arb.int()) { x, y -> val ref = AtomicInt(x) ref.getAndSet(y) shouldBe x @@ -37,7 +37,8 @@ class AtomicIntTest : StringSpec({ } } - "getAndUpdate - successful" { + @Test + fun getAndUpdateSuccessful() = runTest { checkAll(Arb.int(), Arb.int()) { x, y -> val ref = AtomicInt(x) ref.getAndUpdate { y } shouldBe x @@ -45,7 +46,8 @@ class AtomicIntTest : StringSpec({ } } - "updateAndGet - successful" { + @Test + fun updateAndGetSuccessful() = runTest { checkAll(Arb.int(), Arb.int()) { x, y -> val ref = AtomicInt(x) ref.updateAndGet { @@ -55,7 +57,8 @@ class AtomicIntTest : StringSpec({ } } - "tryUpdate - modification occurs successfully" { + @Test + fun tryUpdateModificationOccursSuccessfully() = runTest { checkAll(Arb.int()) { x -> val ref = AtomicInt(x) ref.tryUpdate { it + 1 } @@ -63,7 +66,8 @@ class AtomicIntTest : StringSpec({ } } - "tryUpdate - should fail to update if modification has occurred" { + @Test + fun tryUpdateShouldFailToUpdateIfModificationHasOccurred() = runTest { checkAll(Arb.int()) { x -> val ref = AtomicInt(x) ref.tryUpdate { @@ -73,7 +77,8 @@ class AtomicIntTest : StringSpec({ } } - "consistent set update on strings" { + @Test + fun consistentSetUpdateOnStrings() = runTest { checkAll(Arb.int(), Arb.int()) { x, y -> val set = { val r = AtomicInt(x) @@ -91,11 +96,11 @@ class AtomicIntTest : StringSpec({ } } - "concurrent modifications" { - val finalValue = 50_000 + @Test + fun concurrentModifications() = runTestWithDelay { + val finalValue = stackSafeIteration() val r = AtomicInt(0) (0 until finalValue).parMap { r.update { it + 1 } } r.value shouldBe finalValue } } -) diff --git a/arrow-libs/core/arrow-atomic/src/commonTest/kotlin/arrow/atomic/AtomicLongTest.kt b/arrow-libs/core/arrow-atomic/src/commonTest/kotlin/arrow/atomic/AtomicLongTest.kt index 02a31f13346..b574c125f1a 100644 --- a/arrow-libs/core/arrow-atomic/src/commonTest/kotlin/arrow/atomic/AtomicLongTest.kt +++ b/arrow-libs/core/arrow-atomic/src/commonTest/kotlin/arrow/atomic/AtomicLongTest.kt @@ -1,20 +1,17 @@ package arrow.atomic import arrow.fx.coroutines.parMap -import io.kotest.core.spec.style.StringSpec +import kotlin.test.Test +import kotlinx.coroutines.test.runTest import io.kotest.matchers.shouldBe import io.kotest.property.Arb -import io.kotest.property.arbitrary.int import io.kotest.property.arbitrary.long -import io.kotest.property.arbitrary.string import io.kotest.property.checkAll -import kotlin.coroutines.Continuation -import kotlin.coroutines.EmptyCoroutineContext -import kotlin.coroutines.intrinsics.startCoroutineUninterceptedOrReturn -class AtomicLongTest : StringSpec({ +class AtomicLongTest { - "set get - successful" { + @Test + fun setGetSuccessful() = runTest { checkAll(Arb.long(), Arb.long()) { x, y -> val r = AtomicLong(x) r.value = y @@ -22,7 +19,8 @@ class AtomicLongTest : StringSpec({ } } - "update get - successful" { + @Test + fun updateGetSuccessful() = runTest { checkAll(Arb.long(), Arb.long()) { x, y -> val r = AtomicLong(x) r.update { y } @@ -30,7 +28,8 @@ class AtomicLongTest : StringSpec({ } } - "getAndSet - successful" { + @Test + fun getAndSetSuccessful() = runTest { checkAll(Arb.long(), Arb.long()) { x, y -> val ref = AtomicLong(x) ref.getAndSet(y) shouldBe x @@ -38,7 +37,8 @@ class AtomicLongTest : StringSpec({ } } - "getAndUpdate - successful" { + @Test + fun getAndUpdateSuccessful() = runTest { checkAll(Arb.long(), Arb.long()) { x, y -> val ref = AtomicLong(x) ref.getAndUpdate { y } shouldBe x @@ -46,7 +46,8 @@ class AtomicLongTest : StringSpec({ } } - "updateAndGet - successful" { + @Test + fun updateAndGetSuccessful() = runTest { checkAll(Arb.long(), Arb.long()) { x, y -> val ref = AtomicLong(x) ref.updateAndGet { @@ -56,7 +57,8 @@ class AtomicLongTest : StringSpec({ } } - "tryUpdate - modification occurs successfully" { + @Test + fun tryUpdateModificationOccursSuccessfully() = runTest { checkAll(Arb.long()) { x -> val ref = AtomicLong(x) ref.tryUpdate { it + 1 } @@ -64,7 +66,8 @@ class AtomicLongTest : StringSpec({ } } - "tryUpdate - should fail to update if modification has occurred" { + @Test + fun tryUpdateShouldFailToUpdateIfModificationHasOccurred() = runTest { checkAll(Arb.long()) { x -> val ref = AtomicLong(x) ref.tryUpdate { @@ -74,7 +77,8 @@ class AtomicLongTest : StringSpec({ } } - "consistent set update on strings" { + @Test + fun consistentSetUpdateOnStrings() = runTest { checkAll(Arb.long(), Arb.long()) { x, y -> val set = { val r = AtomicLong(x) @@ -92,10 +96,11 @@ class AtomicLongTest : StringSpec({ } } - "concurrent modifications" { - val finalValue = 50_000 + @Test + fun concurrentModifications() = runTestWithDelay { + val finalValue = stackSafeIteration() val r = AtomicLong(0) (0 until finalValue).parMap { r.update { it + 1 } } r.value shouldBe finalValue } -}) +} diff --git a/arrow-libs/core/arrow-atomic/src/commonTest/kotlin/arrow/atomic/AtomicTest.kt b/arrow-libs/core/arrow-atomic/src/commonTest/kotlin/arrow/atomic/AtomicTest.kt index be2caa5cde6..4df13754363 100644 --- a/arrow-libs/core/arrow-atomic/src/commonTest/kotlin/arrow/atomic/AtomicTest.kt +++ b/arrow-libs/core/arrow-atomic/src/commonTest/kotlin/arrow/atomic/AtomicTest.kt @@ -1,7 +1,8 @@ package arrow.atomic import arrow.fx.coroutines.parMap -import io.kotest.core.spec.style.StringSpec +import kotlin.test.Test +import kotlinx.coroutines.test.runTest import io.kotest.matchers.shouldBe import io.kotest.property.Arb import io.kotest.property.arbitrary.string @@ -10,9 +11,10 @@ import kotlin.coroutines.Continuation import kotlin.coroutines.EmptyCoroutineContext import kotlin.coroutines.intrinsics.startCoroutineUninterceptedOrReturn -class AtomicTest : StringSpec({ +class AtomicTest { - "set get - successful" { + @Test + fun setGetSuccessful() = runTest { checkAll(Arb.string(), Arb.string()) { x, y -> val r = Atomic(x) r.value = y @@ -20,7 +22,8 @@ class AtomicTest : StringSpec({ } } - "update get - successful" { + @Test + fun updateGetSuccessful() = runTest { checkAll(Arb.string(), Arb.string()) { x, y -> val r = Atomic(x) r.update { y } @@ -28,7 +31,8 @@ class AtomicTest : StringSpec({ } } - "getAndSet - successful" { + @Test + fun getAndSetSuccessful() = runTest { checkAll(Arb.string(), Arb.string()) { x, y -> val ref = Atomic(x) ref.getAndSet(y) shouldBe x @@ -36,7 +40,8 @@ class AtomicTest : StringSpec({ } } - "getAndUpdate - successful" { + @Test + fun getAndUpdateSuccessful() = runTest { checkAll(Arb.string(), Arb.string()) { x, y -> val ref = Atomic(x) ref.getAndUpdate { y } shouldBe x @@ -44,7 +49,8 @@ class AtomicTest : StringSpec({ } } - "updateAndGet - successful" { + @Test + fun updateAndGetSuccessful() = runTest { checkAll(Arb.string(), Arb.string()) { x, y -> val ref = Atomic(x) ref.updateAndGet { @@ -54,7 +60,8 @@ class AtomicTest : StringSpec({ } } - "tryUpdate - modification occurs successfully" { + @Test + fun tryUpdateModificationOccursSuccessfully() = runTest { checkAll(Arb.string()) { x -> val ref = Atomic(x) ref.tryUpdate { it + 1 } @@ -62,7 +69,8 @@ class AtomicTest : StringSpec({ } } - "tryUpdate - should fail to update if modification has occurred" { + @Test + fun tryUpdateShouldFailToUpdateIfModificationHasOccurred() = runTest { checkAll(Arb.string()) { x -> val ref = Atomic(x) ref.tryUpdate { @@ -73,7 +81,8 @@ class AtomicTest : StringSpec({ } } - "consistent set update on strings" { + @Test + fun consistentSetUpdateOnStrings() = runTest { checkAll(Arb.string(), Arb.string()) { x, y -> val set = suspend { val r = Atomic(x) @@ -91,11 +100,11 @@ class AtomicTest : StringSpec({ } } - "concurrent modifications" { - val finalValue = 50_000 + @Test + fun concurrentModifications() = runTestWithDelay { + val finalValue = stackSafeIteration() val r = Atomic("") (0 until finalValue).parMap { r.update { it + "a" } } r.value shouldBe "a".repeat(finalValue) } } -) diff --git a/arrow-libs/core/arrow-atomic/src/commonTest/kotlin/arrow/atomic/Platform.kt b/arrow-libs/core/arrow-atomic/src/commonTest/kotlin/arrow/atomic/Platform.kt new file mode 100644 index 00000000000..f83d3d325b5 --- /dev/null +++ b/arrow-libs/core/arrow-atomic/src/commonTest/kotlin/arrow/atomic/Platform.kt @@ -0,0 +1,19 @@ +package arrow.atomic + +import io.kotest.common.Platform +import io.kotest.common.platform +import kotlinx.coroutines.test.runTest +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.test.TestResult +import kotlinx.coroutines.withContext + +fun stackSafeIteration(): Int = when (platform) { + Platform.JVM -> 20_000 + else -> 1000 +} + +fun runTestWithDelay(testBody: suspend () -> Unit): TestResult = runTest { + withContext(Dispatchers.Default) { + testBody() + } +} diff --git a/arrow-libs/fx/arrow-fx-coroutines/build.gradle.kts b/arrow-libs/fx/arrow-fx-coroutines/build.gradle.kts index b7127588481..a8826e21058 100644 --- a/arrow-libs/fx/arrow-fx-coroutines/build.gradle.kts +++ b/arrow-libs/fx/arrow-fx-coroutines/build.gradle.kts @@ -28,12 +28,14 @@ kotlin { commonTest { dependencies { + implementation(libs.kotlin.test) implementation(libs.kotest.frameworkEngine) implementation(libs.kotest.assertionsCore) implementation(libs.kotest.property) implementation(libs.coroutines.test) } } + jvmTest { dependencies { runtimeOnly(libs.kotest.runnerJUnit5) @@ -45,6 +47,7 @@ kotlin { implementation(libs.kotlin.stdlib) } } + jsMain { dependencies { implementation(libs.kotlin.stdlibJS) diff --git a/arrow-libs/fx/arrow-fx-coroutines/src/commonTest/kotlin/arrow/fx/coroutines/ParMapTest.kt b/arrow-libs/fx/arrow-fx-coroutines/src/commonTest/kotlin/arrow/fx/coroutines/ParMapTest.kt index ce9c7d1dd5b..0ee57f17021 100644 --- a/arrow-libs/fx/arrow-fx-coroutines/src/commonTest/kotlin/arrow/fx/coroutines/ParMapTest.kt +++ b/arrow-libs/fx/arrow-fx-coroutines/src/commonTest/kotlin/arrow/fx/coroutines/ParMapTest.kt @@ -1,33 +1,34 @@ package arrow.fx.coroutines +import arrow.atomic.AtomicInt +import arrow.atomic.update import arrow.core.Either -import arrow.core.EitherNel import arrow.core.NonEmptyList -import arrow.core.continuations.either import arrow.core.left -import arrow.core.nonEmptyListOf -import io.kotest.core.spec.style.StringSpec +import arrow.core.raise.either import io.kotest.matchers.should import io.kotest.matchers.shouldBe import io.kotest.property.Arb import io.kotest.property.arbitrary.int import io.kotest.property.arbitrary.string import io.kotest.property.checkAll +import kotlin.test.Test import kotlin.time.Duration.Companion.milliseconds import kotlinx.coroutines.CompletableDeferred import kotlinx.coroutines.withTimeoutOrNull +import kotlinx.coroutines.test.runTest -class ParMapTest : StringSpec({ - "parMap is stack-safe" { - val count = 20_000 - val ref = Atomic(0) +class ParMapTest { + @Test fun parMapIsStackSafe() = runTestWithDelay { + val count = stackSafeIteration() + val ref = AtomicInt(0) (0 until count).parMap { _: Int -> ref.update { it + 1 } } ref.get() shouldBe count } - "parMap runs in parallel" { + @Test fun parMapRunsInParallel() = runTest { val promiseA = CompletableDeferred() val promiseB = CompletableDeferred() val promiseC = CompletableDeferred() @@ -48,7 +49,7 @@ class ParMapTest : StringSpec({ ).parMap { it.invoke() } } - "parTraverse results in the correct error" { + @Test fun parTraverseResultsInTheCorrectError() = runTest { checkAll( Arb.int(min = 10, max = 20), Arb.int(min = 1, max = 9), @@ -62,7 +63,7 @@ class ParMapTest : StringSpec({ } } - "parMap(concurrency = 1) only runs one task at a time" { + @Test fun parMapConcurrency1OnlyRunsOneTaskAtATime() = runTest { val promiseA = CompletableDeferred() withTimeoutOrNull(100.milliseconds) { @@ -73,7 +74,7 @@ class ParMapTest : StringSpec({ } shouldBe null } - "parMap with either results in the correct left" { + @Test fun parMapWithEitherResultsInTheCorrectLeft() = runTest { checkAll( Arb.int(min = 10, max = 20), Arb.int(min = 1, max = 9), @@ -81,22 +82,22 @@ class ParMapTest : StringSpec({ ) { n, killOn, e -> either { (0 until n).parMap { i -> - if (i == killOn) shift(e) else Unit + if (i == killOn) raise(e) else Unit } } shouldBe e.left() } } - "parMapOrAccumulate is stack-safe" { - val count = 20_000 - val ref = Atomic(0) + @Test fun parMapOrAccumulateIsStackSafe() = runTestWithDelay { + val count = stackSafeIteration() + val ref = AtomicInt(0) (0 until count).parMapOrAccumulate(combine = emptyError) { _: Int -> ref.update { it + 1 } } ref.get() shouldBe count } - "parMapOrAccumulate runs in parallel" { + @Test fun parMapOrAccumulateRunsInParallel() = runTest { val promiseA = CompletableDeferred() val promiseB = CompletableDeferred() val promiseC = CompletableDeferred() @@ -117,7 +118,7 @@ class ParMapTest : StringSpec({ ).parMapOrAccumulate(combine = emptyError) { it.invoke() } } - "parMapOrAccumulate results in the correct error" { + @Test fun parMapOrAccumulateResultsInTheCorrectError() = runTest { checkAll( Arb.int(min = 10, max = 20), Arb.int(min = 1, max = 9), @@ -131,7 +132,7 @@ class ParMapTest : StringSpec({ } } - "parMapOrAccumulate(concurrency = 1) only runs one task at a time" { + @Test fun parMapOrAccumulateConcurrency1OnlyRunsOneTaskAtATime() = runTest { val promiseA = CompletableDeferred() withTimeoutOrNull(100.milliseconds) { @@ -142,24 +143,24 @@ class ParMapTest : StringSpec({ } shouldBe null } - "parMapOrAccumulate accumulates shifts" { + @Test fun parMapOrAccumulateAccumulatesShifts() = runTest { checkAll(Arb.string()) { e -> - (0 until 100).parMapOrAccumulate { _ -> + (0 until 10).parMapOrAccumulate { _ -> raise(e) - } shouldBe NonEmptyList(e, (1 until 100).map { e }).left() + } shouldBe NonEmptyList(e, (1 until 10).map { e }).left() } } - "parMapNotNull is stack-safe" { - val count = 20_000 - val ref = Atomic(0) + @Test fun parMapNotNullIsStackSafe() = runTestWithDelay { + val count = stackSafeIteration() + val ref = AtomicInt(0) (0 until count).parMapNotNull { _: Int -> ref.update { it + 1 } } ref.get() shouldBe count } - "parMapNotNull runs in parallel" { + @Test fun parMapNotNullRunsInParallel() = runTest { val promiseA = CompletableDeferred() val promiseB = CompletableDeferred() val promiseC = CompletableDeferred() @@ -180,7 +181,7 @@ class ParMapTest : StringSpec({ ).parMapNotNull { it.invoke() } } - "parMapNotNull results in the correct error" { + @Test fun parMapNotNullResultsInTheCorrectError() = runTest { checkAll( Arb.int(min = 10, max = 20), Arb.int(min = 1, max = 9), @@ -194,7 +195,7 @@ class ParMapTest : StringSpec({ } } - "parMapNotNull(concurrency = 1) only runs one task at a time" { + @Test fun parMapNotNullConcurrency1OnlyRunsOneTaskAtATime() = runTest { val promiseA = CompletableDeferred() withTimeoutOrNull(100.milliseconds) { @@ -205,20 +206,20 @@ class ParMapTest : StringSpec({ } shouldBe null } - "parMapNotNull discards nulls" { - (0 until 100).parMapNotNull { _ -> + @Test fun parMapNotNullDiscardsNulls() = runTest { + (0 until 10).parMapNotNull { _ -> null } shouldBe emptyList() } - "parMapNotNull retains non-nulls" { + @Test fun parMapNotNullRetainsNonNulls() = runTest { checkAll(Arb.int()) { i -> - (0 until 100).parMapNotNull { _ -> + (0 until 10).parMapNotNull { _ -> i - } shouldBe List(100) { i } + } shouldBe List(10) { i } } } -}) +} private val emptyError: (Nothing, Nothing) -> Nothing = { _, _ -> throw AssertionError("Should not be called") } diff --git a/arrow-libs/fx/arrow-fx-coroutines/src/commonTest/kotlin/arrow/fx/coroutines/Platform.kt b/arrow-libs/fx/arrow-fx-coroutines/src/commonTest/kotlin/arrow/fx/coroutines/Platform.kt index f01ee1d1d08..90c72caf9f9 100644 --- a/arrow-libs/fx/arrow-fx-coroutines/src/commonTest/kotlin/arrow/fx/coroutines/Platform.kt +++ b/arrow-libs/fx/arrow-fx-coroutines/src/commonTest/kotlin/arrow/fx/coroutines/Platform.kt @@ -2,8 +2,18 @@ package arrow.fx.coroutines import io.kotest.common.Platform import io.kotest.common.platform +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.test.TestResult +import kotlinx.coroutines.test.runTest +import kotlinx.coroutines.withContext fun stackSafeIteration(): Int = when (platform) { - Platform.JVM -> 500_000 + Platform.JVM -> 20_000 else -> 1000 } + +fun runTestWithDelay(testBody: suspend () -> Unit): TestResult = runTest { + withContext(Dispatchers.Default) { + testBody() + } +} diff --git a/arrow-libs/fx/arrow-fx-coroutines/src/jvmTest/kotlin/arrow/fx/coroutines/RaceNJvmTest.kt b/arrow-libs/fx/arrow-fx-coroutines/src/jvmTest/kotlin/arrow/fx/coroutines/RaceNJvmTest.kt index fdaab4df01c..37737a6fff1 100644 --- a/arrow-libs/fx/arrow-fx-coroutines/src/jvmTest/kotlin/arrow/fx/coroutines/RaceNJvmTest.kt +++ b/arrow-libs/fx/arrow-fx-coroutines/src/jvmTest/kotlin/arrow/fx/coroutines/RaceNJvmTest.kt @@ -15,7 +15,7 @@ import java.util.concurrent.Executors class RaceNJvmTest : StringSpec({ "race2 returns to original context" { val racerName = "race2" - val racer = Resource.fromExecutor { Executors.newFixedThreadPool(2, NamedThreadFactory { racerName }) } + val racer = executor { Executors.newFixedThreadPool(2, NamedThreadFactory { racerName }) } checkAll(Arb.int(1..2)) { choose -> single.zip(racer).use { (single, raceCtx) -> @@ -36,7 +36,7 @@ class RaceNJvmTest : StringSpec({ "race2 returns to original context on failure" { val racerName = "race2" - val racer = Resource.fromExecutor { Executors.newFixedThreadPool(2, NamedThreadFactory { racerName }) } + val racer = executor { Executors.newFixedThreadPool(2, NamedThreadFactory { racerName }) } checkAll(Arb.int(1..2), Arb.throwable()) { choose, e -> single.zip(racer).use { (single, raceCtx) -> @@ -56,15 +56,9 @@ class RaceNJvmTest : StringSpec({ } } - "first racer out of 2 always wins on a single thread" { - single.use { ctx -> - raceN(ctx, { threadName() }, { threadName() }) - }.swap().getOrNull() shouldStartWith "single" - } - "race3 returns to original context" { val racerName = "race3" - val racer = Resource.fromExecutor { Executors.newFixedThreadPool(3, NamedThreadFactory { racerName }) } + val racer = executor { Executors.newFixedThreadPool(3, NamedThreadFactory { racerName }) } checkAll(Arb.int(1..3)) { choose -> single.zip(racer).use { (single, raceCtx) -> @@ -119,7 +113,14 @@ class RaceNJvmTest : StringSpec({ } } - /* This seems to not be true anymore + /* These tests seem to not hold anymore + + "first racer out of 2 always wins on a single thread" { + single.use { ctx -> + raceN(ctx, { threadName() }, { threadName() }) + }.swap().getOrNull() shouldStartWith "single" + } + "first racer out of 3 always wins on a single thread" { (single.use { ctx -> raceN(ctx, { threadName() }, { threadName() }, { threadName() }) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index a7d246bec2a..b3a0cc1b9e4 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -38,6 +38,7 @@ kotlin-reflect = { module = "org.jetbrains.kotlin:kotlin-reflect" } kotlin-stdlibCommon = { module = "org.jetbrains.kotlin:kotlin-stdlib-common" } kotlin-stdlib = { module = "org.jetbrains.kotlin:kotlin-stdlib" } kotlin-stdlibJS = { module = "org.jetbrains.kotlin:kotlin-stdlib-js" } +kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test" } kotlinx-knit = { module = "org.jetbrains.kotlinx:kotlinx-knit", version.ref = "knit" } kotlinx-serializationCore = { module = "org.jetbrains.kotlinx:kotlinx-serialization-core", version.ref = "kotlinxSerialization" } kotlinx-serializationJson = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "kotlinxSerialization" }