diff options
Diffstat (limited to 'tkimg/xpm/tests/xpm.test')
-rwxr-xr-x | tkimg/xpm/tests/xpm.test | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/tkimg/xpm/tests/xpm.test b/tkimg/xpm/tests/xpm.test new file mode 100755 index 0000000..2b7f6a8 --- /dev/null +++ b/tkimg/xpm/tests/xpm.test @@ -0,0 +1,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
|