aboutsummaryrefslogtreecommitdiff
path: root/core/src/test/kotlin/ca
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/test/kotlin/ca')
-rw-r--r--core/src/test/kotlin/ca/allanwang/kau/kotlin/DebounceTest.kt10
1 files changed, 5 insertions, 5 deletions
diff --git a/core/src/test/kotlin/ca/allanwang/kau/kotlin/DebounceTest.kt b/core/src/test/kotlin/ca/allanwang/kau/kotlin/DebounceTest.kt
index 05345bd..8ccdab3 100644
--- a/core/src/test/kotlin/ca/allanwang/kau/kotlin/DebounceTest.kt
+++ b/core/src/test/kotlin/ca/allanwang/kau/kotlin/DebounceTest.kt
@@ -34,18 +34,18 @@ class DebounceTest {
@Test
fun multipleDebounces() {
var i = 0
- val debounce = debounce<Int>(10) { i += it }
+ val debounce = debounce<Int>(20) { i += it }
debounce(1) //ignore -> i = 0
- Thread.sleep(5)
+ Thread.sleep(10)
assertEquals(0, i)
debounce(2) //accept -> i = 2
- Thread.sleep(15)
+ Thread.sleep(30)
assertEquals(2, i)
debounce(4) //ignore -> i = 2
- Thread.sleep(5)
+ Thread.sleep(10)
assertEquals(2, i)
debounce(8) //accept -> i = 10
- Thread.sleep(15)
+ Thread.sleep(30)
assertEquals(10, i)
}