@@ -856,7 +856,7 @@ func TestSetCellRichText(t *testing.T) {
856856 Text : "bold" ,
857857 Font : & Font {
858858 Bold : true ,
859- Color : "2354e8 " ,
859+ Color : "2354E8 " ,
860860 ColorIndexed : 0 ,
861861 Family : "Times New Roman" ,
862862 },
@@ -871,7 +871,7 @@ func TestSetCellRichText(t *testing.T) {
871871 Text : "italic " ,
872872 Font : & Font {
873873 Bold : true ,
874- Color : "e83723 " ,
874+ Color : "E83723 " ,
875875 Italic : true ,
876876 Family : "Times New Roman" ,
877877 },
@@ -880,43 +880,43 @@ func TestSetCellRichText(t *testing.T) {
880880 Text : "text with color and font-family, " ,
881881 Font : & Font {
882882 Bold : true ,
883- Color : "2354e8 " ,
883+ Color : "2354E8 " ,
884884 Family : "Times New Roman" ,
885885 },
886886 },
887887 {
888888 Text : "\r \n large text with " ,
889889 Font : & Font {
890890 Size : 14 ,
891- Color : "ad23e8 " ,
891+ Color : "AD23E8 " ,
892892 },
893893 },
894894 {
895895 Text : "strike" ,
896896 Font : & Font {
897- Color : "e89923 " ,
897+ Color : "E89923 " ,
898898 Strike : true ,
899899 },
900900 },
901901 {
902902 Text : " superscript" ,
903903 Font : & Font {
904- Color : "dbc21f " ,
904+ Color : "DBC21F " ,
905905 VertAlign : "superscript" ,
906906 },
907907 },
908908 {
909909 Text : " and " ,
910910 Font : & Font {
911911 Size : 14 ,
912- Color : "ad23e8 " ,
913- VertAlign : "BASELINE " ,
912+ Color : "AD23E8 " ,
913+ VertAlign : "baseline " ,
914914 },
915915 },
916916 {
917917 Text : "underline" ,
918918 Font : & Font {
919- Color : "23e833 " ,
919+ Color : "23E833 " ,
920920 Underline : "single" ,
921921 },
922922 },
@@ -937,6 +937,11 @@ func TestSetCellRichText(t *testing.T) {
937937 })
938938 assert .NoError (t , err )
939939 assert .NoError (t , f .SetCellStyle ("Sheet1" , "A1" , "A1" , style ))
940+
941+ runs , err := f .GetCellRichText ("Sheet1" , "A1" )
942+ assert .NoError (t , err )
943+ assert .Equal (t , richTextRun , runs )
944+
940945 assert .NoError (t , f .SaveAs (filepath .Join ("test" , "TestSetCellRichText.xlsx" )))
941946 // Test set cell rich text on not exists worksheet
942947 assert .EqualError (t , f .SetCellRichText ("SheetN" , "A1" , richTextRun ), "sheet SheetN does not exist" )
@@ -1153,6 +1158,29 @@ func TestSharedStringsError(t *testing.T) {
11531158 })
11541159}
11551160
1161+ func TestSetCellIntFunc (t * testing.T ) {
1162+ cases := []struct {
1163+ val interface {}
1164+ target string
1165+ }{
1166+ {val : 128 , target : "128" },
1167+ {val : int8 (- 128 ), target : "-128" },
1168+ {val : int16 (- 32768 ), target : "-32768" },
1169+ {val : int32 (- 2147483648 ), target : "-2147483648" },
1170+ {val : int64 (- 9223372036854775808 ), target : "-9223372036854775808" },
1171+ {val : uint (128 ), target : "128" },
1172+ {val : uint8 (255 ), target : "255" },
1173+ {val : uint16 (65535 ), target : "65535" },
1174+ {val : uint32 (4294967295 ), target : "4294967295" },
1175+ {val : uint64 (18446744073709551615 ), target : "18446744073709551615" },
1176+ }
1177+ for _ , c := range cases {
1178+ cell := & xlsxC {}
1179+ setCellIntFunc (cell , c .val )
1180+ assert .Equal (t , c .target , cell .V )
1181+ }
1182+ }
1183+
11561184func TestSIString (t * testing.T ) {
11571185 assert .Empty (t , xlsxSI {}.String ())
11581186}
0 commit comments