add timestamp keycode and setting for adjusting format, fixes GH-846

This commit is contained in:
Helium314 2025-03-29 12:36:07 +01:00
parent 525c4e59b6
commit 8932fc84e1
11 changed files with 90 additions and 24 deletions

View file

@ -23,6 +23,7 @@ import helium314.keyboard.latin.inputlogic.InputLogic
import helium314.keyboard.latin.inputlogic.SpaceState
import helium314.keyboard.latin.settings.Settings
import helium314.keyboard.latin.utils.ScriptUtils
import helium314.keyboard.latin.utils.getTimestamp
import helium314.keyboard.latin.utils.prefs
import org.junit.runner.RunWith
import org.mockito.Mockito
@ -666,6 +667,13 @@ class InputLogicTest {
// need to avoid getting into the mWordComposer.isBatchMode() part of handleBackspaceEvent
}
@Test fun timestamp() {
reset()
chainInput("hello")
functionalKeyPress(KeyCode.TIMESTAMP)
assertEquals("hello" + getTimestamp(latinIME), text)
}
// ------- helper functions ---------
// should be called before every test, so the same state is guaranteed