Codes read on the owner's car with 2.22.1: 1 P, 2 R, 3 N, 4 D. Gear maps them (unit-tested); other codes show no letter, unread "—". The temporary gear list on the Logs tab is removed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LhzAVaUyqcw5PkGjz4mWW6
30 lines
674 B
Java
30 lines
674 B
Java
package com.evsuite.abrp;
|
|
|
|
import static org.junit.Assert.assertEquals;
|
|
|
|
import org.junit.Test;
|
|
|
|
/** The gear letter — pure JVM. */
|
|
public class GearTest {
|
|
|
|
@Test
|
|
public void theFourCodesReadOnTheCar() {
|
|
assertEquals("P", Gear.label(1));
|
|
assertEquals("R", Gear.label(2));
|
|
assertEquals("N", Gear.label(3));
|
|
assertEquals("D", Gear.label(4));
|
|
}
|
|
|
|
@Test
|
|
public void unknownCodesShowNoLetter() {
|
|
assertEquals("", Gear.label(0));
|
|
assertEquals("", Gear.label(5));
|
|
assertEquals("", Gear.label(-1));
|
|
}
|
|
|
|
@Test
|
|
public void unreadIsADash() {
|
|
assertEquals("—", Gear.label(null));
|
|
}
|
|
}
|