From 0e02329bedf6648259fd219642bb907bdb07fd21 Mon Sep 17 00:00:00 2001 From: xuri Date: Sun, 4 Jul 2021 12:13:06 +0800 Subject: This closes #861, support concurrency get cell picture and remove unused internal function `getSheetNameByID` --- cell_test.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'cell_test.go') diff --git a/cell_test.go b/cell_test.go index 51ee956..2282e55 100644 --- a/cell_test.go +++ b/cell_test.go @@ -14,15 +14,23 @@ import ( ) func TestConcurrency(t *testing.T) { - f := NewFile() + f, err := OpenFile(filepath.Join("test", "Book1.xlsx")) + assert.NoError(t, err) wg := new(sync.WaitGroup) for i := 1; i <= 5; i++ { wg.Add(1) go func(val int, t *testing.T) { + // Concurrency set cell value assert.NoError(t, f.SetCellValue("Sheet1", fmt.Sprintf("A%d", val), val)) assert.NoError(t, f.SetCellValue("Sheet1", fmt.Sprintf("B%d", val), strconv.Itoa(val))) _, err := f.GetCellValue("Sheet1", fmt.Sprintf("A%d", val)) assert.NoError(t, err) + // Concurrency get cell picture + name, raw, err := f.GetPicture("Sheet1", "A1") + assert.Equal(t, "", name) + assert.Nil(t, raw) + assert.NoError(t, err) + wg.Done() }(i, t) } -- cgit v1.2.1