summaryrefslogtreecommitdiffstats
path: root/tkimg/xpm/tests/xpm.test
blob: 2b7f6a8f7156612b883fd68d707bd6fe0de871ff (plain)
1
2
3
4
5
6
7
8
9
10
11
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
# This file is a Tcl script to test out GIF reading and writing.
# It is organized in the standard fashion for Tcl tests.
#

puts "img::xpm [package require img::xpm]"

set xpmdata \
{/* XPM */
static char * InlineData[] = {
"16 12 3 1",
"  s None c None",
". c #000000",
"# c #f0ff80",
"   ....         ",
"  .####.        ",
" .######.       ",
".............   ",
".###########.   ",
".###########.   ",
".###########.   ",
".###########.   ",
".###########.   ",
".###########.   ",
".###########.   ",
".............   "};}

test xpm-1.1 {} {
    catch {image delete i}
    image create photo i -file [file join $tcltest::testsDirectory folder.xpm]
    i data -format xpm
} $xpmdata
test xpm-1.2 {} {
    catch {image delete i}
    image create photo i -data $xpmdata
    set data [i data -format xpm]
} $xpmdata
test xpm-1.3 {} {
    i blank
    i put $data
    set data [i data -format xpm]
} $xpmdata
test xpm-1.4 {} {
    i blank
    i put $data -format xpm
    set data [i data -format xpm]
} $xpmdata