spreadsheet
typeScript/javascript spreadsheet parser, with formulas.
git clone https://git.vogt.world/spreadsheet.git
Log | Files | README.md
← Commit log
commit
message
[CONVERT] More tests
author
Ben Vogt <[email protected]>
date
2017-05-05 00:25:26
stats
2 file(s) changed, 15 insertions(+), 2 deletions(-)
files
README.md
tests/Formulas/TextTest.ts
 1diff --git a/README.md b/README.md
 2index 9d13d0e..1806b7b 100644
 3--- a/README.md
 4+++ b/README.md
 5@@ -63,5 +63,9 @@ Right now we're just using the number of days since 1900, but we should check th
 6 ### Test all functions in src/Utilities
 7 
 8 
 9+### CONVERT could offer more accurate conversions for units in the same system
10+For example 64 tbs to a qt.
11+
12+
13 ### Sheet.ts and parser.js should be able to concatenate strings
14 E.g. `=COUNTIFS(A7:A24, ">6", B7:B24, "<"&DATE(1969,7,20))`
15\ No newline at end of file
16diff --git a/tests/Formulas/TextTest.ts b/tests/Formulas/TextTest.ts
17index ff50705..2534f5e 100644
18--- a/tests/Formulas/TextTest.ts
19+++ b/tests/Formulas/TextTest.ts
20@@ -95,12 +95,21 @@ test("CONCATENATE", function(){
21 });
22 
23 
24-// TODO: More tests for CONVERT.
25 test("CONVERT", function(){
26   assertEquals(CONVERT(5.1, "mm", "m"), 0.0050999999999999995);
27   assertEquals(CONVERT(5.1, "mm", "km"), 0.0000050999999999999995);
28   assertEquals(CONVERT(5.1, "g", "kg"), 0.0050999999999999995);
29   assertEquals(CONVERT(35.7, "in^2", "m^2"), 0.023032212);
30+  assertEquals(CONVERT(100, "ft3", "in3"), 172800);
31+  assertEquals(CONVERT(100, "in3", "ft3"), 0.057870370370370364);
32+  assertEquals(CONVERT(0.0001, "ly", "ft"), 3103914197040.945);
33+  assertEquals(CONVERT(44, "m/h", "m/s"), 0.01222222222222232);
34+  assertEquals(CONVERT(10, "mph", "m/s"), 4.4704);
35+  assertEquals(CONVERT(10, "mmHg", "Pa"), 1333.22);
36+  assertEquals(CONVERT(10, "PS", "W"), 7354.987499999999);
37+  assertEquals(CONVERT(10, "ton", "stone"), 1428.5714285714287);
38+  assertEquals(CONVERT(10, "tspm", "bushel"), 0.0014188796696394089);
39+  assertEquals(CONVERT(10, "c", "Wh"), 0.011622222222222223);
40 });
41 
42