SHA256
Add real native onboarding/auth/dashboard/tasks/notes/shopping, origin-bound HTTPS and encrypted AndroidKeyStore session persistence. Archive the superseded browser renderer and tests. Verify 10 JVM tests, 6 native API-35 emulator tests, lintDebug/lintRelease and debug/unsigned release APK/AAB builds; the real upstream suite passes 7 tests and exports a nonblank native fixture screenshot. Tink host-tool update removes the old generated-protobuf warning. Full module/visual parity remains explicitly incomplete.
32 lines
906 B
Kotlin
32 lines
906 B
Kotlin
package community.yuvomi.mobile
|
|
|
|
import org.junit.Assert.assertFalse
|
|
import org.junit.Assert.assertTrue
|
|
import org.junit.Test
|
|
|
|
class SelectionGateTest {
|
|
@Test fun acceptsOnlyTheInitiatingContextOnce() {
|
|
val gate = SelectionGate()
|
|
assertTrue(gate.begin(0))
|
|
assertTrue(gate.consume(0))
|
|
assertFalse(gate.consume(0))
|
|
}
|
|
|
|
@Test fun serverSwitchCannotDeliverAnOldSelectionToTheNewServer() {
|
|
val gate = SelectionGate()
|
|
assertTrue(gate.begin(0))
|
|
assertFalse(gate.begin(1))
|
|
assertFalse(gate.consume(1))
|
|
assertTrue(gate.begin(1))
|
|
assertTrue(gate.consume(1))
|
|
}
|
|
|
|
@Test fun processRecreationCancelsSelectionWithoutReusingItsCallback() {
|
|
val gate = SelectionGate()
|
|
gate.restoreOutstanding()
|
|
assertFalse(gate.begin(0))
|
|
assertFalse(gate.consume(0))
|
|
assertTrue(gate.begin(0))
|
|
}
|
|
}
|