1
# stubs_reader.test -*- tcl -*-
3
# $Id: stubs::reader.test,v 1.8 2010/07/06 19:39:00 andreas_kupries Exp $
5
# -------------------------------------------------------------------------
8
[file dirname [file join [pwd] [info script]]] \
15
useLocal lib/util84/lassign.tcl lassign84
16
useLocal lib/util84/dict.tcl dict84
18
useLocal lib/stubs/container.tcl stubs::container
21
useLocal lib/stubs/reader.tcl stubs::reader
24
# -------------------------------------------------------------------------
27
test stubs-reader-1.0 {file, wrong\#args} -setup {
31
} -returnCodes error -result {wrong # args: should be "stubs::reader::file tablevar path"}
33
test stubs-reader-1.1 {file, wrong\#args} -setup {
37
} -returnCodes error -result {wrong # args: should be "stubs::reader::file tablevar path"}
39
test stubs-reader-1.2 {file, wrong\#args} -setup {
41
stubs::reader::file T x y
43
} -returnCodes error -result {wrong # args: should be "stubs::reader::file tablevar path"}
45
# -------------------------------------------------------------------------
48
test stubs-reader-2.0 {text, wrong\#args} -setup {
52
} -returnCodes error -result {wrong # args: should be "stubs::reader::text tablevar text"}
54
test stubs-reader-2.1 {text, wrong\#args} -setup {
58
} -returnCodes error -result {wrong # args: should be "stubs::reader::text tablevar text"}
60
test stubs-reader-2.2 {text, wrong\#args} -setup {
62
stubs::reader::text T x y
64
} -returnCodes error -result {wrong # args: should be "stubs::reader::text tablevar text"}
66
# -------------------------------------------------------------------------
67
## Representation overview for lots of declarations.
69
test stubs-reader-3.0 {text, empty} -setup {
70
set T [stubs::container::new]
72
stubs::reader::text T {}
73
stubs::container::print $T
76
} -result {stubs UNKNOWN {
82
test stubs-reader-3.1 {text, basic types} -setup {
83
set T [stubs::container::new]
85
stubs::reader::text T {
88
hooks {bufInt memchan}
90
int Buf_IsInitialized (Tcl_Interp *interp)
93
stubs::container::print $T
96
} -result {stubs buf {
101
hooks {bufInt memchan}
103
function Buf_IsInitialized
105
argument {{Tcl_Interp *} interp}
110
test stubs-reader-3.2 {text, void} -setup {
111
set T [stubs::container::new]
113
stubs::reader::text T {
116
hooks {bufInt memchan}
118
int Buf_IsInitialized (void)
121
stubs::container::print $T
124
} -result {stubs buf {
129
hooks {bufInt memchan}
131
function Buf_IsInitialized
138
test stubs-reader-3.3 {text, void via missing arguments} -setup {
139
set T [stubs::container::new]
141
stubs::reader::text T {
144
hooks {bufInt memchan}
146
int Buf_IsInitialized ()
149
stubs::container::print $T
152
} -result {stubs buf {
157
hooks {bufInt memchan}
159
function Buf_IsInitialized
166
test stubs-reader-3.4 {text, var-args function} -setup {
167
set T [stubs::container::new]
169
stubs::reader::text T {
173
void Tcl_Panic(const char *format, ...)
176
stubs::container::print $T
179
} -result {stubs tcl {
189
argument {{const char *} format}
194
test stubs-reader-3.5 {text, array-flag} -setup {
195
set T [stubs::container::new]
197
stubs::reader::text T {
201
Tcl_Obj *Tcl_ConcatObj(int objc, Tcl_Obj *const objv[])
204
stubs::container::print $T
207
} -result {stubs tcl {
214
function Tcl_ConcatObj
217
argument {{Tcl_Obj *const} objv {[]}}
222
# -------------------------------------------------------------------------
228
# indent-tabs-mode: nil