-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
65 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
app/src/test/java/xyz/neupokoev/forgottenstandards/ConvertValueTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package xyz.neupokoev.forgottenstandards | ||
|
||
import io.github.mikolasan.convertmeifyoucan.FunctionParser | ||
import io.github.mikolasan.ratiogenerator.MinLengthUnits | ||
import io.github.mikolasan.ratiogenerator.findConversionFormula | ||
import org.junit.Assert.assertEquals | ||
import org.junit.Test | ||
|
||
class ConvertValueTest { | ||
@Test | ||
fun allLengthUnits() { | ||
val units = MinLengthUnits.units | ||
val start = System.currentTimeMillis() | ||
for (fromUnit in units) { | ||
for (toUnit in units) { | ||
if (fromUnit.unitName == toUnit.unitName) continue | ||
val ret = convertValue(fromUnit, toUnit, 42.0) | ||
assert(ret.isFinite()) | ||
} | ||
} | ||
|
||
for (fromUnit in units) { | ||
for (toUnit in units) { | ||
if (fromUnit.unitName == toUnit.unitName) continue | ||
val ret = convertValue(fromUnit, toUnit, 42.0) | ||
assert(ret.isFinite()) | ||
} | ||
} | ||
val end = System.currentTimeMillis() | ||
println("allLengthUnits took " + (end - start) + " MilliSeconds") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters