ooxml

Check-in [90da6d6d6d]
Login

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

Overview
Comment:two basic tests
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | tcltest
Files: files | file ages | folders
SHA3-256: 90da6d6d6d407609c3406b82879a0f2af08fe60e40ecc6db842cefc506c21c02
User & Date: alex 2019-11-01 14:06:53
Context
2019-11-04
13:44
save work check-in: 73393cf0b3 user: alex tags: tcltest
2019-11-01
14:06
two basic tests check-in: 90da6d6d6d user: alex tags: tcltest
13:57
save work check-in: dbe69451ea user: alex tags: tcltest
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to tests/simple.test.

12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33






34



35
36
37
38
39
40
if {[lsearch [namespace children] ::tcltest] == -1} {
  package require tcltest 2
  namespace import -force ::tcltest::*
  loadTestedCommands
}


puts [package require ooxml]


test SimpleExcel-1.1 {Write Simple Excel Sheet} {
  set spreadsheet [::ooxml::xl_write new -creator {User A} -created {2019-10-31 15:10:23} -modifiedby {User B} -modified {2019-10-31 15:10:23} -application {Tcl Test}]
  if {[set sheet [$spreadsheet worksheet {Sheet 1}]] > -1} {
    $spreadsheet cell $sheet {Tcl Test - SimpleExcel} -index A1
    $spreadsheet write simple.xlsx
  }
  $spreadsheet destroy

  #set fd [open simple.xlsx rb]
  #set cksum [zlib adler [read $fd]]
  #close $fd
  #set cksum






} 0





# cleanup
::tcltest::cleanupTests
return








|










|
|
<
<
>
>
>
>
>
>
|
>
>
>






12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31


32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
if {[lsearch [namespace children] ::tcltest] == -1} {
  package require tcltest 2
  namespace import -force ::tcltest::*
  loadTestedCommands
}


package require ooxml


test SimpleExcel-1.1 {Write Simple Excel Sheet} {
  set spreadsheet [::ooxml::xl_write new -creator {User A} -created {2019-10-31 15:10:23} -modifiedby {User B} -modified {2019-10-31 15:10:23} -application {Tcl Test}]
  if {[set sheet [$spreadsheet worksheet {Sheet 1}]] > -1} {
    $spreadsheet cell $sheet {Tcl Test - SimpleExcel} -index A1
    $spreadsheet write simple.xlsx
  }
  $spreadsheet destroy

  return [file exists simple.xlsx]
} 1




test SimpleExcel-1.2 {Read Simple Excel Sheet} {
  array set workbook [ooxml::xl_read simple.xlsx]
  #parray workbook
  return $workbook(0,c,0,0)
} A1


file delete -force simple.xlsx


# cleanup
::tcltest::cleanupTests
return