diff options
author | xuri <xuri.me@gmail.com> | 2021-10-15 21:45:46 +0800 |
---|---|---|
committer | xuri <xuri.me@gmail.com> | 2021-10-15 21:45:46 +0800 |
commit | de38402f74bea9557188ad2c6f31c3127fd1bbfe (patch) | |
tree | 6c9363697638d1b78012a80bc6ce0fb45181e4bc /cell_test.go | |
parent | 58fd279dc845ebd9ccd4ba336d7c664824e70e43 (diff) |
This closes #1031, fix small float parsed error in some case
- new formula function: YEARFRAC, ref #65
- update the codecov version
- remove unused variable
Diffstat (limited to 'cell_test.go')
-rw-r--r-- | cell_test.go | 60 |
1 files changed, 58 insertions, 2 deletions
diff --git a/cell_test.go b/cell_test.go index 126e561..0395ef4 100644 --- a/cell_test.go +++ b/cell_test.go @@ -245,10 +245,66 @@ func TestGetCellValue(t *testing.T) { assert.NoError(t, err) f.Sheet.Delete("xl/worksheets/sheet1.xml") - f.Pkg.Store("xl/worksheets/sheet1.xml", []byte(fmt.Sprintf(sheetData, `<row r="1"><c r="A1"><v>2422.3000000000002</v></c><c r="B1"><v>2422.3000000000002</v></c><c r="C1"><v>12.4</v></c><c r="D1"><v>964</v></c><c r="E1"><v>1101.5999999999999</v></c><c r="F1"><v>275.39999999999998</v></c><c r="G1"><v>68.900000000000006</v></c><c r="H1"><v>44385.208333333336</v></c><c r="I1"><v>5.0999999999999996</v></c><c r="J1"><v>5.1100000000000003</v></c><c r="K1"><v>5.0999999999999996</v></c><c r="L1"><v>5.1109999999999998</v></c><c r="M1"><v>5.1111000000000004</v></c><c r="N1"><v>2422.012345678</v></c><c r="O1"><v>2422.0123456789</v></c><c r="P1"><v>12.012345678901</v></c><c r="Q1"><v>964</v></c><c r="R1"><v>1101.5999999999999</v></c><c r="S1"><v>275.39999999999998</v></c><c r="T1"><v>68.900000000000006</v></c></row>`))) + f.Pkg.Store("xl/worksheets/sheet1.xml", []byte(fmt.Sprintf(sheetData, `<row r="1"> + <c r="A1"><v>2422.3000000000002</v></c> + <c r="B1"><v>2422.3000000000002</v></c> + <c r="C1"><v>12.4</v></c> + <c r="D1"><v>964</v></c> + <c r="E1"><v>1101.5999999999999</v></c> + <c r="F1"><v>275.39999999999998</v></c> + <c r="G1"><v>68.900000000000006</v></c> + <c r="H1"><v>44385.208333333336</v></c> + <c r="I1"><v>5.0999999999999996</v></c> + <c r="J1"><v>5.1100000000000003</v></c> + <c r="K1"><v>5.0999999999999996</v></c> + <c r="L1"><v>5.1109999999999998</v></c> + <c r="M1"><v>5.1111000000000004</v></c> + <c r="N1"><v>2422.012345678</v></c> + <c r="O1"><v>2422.0123456789</v></c> + <c r="P1"><v>12.012345678901</v></c> + <c r="Q1"><v>964</v></c> + <c r="R1"><v>1101.5999999999999</v></c> + <c r="S1"><v>275.39999999999998</v></c> + <c r="T1"><v>68.900000000000006</v></c> + <c r="U1"><v>8.8880000000000001E-2</v></c> + <c r="V1"><v>4.0000000000000003E-5</v></c> + <c r="W1"><v>2422.3000000000002</v></c> + <c r="X1"><v>1101.5999999999999</v></c> + <c r="Y1"><v>275.39999999999998</v></c> + <c r="Z1"><v>68.900000000000006</v></c> + <c r="AA1"><v>1.1000000000000001</v></c> +</row>`))) f.checked = nil rows, err = f.GetRows("Sheet1") - assert.Equal(t, [][]string{{"2422.3", "2422.3", "12.4", "964", "1101.6", "275.4", "68.9", "44385.20833333333", "5.1", "5.11", "5.1", "5.111", "5.1111", "2422.012345678", "2422.0123456789", "12.012345678901", "964", "1101.6", "275.4", "68.9"}}, rows) + assert.Equal(t, [][]string{{ + "2422.3", + "2422.3", + "12.4", + "964", + "1101.6", + "275.4", + "68.9", + "44385.2083333333", + "5.1", + "5.11", + "5.1", + "5.111", + "5.1111", + "2422.012345678", + "2422.0123456789", + "12.012345678901", + "964", + "1101.6", + "275.4", + "68.9", + "0.08888", + "0.00004", + "2422.3", + "1101.6", + "275.4", + "68.9", + "1.1", + }}, rows) assert.NoError(t, err) } |