From b7fece51736977e7d84aca30ecce7f6b3a1251f2 Mon Sep 17 00:00:00 2001 From: xuri Date: Tue, 6 Jul 2021 00:31:04 +0800 Subject: Support concurrency add picture --- cell_test.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'cell_test.go') diff --git a/cell_test.go b/cell_test.go index e289983..91f4804 100644 --- a/cell_test.go +++ b/cell_test.go @@ -10,6 +10,8 @@ import ( "testing" "time" + _ "image/jpeg" + "github.com/stretchr/testify/assert" ) @@ -25,6 +27,9 @@ func TestConcurrency(t *testing.T) { 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 add picture + assert.NoError(t, f.AddPicture("Sheet1", "F21", filepath.Join("test", "images", "excel.jpg"), + `{"x_offset": 10, "y_offset": 10, "hyperlink": "https://github.com/360EntSecGroup-Skylar/excelize", "hyperlink_type": "External", "positioning": "oneCell"}`)) // Concurrency get cell picture name, raw, err := f.GetPicture("Sheet1", "A1") assert.Equal(t, "", name) -- cgit v1.2.1