diff options
author | xuri <xuri.me@gmail.com> | 2021-09-17 00:15:51 +0800 |
---|---|---|
committer | xuri <xuri.me@gmail.com> | 2021-09-17 00:15:51 +0800 |
commit | 2add938798cdd1456616869298319528b0c76913 (patch) | |
tree | 6df02447bf25779e5bd6099ade16438568c9640e /calc_test.go | |
parent | 1ba3690764e90aa6f7bcb3cb1e095475d40e3d91 (diff) |
- new formula functions: DATEVALUE, ref #65
- fix ineffectual variable assignments
- timeout in go test
Diffstat (limited to 'calc_test.go')
-rw-r--r-- | calc_test.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/calc_test.go b/calc_test.go index 763ea1f..1e4d99b 100644 --- a/calc_test.go +++ b/calc_test.go @@ -956,6 +956,11 @@ func TestCalcCellValue(t *testing.T) { "=DATEDIF(43101,43891,\"YD\")": "59", "=DATEDIF(36526,73110,\"YD\")": "60", "=DATEDIF(42171,44242,\"yd\")": "244", + // DATEVALUE + "=DATEVALUE(\"01/01/16\")": "42370", + "=DATEVALUE(\"01/01/2016\")": "42370", + "=DATEVALUE(\"01/01/29\")": "47119", + "=DATEVALUE(\"01/01/30\")": "10959", // DAY "=DAY(0)": "0", "=DAY(INT(7))": "7", @@ -1997,6 +2002,10 @@ func TestCalcCellValue(t *testing.T) { "=DATEDIF(\"\",\"\",\"\")": "strconv.ParseFloat: parsing \"\": invalid syntax", "=DATEDIF(43891,43101,\"Y\")": "start_date > end_date", "=DATEDIF(43101,43891,\"x\")": "DATEDIF has invalid unit", + // DATEVALUE + "=DATEVALUE()": "DATEVALUE requires 1 argument", + "=DATEVALUE(\"01/01\")": "#VALUE!", // valid in Excel, which uses years by the system date + "=DATEVALUE(\"1900-0-0\")": "#VALUE!", // DAY "=DAY()": "DAY requires exactly 1 argument", "=DAY(-1)": "DAY only accepts positive argument", |