-
Notifications
You must be signed in to change notification settings - Fork 1
fix: 한손 모아키 ㅣ/ㅡ 위로 스와이프 입력 수정 및 관련 버그 수정 #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| package dev.bsb.moakeyvim.config | ||
|
|
||
| import dev.bsb.moakeyvim.R | ||
|
|
||
| enum class LandscapeKoLayout(val labelResId: Int) { | ||
| NONE(R.string.settings_landscape_ko_layout_none), | ||
| QWERTY(R.string.settings_input_mode_qwerty), | ||
| QWERTY_SIMPLE(R.string.settings_input_mode_qwerty_simple); | ||
|
|
||
| val isQwerty: Boolean get() = this != NONE | ||
| val isSimple: Boolean get() = this == QWERTY_SIMPLE | ||
|
|
||
| companion object { | ||
| fun fromString(value: String?): LandscapeKoLayout = | ||
| values().find { it.name == value } ?: NONE | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| package dev.bsb.moakeyvim.view.keytouchlistener | ||
|
|
||
| import dev.bsb.moakeyvim.view.message.StringKeyMessage | ||
| import org.junit.Assert.assertEquals | ||
| import org.junit.Test | ||
|
|
||
| class CrossKeyTouchListenerTest { | ||
|
|
||
| private val threshold = 50f | ||
|
|
||
| private fun testKeyList() = listOf( | ||
| StringKeyMessage("UP"), | ||
| StringKeyMessage("RIGHT"), | ||
| StringKeyMessage("CENTER"), | ||
| StringKeyMessage("LEFT"), | ||
| ) | ||
|
|
||
| private fun moeumKeyList() = listOf( | ||
| StringKeyMessage("ㆍ"), | ||
| StringKeyMessage("ㅡ"), | ||
| StringKeyMessage("ㆍ"), | ||
| StringKeyMessage("ㅣ"), | ||
| ) | ||
|
|
||
| @Test | ||
| fun `임계값 이하 이동은 CENTER키 반환`() { | ||
| val result = resolveKeyFromGesture(0f, 0f, 10f, 10f, threshold, testKeyList()) | ||
| assertEquals("CENTER", result.key) | ||
| } | ||
|
|
||
| @Test | ||
| fun `위로 스와이프하면 keyList-0 반환`() { | ||
| val result = resolveKeyFromGesture(0f, 100f, 0f, 0f, threshold, testKeyList()) | ||
| assertEquals("UP", result.key) | ||
| } | ||
|
|
||
| @Test | ||
| fun `오른쪽으로 스와이프하면 keyList-1 반환`() { | ||
| val result = resolveKeyFromGesture(0f, 0f, 100f, 0f, threshold, testKeyList()) | ||
| assertEquals("RIGHT", result.key) | ||
| } | ||
|
|
||
| @Test | ||
| fun `아래로 스와이프하면 keyList-2 반환`() { | ||
| val result = resolveKeyFromGesture(0f, 0f, 0f, 100f, threshold, testKeyList()) | ||
| assertEquals("CENTER", result.key) | ||
| } | ||
|
|
||
| @Test | ||
| fun `왼쪽으로 스와이프하면 keyList-3 반환`() { | ||
| val result = resolveKeyFromGesture(100f, 0f, 0f, 0f, threshold, testKeyList()) | ||
| assertEquals("LEFT", result.key) | ||
| } | ||
|
|
||
| @Test | ||
| fun `임계값 경계값 - threshold 초과 시 방향 감지`() { | ||
| val justOver = resolveKeyFromGesture(0f, 100f, 0f, 49f, threshold, testKeyList()) | ||
| assertEquals("UP", justOver.key) | ||
| } | ||
|
|
||
| @Test | ||
| fun `임계값 경계값 - threshold 이하 시 CENTER 반환`() { | ||
| val justUnder = resolveKeyFromGesture(0f, 0f, 0f, 50f, threshold, testKeyList()) | ||
| assertEquals("CENTER", justUnder.key) | ||
| } | ||
|
|
||
| @Test | ||
| fun `모아키 모음키 위로 스와이프는 아래아 단일 반환 - 이중 아래아 아님`() { | ||
| val result = resolveKeyFromGesture(0f, 100f, 0f, 0f, threshold, moeumKeyList()) | ||
| assertEquals("ㆍ", result.key) | ||
| assert(result.key != "ᆢ") { "위로 스와이프에 아래아 이중(ᆢ)이 반환되면 안 됨" } | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Verify whether JVM assertions are enabled for tests and find Kotlin assert usage in test sources.
rg -n --iglob '*gradle*' 'jvmArgs|enableAssertions|-ea'
rg -n --iglob '*Test.kt' '\bassert\s*\('Repository: verlane/moakey-vim Length of output: 866 🏁 Script executed: #!/bin/bash
# Find all gradle configuration files
find . -name "build.gradle*" -o -name "settings.gradle*" | head -20
# Check for gradle wrapper properties that might affect JVM args
cat gradle/wrapper/gradle-wrapper.properties 2>/dev/null || echo "No gradle wrapper properties found"
# Search more broadly for test task configuration and JVM argument settings
rg -U 'test\s*\{|jvmArgs|java\s*\{' --type kotlin --type gradle -A 5 | head -50Repository: verlane/moakey-vim Length of output: 365 🏁 Script executed: #!/bin/bash
# Check the main build.gradle and app/build.gradle for test configuration
echo "=== ./build.gradle ==="
cat ./build.gradle
echo -e "\n=== ./app/build.gradle ==="
cat ./app/build.gradle
# Also check if JUnit is in dependencies
echo -e "\n=== Checking for JUnit in dependencies ==="
rg 'junit|jUnit' build.gradle app/build.gradleRepository: verlane/moakey-vim Length of output: 2009 🏁 Script executed: #!/bin/bash
# Check the test file to understand context and verify assert usage
cat -n app/src/test/kotlin/dev/bsb/moakeyvim/view/keytouchlistener/CrossKeyTouchListenerTest.kt | sed -n '65,80p'
# Check what JUnit imports are used in the test
head -30 app/src/test/kotlin/dev/bsb/moakeyvim/view/keytouchlistener/CrossKeyTouchListenerTest.ktRepository: verlane/moakey-vim Length of output: 1169 Replace Kotlin Line 71 uses Kotlin's 🤖 Prompt for AI Agents |
||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Preserve migrated legacy value instead of hard-defaulting to
NONE.Line 127~128 currently initializes
landscape_ko_layouttoLandscapeKoLayout.NONEwhen unset, which can overwrite users’ legacylandscape_qwerty=truebefore migration logic is applied.Suggested fix
📝 Committable suggestion
🤖 Prompt for AI Agents