@@ -32,6 +32,8 @@ func TestAddComment(t *testing.T) {
3232 assert .NoError (t , f .AddComment ("Sheet1" , Comment {Cell : "A30" , Author : s , Text : s , Paragraph : []RichTextRun {{Text : s }, {Text : s }}}))
3333 assert .NoError (t , f .AddComment ("Sheet2" , Comment {Cell : "B7" , Author : "Excelize" , Text : s [:TotalCellChars - 1 ], Paragraph : []RichTextRun {{Text : "Excelize: " , Font : & Font {Bold : true }}, {Text : "This is a comment." }}}))
3434
35+ // Test add comment on a cell which already exists a comment
36+ assert .Equal (t , f .AddComment ("Sheet2" , Comment {Cell : "B7" , Author : s , Text : s }), newAddCommentError ("B7" ))
3537 // Test add comment on not exists worksheet
3638 assert .EqualError (t , f .AddComment ("SheetN" , Comment {Cell : "B7" , Author : "Excelize" , Paragraph : []RichTextRun {{Text : "Excelize: " , Font : & Font {Bold : true }}, {Text : "This is a comment." }}}), "sheet SheetN does not exist" )
3739 // Test add comment on with illegal cell reference
@@ -90,15 +92,13 @@ func TestDeleteComment(t *testing.T) {
9092 assert .NoError (t , f .AddComment ("Sheet2" , Comment {Cell : "A40" , Text : "Excelize: This is a comment1." }))
9193 assert .NoError (t , f .AddComment ("Sheet2" , Comment {Cell : "A41" , Paragraph : []RichTextRun {{Text : "Excelize: " , Font : & Font {Bold : true }}, {Text : "This is a comment2." }}}))
9294 assert .NoError (t , f .AddComment ("Sheet2" , Comment {Cell : "C41" , Paragraph : []RichTextRun {{Text : "Excelize: " , Font : & Font {Bold : true }}, {Text : "This is a comment3." }}}))
93- assert .NoError (t , f .AddComment ("Sheet2" , Comment {Cell : "C41" , Paragraph : []RichTextRun {{Text : "Excelize: " , Font : & Font {Bold : true }}, {Text : "This is a comment3-1." }}}))
9495 assert .NoError (t , f .AddComment ("Sheet2" , Comment {Cell : "C42" , Paragraph : []RichTextRun {{Text : "Excelize: " , Font : & Font {Bold : true }}, {Text : "This is a comment4." }}}))
95- assert .NoError (t , f .AddComment ("Sheet2" , Comment {Cell : "C41" , Paragraph : []RichTextRun {{Text : "Excelize: " , Font : & Font {Bold : true }}, {Text : "This is a comment2." }}}))
9696
9797 assert .NoError (t , f .DeleteComment ("Sheet2" , "A40" ))
9898
9999 comments , err := f .GetComments ("Sheet2" )
100100 assert .NoError (t , err )
101- assert .Len (t , comments , 5 )
101+ assert .Len (t , comments , 3 )
102102
103103 comments , err = NewFile ().GetComments ("Sheet1" )
104104 assert .NoError (t , err )
0 commit comments