From eaf9781e7e51d5aacf238c9cb39a249097abed33 Mon Sep 17 00:00:00 2001 From: Arnie97 Date: Sat, 31 Jul 2021 14:20:29 +0800 Subject: Improve compatibility for SetRichText (#976) - support escaped string literal - maximum character limit added - fix missing preserve character in some case Co-authored-by: xuri --- cell_test.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'cell_test.go') 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) { -- cgit v1.2.1