File: pt_peg_export.tests

package info (click to toggle)
tcllib 1.19-dfsg-2
  • links: PTS
  • area: main
  • in suites: buster
  • size: 67,328 kB
  • sloc: tcl: 208,371; ansic: 14,215; sh: 2,846; xml: 1,766; yacc: 1,145; pascal: 583; makefile: 106; perl: 84; f90: 84; python: 33; ruby: 13; php: 11
file content (173 lines) | stat: -rw-r--r-- 5,074 bytes parent folder | download | duplicates (4)
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
# -*- tcl -*-

test pt-peg-export-set:${setimpl}-1.0 {export object, wrong#args} -setup {
    pt::peg::export E
} -body {
    E export object
} -cleanup {
    E destroy
} -returnCodes error -result {wrong # args: should be "::pt::peg::export::Snit_hmethodexport_object type selfns win self obj ?format?"}

test pt-peg-export-set:${setimpl}-1.1 {export object, wrong#args} -setup {
    pt::peg::export E
} -body {
    E export object O F XXX
} -cleanup {
    E destroy
} -returnCodes error -result {wrong # args: should be "::pt::peg::export::Snit_hmethodexport_object type selfns win self obj ?format?"}

test pt-peg-export-set:${setimpl}-2.0 {export serial, wrong#args} -setup {
    pt::peg::export E
} -body {
    E export serial
} -cleanup {
    E destroy
} -returnCodes error -result {wrong # args: should be "::pt::peg::export::Snit_hmethodexport_serial type selfns win self serial ?format?"}

test pt-peg-export-set:${setimpl}-2.1 {export serial, wrong#args} -setup {
    pt::peg::export E
} -body {
    E export serial S F XXX
} -cleanup {
    E destroy
} -returnCodes error -result {wrong # args: should be "::pt::peg::export::Snit_hmethodexport_serial type selfns win self serial ?format?"}

test pt-peg-export-set:${setimpl}-5.0 {configuration names, wrong#args} -setup {
    pt::peg::export E
} -body {
    E configuration names X
} -cleanup {
    E destroy
} -returnCodes error -result {wrong # args: should be "::configuration::Snit_methodnames type selfns win self"}

test pt-peg-export-set:${setimpl}-6.0 {configuration get, wrong#args} -setup {
    pt::peg::export E
} -body {
    E configuration get X
} -cleanup {
    E destroy
} -returnCodes error -result {wrong # args: should be "::configuration::Snit_methodget type selfns win self"}

test pt-peg-export-set:${setimpl}-7.0 {configuration set, wrong#args} -setup {
    pt::peg::export E
} -body {
    E configuration set
} -cleanup {
    E destroy
} -returnCodes error -result {wrong # args: should be "::configuration::Snit_methodset type selfns win self name ?value?"}

test pt-peg-export-set:${setimpl}-7.1 {configuration set, wrong#args} -setup {
    pt::peg::export E
} -body {
    E configuration set N V X
} -cleanup {
    E destroy
} -returnCodes error -result {wrong # args: should be "::configuration::Snit_methodset type selfns win self name ?value?"}

# -------------------------------------------------------------------------

test pt-peg-export-set:${setimpl}-12.0 {configuration set, define single var} -setup {
    pt::peg::export E
} -body {
    E configuration set N V
    E configuration get
} -cleanup {
    E destroy
} -result {N V}

test pt-peg-export-set:${setimpl}-12.1 {configuration set, define multiple vars} -setup {
    pt::peg::export E
} -body {
    E configuration set N V
    E configuration set A B
    dictsort [E configuration get]
} -cleanup {
    E destroy
} -result {A B N V}

test pt-peg-export-set:${setimpl}-12.2 {configuration set, as query} -setup {
    pt::peg::export E
    E configuration set N V
} -body {
    E configuration set N
} -cleanup {
    E destroy
} -result V

test pt-peg-export-set:${setimpl}-13.0 {configuration unset, all} -setup {
    pt::peg::export E
    E configuration set N V
} -body {
    E configuration unset
    E configuration get
} -cleanup {
    E destroy
} -result {}

test pt-peg-export-set:${setimpl}-13.1 {configuration unset, by exact name} -setup {
    pt::peg::export E
    E configuration set N V
    E configuration set A B
} -body {
    E configuration unset N
    E configuration get
} -cleanup {
    E destroy
} -result {A B}

test pt-peg-export-set:${setimpl}-13.2 {configuration unset, by glob pattern} -setup {
    pt::peg::export E
    E configuration set N V
    E configuration set N' V'
    E configuration set A B
} -body {
    E configuration unset N*
    E configuration get
} -cleanup {
    E destroy
} -result {A B}

test pt-peg-export-set:${setimpl}-14.0 {configuration names, empty} -setup {
    pt::peg::export E
} -body {
    E configuration names
} -cleanup {
    E destroy
} -result {}

test pt-peg-export-set:${setimpl}-14.1 {configuration names, with variables} -setup {
    pt::peg::export E
    E configuration set N V
    E configuration set A B
} -body {
    lsort -dict [E configuration names]
} -cleanup {
    E destroy
} -result {A N}

test pt-peg-export-set:${setimpl}-15.0 {configuration get, empty} -setup {
    pt::peg::export E
} -body {
    E configuration get
} -cleanup {
    E destroy
} -result {}

test pt-peg-export-set:${setimpl}-15.1 {configuration get, with variables} -setup {
    pt::peg::export E
    E configuration set N V
    E configuration set A B
} -body {
    dictsort [E configuration get]
} -cleanup {
    E destroy
} -result {A B N V}

# Tests for the various export plugins, i.e. for their use from the
# export manager. Numbering starts at 20.
# -------------------------------------------------------------------------

source [localPath tests/pt_peg_export_plugins.tests]

# -------------------------------------------------------------------------
return