summaryrefslogtreecommitdiff
path: root/pivotTable_test.go
diff options
context:
space:
mode:
authorxuri <xuri.me@gmail.com>2022-05-26 00:15:28 +0800
committerxuri <xuri.me@gmail.com>2022-05-26 00:15:28 +0800
commit1c167b96a35a58990f777025914283b492d0785f (patch)
tree9d9aade7ad8da581c220c7fb7806a9f8bf9748b2 /pivotTable_test.go
parentafb2d27c90130878b82a70b44ccb4e30344cc09e (diff)
Improves the calculation engine, docs update, and adds the dependabot
- Initialize array formula support for the formula calculation engine - Update example and unit test of `AddPivotTable` - Update the supported hash algorithm of ProtectSheet
Diffstat (limited to 'pivotTable_test.go')
-rw-r--r--pivotTable_test.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/pivotTable_test.go b/pivotTable_test.go
index 2f95ed4..adba2eb 100644
--- a/pivotTable_test.go
+++ b/pivotTable_test.go
@@ -18,12 +18,12 @@ func TestAddPivotTable(t *testing.T) {
types := []string{"Meat", "Dairy", "Beverages", "Produce"}
region := []string{"East", "West", "North", "South"}
assert.NoError(t, f.SetSheetRow("Sheet1", "A1", &[]string{"Month", "Year", "Type", "Sales", "Region"}))
- for i := 0; i < 30; i++ {
- assert.NoError(t, f.SetCellValue("Sheet1", fmt.Sprintf("A%d", i+2), month[rand.Intn(12)]))
- assert.NoError(t, f.SetCellValue("Sheet1", fmt.Sprintf("B%d", i+2), year[rand.Intn(3)]))
- assert.NoError(t, f.SetCellValue("Sheet1", fmt.Sprintf("C%d", i+2), types[rand.Intn(4)]))
- assert.NoError(t, f.SetCellValue("Sheet1", fmt.Sprintf("D%d", i+2), rand.Intn(5000)))
- assert.NoError(t, f.SetCellValue("Sheet1", fmt.Sprintf("E%d", i+2), region[rand.Intn(4)]))
+ for row := 2; row < 32; row++ {
+ assert.NoError(t, f.SetCellValue("Sheet1", fmt.Sprintf("A%d", row), month[rand.Intn(12)]))
+ assert.NoError(t, f.SetCellValue("Sheet1", fmt.Sprintf("B%d", row), year[rand.Intn(3)]))
+ assert.NoError(t, f.SetCellValue("Sheet1", fmt.Sprintf("C%d", row), types[rand.Intn(4)]))
+ assert.NoError(t, f.SetCellValue("Sheet1", fmt.Sprintf("D%d", row), rand.Intn(5000)))
+ assert.NoError(t, f.SetCellValue("Sheet1", fmt.Sprintf("E%d", row), region[rand.Intn(4)]))
}
assert.NoError(t, f.AddPivotTable(&PivotTableOption{
DataRange: "Sheet1!$A$1:$E$31",