Skip to content

Commit 470ce89

Browse files
committed
release: v4.4.0
1 parent defde35 commit 470ce89

File tree

5 files changed

+11
-150
lines changed

5 files changed

+11
-150
lines changed

.changelog/v4.4.0.md

Whitespace-only changes.

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
# v4.4.0
2+
3+
> Release & Pull Notes: [v4.4.0](https://github.com/simple-robot/simpler-robot/releases/tag/v4.4.0)
4+
5+
- fix(quantcat): 优化统一MergedBinder对null结果、失败结果的处理 ([`d741b8617`](https://github.com/simple-robot/simpler-robot/commit/d741b8617))
6+
- feat(common-streamable): 增加模块与新的公共类型 Streamable, 用来简化部分针对 Sequence 类型的转化操作,例如在JVM中转为 Stream 和在 JS 中转为数组。 ([`1ba898c57`](https://github.com/simple-robot/simpler-robot/commit/1ba898c57))
7+
- fix(quantcat): 优化统一MergedBinder对null结果、失败结果的处理 ([`9c5777847`](https://github.com/simple-robot/simpler-robot/commit/9c5777847))
8+
- feat(common-streamable): 增加模块与新的公共类型 Streamable, 用来简化部分针对 Sequence 类型的转化操作,例如在JVM中转为 Stream 和在 JS 中转为数组。 ([`ca3eaa02b`](https://github.com/simple-robot/simpler-robot/commit/ca3eaa02b))
9+
110
# v4.3.1
211

312
> Release & Pull Notes: [v4.3.1](https://github.com/simple-robot/simpler-robot/releases/tag/v4.3.1)

simbot-commons/simbot-common-atomic/src/commonTest/kotlin/AtomicTests.kt

Lines changed: 0 additions & 126 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@
2121
*
2222
*/
2323

24-
import kotlinx.coroutines.*
25-
import kotlinx.coroutines.test.runTest
2624
import love.forte.simbot.common.atomic.*
2725
import kotlin.test.*
2826

@@ -133,130 +131,6 @@ class AtomicTests {
133131
}
134132
}
135133

136-
@Test
137-
fun compareAsyncTest() = runTest {
138-
val times = 1000
139-
coroutineScope {
140-
checkAtomicInt(times)
141-
checkAtomicLong(times)
142-
checkAtomicUInt(times)
143-
checkAtomicULong(times)
144-
checkAtomicRef(times)
145-
}
146-
}
147-
148-
private suspend fun checkAtomicInt(times: Int) {
149-
val atomic = atomic(0)
150-
151-
withContext(Dispatchers.Default) {
152-
launch {
153-
repeat(times) {
154-
launch {
155-
atomic += 1
156-
}
157-
yield()
158-
}
159-
}
160-
launch {
161-
repeat(times) {
162-
launch {
163-
atomic.update { it + 1 }
164-
}
165-
yield()
166-
}
167-
}
168-
}
169-
170-
assertEquals(times * 2, atomic.value)
171-
}
172-
173-
private suspend fun checkAtomicLong(times: Int) {
174-
val atomic = atomic(0L)
175-
176-
withContext(Dispatchers.Default) {
177-
launch {
178-
repeat(times) {
179-
launch {
180-
atomic += 1L
181-
}
182-
}
183-
}
184-
launch {
185-
repeat(times) {
186-
launch {
187-
atomic.update { it + 1L }
188-
}
189-
}
190-
}
191-
}
192-
193-
assertEquals((times * 2).toLong(), atomic.value)
194-
}
195-
196-
private suspend fun checkAtomicUInt(times: Int) {
197-
val atomic = atomic(0u)
198-
199-
withContext(Dispatchers.Default) {
200-
launch {
201-
repeat(times) {
202-
launch {
203-
atomic += 1u
204-
}
205-
}
206-
}
207-
launch {
208-
repeat(times) {
209-
launch {
210-
atomic.update { it + 1u }
211-
}
212-
}
213-
}
214-
}
215-
216-
assertEquals((times * 2).toUInt(), atomic.value)
217-
}
218-
219-
private suspend fun checkAtomicULong(times: Int) {
220-
val atomic = atomicUL(0u)
221-
222-
withContext(Dispatchers.Default) {
223-
launch {
224-
repeat(times) {
225-
launch {
226-
atomic += 1u
227-
}
228-
}
229-
}
230-
launch {
231-
repeat(times) {
232-
launch {
233-
atomic.update { it + 1u }
234-
}
235-
}
236-
}
237-
}
238-
239-
assertEquals((times * 2).toULong(), atomic.value)
240-
}
241-
242-
private suspend fun checkAtomicRef(times: Int) {
243-
data class Value(val value: Int)
244-
245-
val atomic = atomicRef(Value(0))
246-
247-
withContext(Dispatchers.Default) {
248-
launch {
249-
repeat(times) {
250-
launch {
251-
atomic.update { it.copy(value = it.value + 1) }
252-
}
253-
}
254-
}
255-
}
256-
257-
assertEquals(Value(times), atomic.value)
258-
}
259-
260134
@Test
261135
fun atomicEqualsTest() {
262136
assertNotEquals(atomic(0), atomic(0))

simbot-commons/simbot-common-atomic/src/jvmTest/kotlin/JvmAtomicTests.kt

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -30,32 +30,10 @@ import org.jetbrains.kotlinx.lincheck.strategy.managed.modelchecking.ModelChecki
3030
import org.jetbrains.kotlinx.lincheck.strategy.stress.StressOptions
3131
import kotlin.test.Test
3232

33-
/*
34-
* Copyright (c) 2024. ForteScarlet.
35-
*
36-
* Project https://github.com/simple-robot/simpler-robot
37-
38-
*
39-
* This file is part of the Simple Robot Library (Alias: simple-robot, simbot, etc.).
40-
*
41-
* This program is free software: you can redistribute it and/or modify
42-
* it under the terms of the GNU Lesser General Public License as published by
43-
* the Free Software Foundation, either version 3 of the License, or
44-
* (at your option) any later version.
45-
*
46-
* This program is distributed in the hope that it will be useful,
47-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
48-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
49-
* Lesser GNU General Public License for more details.
50-
*
51-
* You should have received a copy of the Lesser GNU General Public License
52-
* along with this program. If not, see <https://www.gnu.org/licenses/>.
53-
*
54-
*/
55-
5633
abstract class AtomicStressTest {
5734
@Test
5835
fun stressTest() = StressOptions().check(this::class)
36+
5937
@Test
6038
fun modelCheckingTest() = ModelCheckingOptions().check(this::class)
6139
}

website

0 commit comments

Comments
 (0)