Put Pit Log under version control so the app and sync server can live on git.
This commit is contained in:
commit
1030bac79e
79 files changed
+8463
No files matched your search
@@ -0,0 +1,43 @@
|
||||
package com.racingapp.pitlog.model
|
||||
|
||||
import com.racingapp.pitlog.data.SetupSheet
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Assert.assertTrue
|
||||
import org.junit.Test
|
||||
|
||||
class SetupLogTest {
|
||||
@Test
|
||||
fun diffsOnlyTheFieldsThatMoved() {
|
||||
val original = SetupSheet(
|
||||
recordedAt = 1L,
|
||||
springRf = 1000,
|
||||
toeFront = 0.125,
|
||||
swayBarHole = 4,
|
||||
)
|
||||
val later = original.copy(
|
||||
springRf = 1050,
|
||||
toeFront = 0.063,
|
||||
swayBarHole = 3,
|
||||
)
|
||||
assertEquals(
|
||||
listOf(
|
||||
"RF spring 1000 lb → 1050 lb",
|
||||
"Sway bar Setting 4 → Setting 3",
|
||||
"Front toe 0.125 in → 0.063 in",
|
||||
),
|
||||
setupDiffs(original, later),
|
||||
)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun anUnchangedSheetHasNoDiff() {
|
||||
val sheet = SetupSheet(recordedAt = 1L, springLf = 950, camberRf = -7.0)
|
||||
assertTrue(setupDiffs(sheet, sheet.copy(note = "perch tweak")).isEmpty())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun originalLinesSkipBlankFields() {
|
||||
val lines = setupLines(SetupSheet(recordedAt = 1L, crossPercent = 53.5, blockLr = 2.0))
|
||||
assertEquals(listOf("Cross 53.5%", "LR block 2 in"), lines)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user