We should be able to convert between the various quantities and back without losing any precision. For example:
@Test
fun small_length_to_velocity_and_reverse_is_lossless() {
val distance = 100.kilometers
val duration = 1.hours
val velocity = distance / duration
assertEquals(duration, distance / velocity)
assertEquals(distance, velocity * duration)
}
Right now this test fails with the following message, and it's because we're losing precision.
java.lang.AssertionError: expected:<1h> but was:<1h 0m 0.000000100s>
at org.junit.Assert.fail(Assert.java:89)
at org.junit.Assert.failNotEquals(Assert.java:835)
at org.junit.Assert.assertEquals(Assert.java:120)
We should have integration tests that exercise the following without losing precision:
Acceleration, Mass, and Force
Acceleration, Duration, and Velocity
Area and Length
Energy, Length, and Force
Energy, Duration, and Power
Length, Duration, and Velocity
Length, Area, and Volume
We should be able to convert between the various quantities and back without losing any precision. For example:
Right now this test fails with the following message, and it's because we're losing precision.
We should have integration tests that exercise the following without losing precision:
Acceleration, Mass, and Force
Acceleration, Duration, and Velocity
Area and Length
Energy, Length, and Force
Energy, Duration, and Power
Length, Duration, and Velocity
Length, Area, and Volume