Files
mg4/app/src/test/java/com/evsuite/abrp/UpdateLogTest.java
T
nilsandClaude Opus 5.5 51beea5ed8 App 2.19.3: update log on the Logs tab
Every update and install step, with the platform's own result, kept
across the restart an install causes, so a failed install on the car
can be read off the screen.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LhzAVaUyqcw5PkGjz4mWW6
2026-10-23 21:15:44 +02:00

26 lines
720 B
Java

package com.evsuite.abrp;
import static org.junit.Assert.assertEquals;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import org.junit.Test;
/** The update log's line handling — pure JVM. */
public class UpdateLogTest {
@Test
public void newestComesFirstAndTheOldestFallsOff() {
List<String> lines = UpdateLog.append(Arrays.asList("b", "a"), "c", 2);
assertEquals(Arrays.asList("c", "b"), lines);
}
@Test
public void aMultiLinePlatformMessageStaysOneLine() {
List<String> lines = UpdateLog.append(Collections.emptyList(), "failed:\nINSTALL_X\r", 10);
assertEquals(Collections.singletonList("failed: INSTALL_X "), lines);
}
}