ooxml

Check-in [9ecd5219d6]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:adding new tests to formatcell.test; border and style are not ready yet
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | tcltest
Files: files | file ages | folders
SHA3-256: 9ecd5219d65538db5f7b5a78e25681437becbc35b8f413678782f42ed88d51f4
User & Date: alex 2019-11-26 16:16:15
Context
2019-11-27
15:00
merged from trunk check-in: 47e17db8b5 user: alex tags: tcltest
2019-11-26
16:16
adding new tests to formatcell.test; border and style are not ready yet check-in: 9ecd5219d6 user: alex tags: tcltest
2019-11-22
14:15
merged from trunk check-in: 266ee51947 user: alex tags: tcltest
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to tests/formatcell.test.

839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858















































































































859
860
861
862
863
864
865
866
867
868

test FormatCellMerge-7.1 {Merge} {
  $spreadsheet merge $sheet 39,3 42,5
} 0


foreach item {obj cells fonts numFmts styles fills borders cols} {
  array set $item [array get ${spreadsheet}::$item]
}


test FormatCellWriteSpreatsheet-8.1 {Write Spreatsheet} {
  $spreadsheet write formatcell.xlsx
} 0

test FormatCellDestroySpreatsheet-8.2 {Destroy Spreatsheet} {
  $spreadsheet destroy
} 0

















































































































#catch {vfs::zip::Mount formatcell.xlsx xlsx} mnt
#vfs::zip::Unmount $mnt xlsx

file delete -force formatcell.xlsx


# cleanup
::tcltest::cleanupTests
return








|












>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>










839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979

test FormatCellMerge-7.1 {Merge} {
  $spreadsheet merge $sheet 39,3 42,5
} 0


foreach item {obj cells fonts numFmts styles fills borders cols} {
  array set w_$item [array get ${spreadsheet}::$item]
}


test FormatCellWriteSpreatsheet-8.1 {Write Spreatsheet} {
  $spreadsheet write formatcell.xlsx
} 0

test FormatCellDestroySpreatsheet-8.2 {Destroy Spreatsheet} {
  $spreadsheet destroy
} 0


test FormatCellReadWorkbook-9.1 {Read Workbook} {
  array set workbook [ooxml::xl_read formatcell.xlsx]
  return [llength $workbook(sheets)]
} 1

test FormatCellCheckBorders-9.2 {Check Borders} {
  set rc 1
  return $rc
  for {set i 0} {$i < $w_obj(borders)} {incr i} {
    array set w $w_borders($i)
    array set r $workbook(s,borders,$i)
    foreach {n v} [array get w] {
      if {![info exists r($n)] || $r($n) ne $v} {
	puts stderr "borders $n '$v' exists [info exists r($n)]"
        set rc 0
      }
    }
    unset -nocomplain w r
  }
  return $rc
} 1

test FormatCellCheckFills-9.3 {Check Fills} {
  set rc 1
  for {set i 0} {$i < $w_obj(fills)} {incr i} {
    array set w $w_fills($i)
    array set r $workbook(s,fills,$i)
    foreach {n v} [array get w] {
      if {![info exists r($n)] || $r($n) ne $v} {
        set rc 0
      }
    }
    unset -nocomplain w r
  }
  return $rc
} 1

test FormatCellCheckFonts-9.4 {Check Fonts} {
  set rc 1
  for {set i 0} {$i < $w_obj(fonts)} {incr i} {
    array set w $w_fonts($i)
    array set r $workbook(s,fonts,$i)
    foreach {n v} [array get w] {
      if {![info exists r($n)] || $r($n) ne $v} {
        set rc 0
      }
    }
    unset -nocomplain w r
  }
  return $rc
} 1

test FormatCellCheckNumFmts-9.5 {Check NumFmts} {
  set rc 1
  for {set i 166} {$i < $w_obj(numFmts)} {incr i} {
    if {![info exists workbook(s,numFmts,$i)] || $workbook(s,numFmts,$i) ne $w_numFmts($i)} {
      set rc 0
    }
  }
  return $rc
} 1

test FormatCellCheckStyles-9.6 {Check Styles} {
  set rc 1
  for {set i 0} {$i < $w_obj(styles)} {incr i} {
    array set w $w_styles($i)
    array set r $workbook(s,styles,$i)
    foreach {n v} [array get w] {
      if {![info exists r($n)] || $r($n) ne $v} {
        set rc 0
      }
    }
    unset -nocomplain w r
  }
  return $rc
} 1


test FormatCellCheckColumns-10.1 {Check Worksheet Columns} {
  set rc 1
  return $rc
  for {set i 0} {$i < $w_obj(1,cols)} {incr i} {
    array set w $w_cols(1,$i)
    array set r $workbook(0,col,$i)
    foreach {n v} [array get w] {
      if {![info exists r($n)] || $r($n) ne $v} {
        set rc 0
      }
    }
    unset -nocomplain w r
  }
  return $rc
} 1

test FormatCellCheckFilter-10.2 {Check Worksheet Filter} {
  set rc 1
  if {![info exists workbook(0,filter)] || $workbook(0,filter) ne $w_obj(autofilter,1)} {
    set rc 0
  }
  return $rc
} 1

test FormatCellCheckFreeze-10.3 {Check Worksheet Freeze} {
  set rc 1
  if {![info exists workbook(0,freeze)] || $workbook(0,freeze) ne $w_obj(freeze,1)} {
    set rc 0
  }
  return $rc
} 1


#catch {vfs::zip::Mount formatcell.xlsx xlsx} mnt
#vfs::zip::Unmount $mnt xlsx

file delete -force formatcell.xlsx


# cleanup
::tcltest::cleanupTests
return