diff options
author | Arnie97 <arnie97@gmail.com> | 2021-07-31 14:20:29 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-31 14:20:29 +0800 |
commit | eaf9781e7e51d5aacf238c9cb39a249097abed33 (patch) | |
tree | 9deb351e064afe201ac6882fea071b0a76e0ca52 /cell_test.go | |
parent | 7ac37edfebebc9bee201fad001e2f2f8b780a9a8 (diff) |
Improve compatibility for SetRichText (#976)
- support escaped string literal
- maximum character limit added
- fix missing preserve character in some case
Co-authored-by: xuri <xuri.me@gmail.com>
Diffstat (limited to 'cell_test.go')
-rw-r--r-- | cell_test.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/cell_test.go b/cell_test.go index ea62869..3954438 100644 --- a/cell_test.go +++ b/cell_test.go @@ -401,6 +401,9 @@ func TestSetCellRichText(t *testing.T) { assert.EqualError(t, f.SetCellRichText("SheetN", "A1", richTextRun), "sheet SheetN is not exist") // Test set cell rich text with illegal cell coordinates assert.EqualError(t, f.SetCellRichText("Sheet1", "A", richTextRun), `cannot convert cell "A" to coordinates: invalid cell name "A"`) + richTextRun = []RichTextRun{{Text: strings.Repeat("s", TotalCellChars+1)}} + // Test set cell rich text with characters over the maximum limit + assert.EqualError(t, f.SetCellRichText("Sheet1", "A1", richTextRun), ErrCellCharsLength.Error()) } func TestFormattedValue2(t *testing.T) { |