diff options
author | xuri <xuri.me@gmail.com> | 2021-07-06 00:31:04 +0800 |
---|---|---|
committer | xuri <xuri.me@gmail.com> | 2021-07-06 00:31:04 +0800 |
commit | b7fece51736977e7d84aca30ecce7f6b3a1251f2 (patch) | |
tree | 77c730b216adbdf54b1b5c3542478bfcb2e5c61b /cell_test.go | |
parent | 544ef18a8cb9949fcb8833c6d2816783c90f3318 (diff) |
Support concurrency add picture
Diffstat (limited to 'cell_test.go')
-rw-r--r-- | cell_test.go | 5 |
1 files changed, 5 insertions, 0 deletions
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) |