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 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210
|
# -*- tcl -*-
# idx.test: tests for the doctools::idx package.
#
# Copyright (c) 2009-2019 by Andreas Kupries <andreas_kupries@users.sourceforge.net>
# All rights reserved.
# -------------------------------------------------------------------------
source [file join [
file dirname [file dirname [file join [pwd] [info script]]
]] devtools testutilities.tcl]
testsNeedTcl 8.4
testsNeedTcltest 2
support {
use fileutil/fileutil.tcl fileutil ;# tests/common
use struct/list.tcl struct::list
use snit/snit.tcl snit
use log/logger.tcl logger
use pluginmgr/pluginmgr.tcl pluginmgr
use struct/map.tcl struct::map
useLocal structure.tcl doctools::idx::structure
use doctools2base/nroff_manmacros.tcl doctools::nroff::man_macros
source [tcllibPath doctools2base/tests/common]
}
testing {
useLocalKeep export.tcl doctools::idx::export
}
# -------------------------------------------------------------------------
setup_plugins
# -------------------------------------------------------------------------
test doctools-idx-export-1.0 {export object, wrong#args} -setup {
doctools::idx::export E
} -body {
E export object
} -cleanup {
E destroy
} -returnCodes error -result {wrong # args: should be "::doctools::idx::export::Snit_hmethodexport_object type selfns win self obj ?format?"}
test doctools-idx-export-1.1 {export object, wrong#args} -setup {
doctools::idx::export E
} -body {
E export object O F XXX
} -cleanup {
E destroy
} -returnCodes error -result {wrong # args: should be "::doctools::idx::export::Snit_hmethodexport_object type selfns win self obj ?format?"}
test doctools-idx-export-2.0 {export serial, wrong#args} -setup {
doctools::idx::export E
} -body {
E export serial
} -cleanup {
E destroy
} -returnCodes error -result {wrong # args: should be "::doctools::idx::export::Snit_hmethodexport_serial type selfns win self serial ?format?"}
test doctools-idx-export-2.1 {export serial, wrong#args} -setup {
doctools::idx::export E
} -body {
E export serial S F XXX
} -cleanup {
E destroy
} -returnCodes error -result {wrong # args: should be "::doctools::idx::export::Snit_hmethodexport_serial type selfns win self serial ?format?"}
test doctools-idx-export-5.0 {config names, wrong#args} -setup {
doctools::idx::export E
} -body {
E config names X
} -cleanup {
E destroy
} -returnCodes error -result {wrong # args: should be "::struct::map::I::Snit_methodnames type selfns win self"}
test doctools-idx-export-6.0 {config get, wrong#args} -setup {
doctools::idx::export E
} -body {
E config get X
} -cleanup {
E destroy
} -returnCodes error -result {wrong # args: should be "::struct::map::I::Snit_methodget type selfns win self"}
test doctools-idx-export-7.0 {config set, wrong#args} -setup {
doctools::idx::export E
} -body {
E config set
} -cleanup {
E destroy
} -returnCodes error -result {wrong # args: should be "::struct::map::I::Snit_methodset type selfns win self name ?value?"}
test doctools-idx-export-7.1 {config set, wrong#args} -setup {
doctools::idx::export E
} -body {
E config set N V X
} -cleanup {
E destroy
} -returnCodes error -result {wrong # args: should be "::struct::map::I::Snit_methodset type selfns win self name ?value?"}
# -------------------------------------------------------------------------
test doctools-idx-export-12.0 {config set, define single var} -setup {
doctools::idx::export E
} -body {
E config set N V
E config get
} -cleanup {
E destroy
} -result {N V}
test doctools-idx-export-12.1 {config set, define multiple vars} -setup {
doctools::idx::export E
} -body {
E config set N V
E config set A B
dictsort [E config get]
} -cleanup {
E destroy
} -result {A B N V}
test doctools-idx-export-12.2 {config set, as query} -setup {
doctools::idx::export E
E config set N V
} -body {
E config set N
} -cleanup {
E destroy
} -result V
test doctools-idx-export-13.0 {config unset, all} -setup {
doctools::idx::export E
E config set N V
} -body {
E config unset
E config get
} -cleanup {
E destroy
} -result {}
test doctools-idx-export-13.1 {config unset, by exact name} -setup {
doctools::idx::export E
E config set N V
E config set A B
} -body {
E config unset N
E config get
} -cleanup {
E destroy
} -result {A B}
test doctools-idx-export-13.2 {config unset, by glob pattern} -setup {
doctools::idx::export E
E config set N V
E config set N' V'
E config set A B
} -body {
E config unset N*
E config get
} -cleanup {
E destroy
} -result {A B}
test doctools-idx-export-14.0 {config names, empty} -setup {
doctools::idx::export E
} -body {
E config names
} -cleanup {
E destroy
} -result {}
test doctools-idx-export-14.1 {config names, with variables} -setup {
doctools::idx::export E
E config set N V
E config set A B
} -body {
lsort -dict [E config names]
} -cleanup {
E destroy
} -result {A N}
test doctools-idx-export-15.0 {config get, empty} -setup {
doctools::idx::export E
} -body {
E config get
} -cleanup {
E destroy
} -result {}
test doctools-idx-export-15.1 {config get, with variables} -setup {
doctools::idx::export E
E config set N V
E config set A B
} -body {
dictsort [E config get]
} -cleanup {
E destroy
} -result {A B N V}
# idx_export tests, numbering starts at 20
# -------------------------------------------------------------------------
source [localPath tests/export]
# -------------------------------------------------------------------------
testsuiteCleanup
return
|