spreadsheet
typeScript/javascript spreadsheet parser, with formulas.
git clone https://git.vogt.world/spreadsheet.git
Log | Files | README.md
← Commit log
commit
message
Adding TODOs, more Sheet.ts tests.
author
Ben Vogt <[email protected]>
date
2016-12-31 21:43:49
stats
2 file(s) changed, 12 insertions(+), 1 deletions(-)
files
README.md
tests/SheetTest.ts
 1diff --git a/README.md b/README.md
 2index 08c560b..982c11f 100644
 3--- a/README.md
 4+++ b/README.md
 5@@ -4,6 +4,9 @@ TypeScript implementation of a spreadsheet.
 6 ## TODO
 7 Things I should do.
 8 
 9+### When adding a cell to the matrix, not everything should be parsed as a formula.
10+Only inputs starting with `=` should be formulas. Eg: `=SUM(A1:A8, B12, MAX(22))`
11+
12 ### Rename anything referencing an "item"
13 
14 ### `setValue()`, `getValue()` on a sheet
15diff --git a/tests/SheetTest.ts b/tests/SheetTest.ts
16index d26f894..207d073 100644
17--- a/tests/SheetTest.ts
18+++ b/tests/SheetTest.ts
19@@ -77,7 +77,6 @@ assertEquals(SUM_REF_FORMULA, K6.formula);
20 assertEquals(null, K6.error);
21 assertArrayEquals(['K1', 'K2', 'K3', 'K4'], K6.dependencies);
22 
23-
24 //Test REF error
25 var sheet  = new Sheet();
26 sheet.setCell("A1", "200");
27@@ -101,4 +100,13 @@ sheet.setCell("A2", "SUM(A1, NN)");
28 var A2 = sheet.getCell("A2");
29 assertEquals(null, A2.value);
30 assertEquals(Errors.get("NAME"), A2.error);
31-assertArrayEquals(['A1'], A2.dependencies);
32\ No newline at end of file
33+assertArrayEquals(['A1'], A2.dependencies);
34+
35+// Test unsupported formula
36+var sheet  = new Sheet();
37+sheet.setCell("A1", "1");
38+sheet.setCell("A2", "BEN(A1)");
39+var A2 = sheet.getCell("A2");
40+assertEquals(null, A2.value);
41+assertEquals(Errors.get("NAME"), A2.error);
42+assertArrayEquals(['A1'], A2.dependencies);