test: добавить unit тесты для helper функций записи голоса, очистка старого UI

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-11 20:47:18 +05:00
parent 620200ca44
commit 3e3f501b9b
2 changed files with 67 additions and 2 deletions

View File

@@ -108,7 +108,7 @@ private fun bytesToHexLower(bytes: ByteArray): String {
return out.toString()
}
private fun compressVoiceWaves(source: List<Float>, targetLength: Int): List<Float> {
internal fun compressVoiceWaves(source: List<Float>, targetLength: Int): List<Float> {
if (targetLength <= 0) return emptyList()
if (source.isEmpty()) return List(targetLength) { 0f }
if (source.size == targetLength) return source
@@ -142,7 +142,7 @@ private fun compressVoiceWaves(source: List<Float>, targetLength: Int): List<Flo
}
}
private fun formatVoiceRecordTimer(elapsedMs: Long): String {
internal fun formatVoiceRecordTimer(elapsedMs: Long): String {
val safeTenths = (elapsedMs.coerceAtLeast(0L) / 100L).toInt()
val totalSeconds = safeTenths / 10
val tenths = safeTenths % 10