(imap4d_test): Added new switches: -literal and -noliteral
Showing
1 changed file
with
21 additions
and
9 deletions
... | @@ -155,6 +155,11 @@ proc imap4d_command { cmd } { | ... | @@ -155,6 +155,11 @@ proc imap4d_command { cmd } { |
155 | return [mu_command [imap4d_make_command $cmd]] | 155 | return [mu_command [imap4d_make_command $cmd]] |
156 | } | 156 | } |
157 | 157 | ||
158 | proc imap4d_uidvalidity {} { | ||
159 | regsub "(\[0-9\]*)\[0-9\]" "[clock seconds]" "\\1\[0-9\]" val | ||
160 | return $val | ||
161 | } | ||
162 | |||
158 | proc imap4d_exit {} { | 163 | proc imap4d_exit {} { |
159 | if [imap4d_test "LOGOUT"\ | 164 | if [imap4d_test "LOGOUT"\ |
160 | "BYE Session terminating." \ | 165 | "BYE Session terminating." \ |
... | @@ -217,17 +222,24 @@ proc imap4d_test { args } { | ... | @@ -217,17 +222,24 @@ proc imap4d_test { args } { |
217 | 222 | ||
218 | if {$len >= 2} { | 223 | if {$len >= 2} { |
219 | set regexp 0 | 224 | set regexp 0 |
225 | set literal 0 | ||
220 | for {set i 1} {$i <= [expr $len - 1]} {incr i} { | 226 | for {set i 1} {$i <= [expr $len - 1]} {incr i} { |
221 | switch -regexp -- "[lindex $args $i]" { | 227 | switch -regexp -- "[lindex $args $i]" { |
222 | -re.*$ - | 228 | ^-re.*$ - |
223 | -- { set item "[lindex $args $i]"; set regexp 1 } | 229 | ^-- { set item "[lindex $args $i]"; set regexp 1 } |
224 | default { if {$regexp} { | 230 | ^-literal { set literal 1; continue } |
225 | set item "\\* [lindex $args $i]" | 231 | ^-noliteral { set literal 0; continue } |
226 | } else { | 232 | default { if {!$literal} { |
227 | set item "* [lindex $args $i]" | 233 | if {$regexp} { |
228 | } | 234 | set item "\\* [lindex $args $i]" |
229 | set regexp 0 | 235 | } else { |
230 | } | 236 | set item "* [lindex $args $i]" |
237 | } | ||
238 | } else { | ||
239 | set item [lindex $args $i] | ||
240 | } | ||
241 | set regexp 0 | ||
242 | } | ||
231 | } | 243 | } |
232 | 244 | ||
233 | set pattern [concat $pattern [list $item]] | 245 | set pattern [concat $pattern [list $item]] | ... | ... |
-
Please register or sign in to post a comment