Have numericLerp work in fixed point based on the longest operand.
[string-lerp.git] / tests / string-lerp.js
index 0a68921..2eccba6 100644 (file)
@@ -157,6 +157,12 @@ JS.Test.describe('numeric lerp', function () { with (this) {
         assertEqual("12.3", lerp("0.0", "100.0", 0.123));
     }});
 
+    it("thinks about precision", function () { with (this) {
+        assertEqual("12.30", lerp("0", "100.00", 0.123));
+        assertEqual("12.30", lerp("0.00", "100", 0.123));
+        assertEqual("12.300", lerp("0.000", "100.000", 0.123));
+    }});
+
     it("computes parameters outside [0, 1]", function () { with (this) {
         assertEqual("Giving 110%", lerp("Giving 0%", "Giving 100%", 1.1));
     }});