test: добавить unit тесты для helper функций записи голоса, очистка старого UI
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user