Fix some network timeline bugs (#2373)

* Fix network timeline gap loading

* Fix fullReload keeps nextKey

* Fix reload after clearing timeline

* Improve logic to handle overlapped statuses
This commit is contained in:
kyori19 2022-03-12 17:38:48 +09:00 committed by GitHub
commit 72bb34bf27
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 71 additions and 16 deletions

View file

@ -3,6 +3,7 @@ package com.keylesspalace.tusky
import com.keylesspalace.tusky.util.dec
import com.keylesspalace.tusky.util.inc
import com.keylesspalace.tusky.util.isLessThan
import com.keylesspalace.tusky.util.isLessThanOrEqual
import org.junit.Assert.assertEquals
import org.junit.Assert.assertFalse
import org.junit.Assert.assertTrue
@ -24,6 +25,20 @@ class StringUtilsTest {
notLessList.forEach { (l, r) -> assertFalse("not $l < $r", l.isLessThan(r)) }
}
@Test
fun isLessThanOrEqual() {
val lessList = listOf(
"abc" to "bcd",
"ab" to "abc",
"cb" to "abc",
"1" to "2",
"abc" to "abc",
)
lessList.forEach { (l, r) -> assertTrue("$l < $r", l.isLessThanOrEqual(r)) }
val notLessList = lessList.filterNot { (l, r) -> l == r }.map { (l, r) -> r to l }
notLessList.forEach { (l, r) -> assertFalse("not $l < $r", l.isLessThanOrEqual(r)) }
}
@Test
fun inc() {
listOf(