1## 
2## This is the file `docstrip_util.test',
3## generated with the SAK utility
4## (sak docstrip/regen).
5## 
6## The original source files were:
7## 
8## tcldocstrip.dtx  (with options: `utiltest')
9## 
10## In other words:
11## **************************************
12## * This Source is not the True Source *
13## **************************************
14## the true source is the file from which this one was generated.
15##
16source [file join [file dirname [file dirname [file join [pwd] [info script]]]] devtools testutilities.tcl]
17testsNeedTcl     8.4
18testsNeedTcltest 1.0
19testing {useLocal docstrip.tcl docstrip}
20set docstrip_sources_dir [localPath {}]
21testing {useLocal docstrip_util.tcl docstrip::util}
22tcltest::testConstraint docstripSourcesAvailable [expr {[
23   file exists [file join $docstrip_sources_dir docstrip.tcl]
24] && [
25   file exists [file join $docstrip_sources_dir tcldocstrip.dtx]
26]}]
27tcltest::test docstrip::util::thefile-1.1 {thefile without args}\
28  -setup {
29   set Fname [tcltest::makeFile [
30      join {
31         {% Just a minor test file.}
32         {puts A}
33         {%<*bar>}
34         {puts B}
35         {%<*foo>}
36         {puts [info exists baz]}
37      } \n
38   ] test.txt]
39} -body {
40   docstrip::util::thefile $Fname
41} -cleanup {
42   tcltest::removeFile $Fname
43} -result [join {
44   {% Just a minor test file.}
45   {puts A}
46   {%<*bar>}
47   {puts B}
48   {%<*foo>}
49   {puts [info exists baz]} ""
50} \n]
51tcltest::test docstrip::util::thefile-1.2 {thefile with wrong no. args}\
52  -setup {
53   set Fname [tcltest::makeFile [
54      join {
55         {% Just a minor test file (contents irrelevant).}
56         {puts A}
57         {%<*bar>}
58         {puts B}
59         {%<*foo>}
60         {puts [info exists baz]}
61      } \n
62   ] test.txt]
63} -body {
64   docstrip::util::thefile $Fname -translation binary -buffering
65} -cleanup {
66   tcltest::removeFile $Fname
67} -returnCodes error
68tcltest::test docstrip::util::thefile-1.3 {thefile with args} -setup {
69   set Fname [tcltest::makeFile "Dummy content to overwrite" test.xxx]
70   set F [open $Fname w]
71   fconfigure $F -translation binary
72   puts -nonewline $F [encoding convertto utf-8 \u00E5\u00E4\u00F6]
73   close $F
74} -body {
75   docstrip::util::thefile $Fname -encoding utf-8
76} -cleanup {
77   tcltest::removeFile $Fname
78} -result \u00E5\u00E4\u00F6
79testsuiteCleanup
80## 
81## 
82## End of file `docstrip_util.test'.