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
26 lines
720 B
Java
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);
|
|
}
|
|
}
|