From 470ce89b0ef66ce76f7ee442ae585e782725c077 Mon Sep 17 00:00:00 2001 From: ForteScarlet Date: Thu, 1 Aug 2024 16:44:18 +0800 Subject: [PATCH] release: v4.4.0 --- .changelog/v4.4.0.md | 0 CHANGELOG.md | 9 ++ .../src/commonTest/kotlin/AtomicTests.kt | 126 ------------------ .../src/jvmTest/kotlin/JvmAtomicTests.kt | 24 +--- website | 2 +- 5 files changed, 11 insertions(+), 150 deletions(-) create mode 100644 .changelog/v4.4.0.md diff --git a/.changelog/v4.4.0.md b/.changelog/v4.4.0.md new file mode 100644 index 000000000..e69de29bb diff --git a/CHANGELOG.md b/CHANGELOG.md index f8b07d136..4f9f21987 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +# v4.4.0 + +> Release & Pull Notes: [v4.4.0](https://github.com/simple-robot/simpler-robot/releases/tag/v4.4.0) + +- fix(quantcat): 优化统一MergedBinder对null结果、失败结果的处理 ([`d741b8617`](https://github.com/simple-robot/simpler-robot/commit/d741b8617)) +- feat(common-streamable): 增加模块与新的公共类型 Streamable, 用来简化部分针对 Sequence 类型的转化操作,例如在JVM中转为 Stream 和在 JS 中转为数组。 ([`1ba898c57`](https://github.com/simple-robot/simpler-robot/commit/1ba898c57)) +- fix(quantcat): 优化统一MergedBinder对null结果、失败结果的处理 ([`9c5777847`](https://github.com/simple-robot/simpler-robot/commit/9c5777847)) +- feat(common-streamable): 增加模块与新的公共类型 Streamable, 用来简化部分针对 Sequence 类型的转化操作,例如在JVM中转为 Stream 和在 JS 中转为数组。 ([`ca3eaa02b`](https://github.com/simple-robot/simpler-robot/commit/ca3eaa02b)) + # v4.3.1 > Release & Pull Notes: [v4.3.1](https://github.com/simple-robot/simpler-robot/releases/tag/v4.3.1) diff --git a/simbot-commons/simbot-common-atomic/src/commonTest/kotlin/AtomicTests.kt b/simbot-commons/simbot-common-atomic/src/commonTest/kotlin/AtomicTests.kt index 65689dd9f..a6574148b 100644 --- a/simbot-commons/simbot-common-atomic/src/commonTest/kotlin/AtomicTests.kt +++ b/simbot-commons/simbot-common-atomic/src/commonTest/kotlin/AtomicTests.kt @@ -21,8 +21,6 @@ * */ -import kotlinx.coroutines.* -import kotlinx.coroutines.test.runTest import love.forte.simbot.common.atomic.* import kotlin.test.* @@ -133,130 +131,6 @@ class AtomicTests { } } - @Test - fun compareAsyncTest() = runTest { - val times = 1000 - coroutineScope { - checkAtomicInt(times) - checkAtomicLong(times) - checkAtomicUInt(times) - checkAtomicULong(times) - checkAtomicRef(times) - } - } - - private suspend fun checkAtomicInt(times: Int) { - val atomic = atomic(0) - - withContext(Dispatchers.Default) { - launch { - repeat(times) { - launch { - atomic += 1 - } - yield() - } - } - launch { - repeat(times) { - launch { - atomic.update { it + 1 } - } - yield() - } - } - } - - assertEquals(times * 2, atomic.value) - } - - private suspend fun checkAtomicLong(times: Int) { - val atomic = atomic(0L) - - withContext(Dispatchers.Default) { - launch { - repeat(times) { - launch { - atomic += 1L - } - } - } - launch { - repeat(times) { - launch { - atomic.update { it + 1L } - } - } - } - } - - assertEquals((times * 2).toLong(), atomic.value) - } - - private suspend fun checkAtomicUInt(times: Int) { - val atomic = atomic(0u) - - withContext(Dispatchers.Default) { - launch { - repeat(times) { - launch { - atomic += 1u - } - } - } - launch { - repeat(times) { - launch { - atomic.update { it + 1u } - } - } - } - } - - assertEquals((times * 2).toUInt(), atomic.value) - } - - private suspend fun checkAtomicULong(times: Int) { - val atomic = atomicUL(0u) - - withContext(Dispatchers.Default) { - launch { - repeat(times) { - launch { - atomic += 1u - } - } - } - launch { - repeat(times) { - launch { - atomic.update { it + 1u } - } - } - } - } - - assertEquals((times * 2).toULong(), atomic.value) - } - - private suspend fun checkAtomicRef(times: Int) { - data class Value(val value: Int) - - val atomic = atomicRef(Value(0)) - - withContext(Dispatchers.Default) { - launch { - repeat(times) { - launch { - atomic.update { it.copy(value = it.value + 1) } - } - } - } - } - - assertEquals(Value(times), atomic.value) - } - @Test fun atomicEqualsTest() { assertNotEquals(atomic(0), atomic(0)) diff --git a/simbot-commons/simbot-common-atomic/src/jvmTest/kotlin/JvmAtomicTests.kt b/simbot-commons/simbot-common-atomic/src/jvmTest/kotlin/JvmAtomicTests.kt index a23f2048b..f8788c52c 100644 --- a/simbot-commons/simbot-common-atomic/src/jvmTest/kotlin/JvmAtomicTests.kt +++ b/simbot-commons/simbot-common-atomic/src/jvmTest/kotlin/JvmAtomicTests.kt @@ -30,32 +30,10 @@ import org.jetbrains.kotlinx.lincheck.strategy.managed.modelchecking.ModelChecki import org.jetbrains.kotlinx.lincheck.strategy.stress.StressOptions import kotlin.test.Test -/* - * Copyright (c) 2024. ForteScarlet. - * - * Project https://github.com/simple-robot/simpler-robot - * Email ForteScarlet@163.com - * - * This file is part of the Simple Robot Library (Alias: simple-robot, simbot, etc.). - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * Lesser GNU General Public License for more details. - * - * You should have received a copy of the Lesser GNU General Public License - * along with this program. If not, see . - * - */ - abstract class AtomicStressTest { @Test fun stressTest() = StressOptions().check(this::class) + @Test fun modelCheckingTest() = ModelCheckingOptions().check(this::class) } diff --git a/website b/website index 78257d2e8..b0e7c34d8 160000 --- a/website +++ b/website @@ -1 +1 @@ -Subproject commit 78257d2e8f8c686328c1ef7dc72bae2e559b02a1 +Subproject commit b0e7c34d88e13fa7c4ecf07761388c010fcbf30e