(imap4d_test): Added new switches: -literal and -noliteral
Showing
1 changed file
with
15 additions
and
3 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,15 +222,22 @@ proc imap4d_test { args } { | ... | @@ -217,15 +222,22 @@ 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 } |
231 | ^-noliteral { set literal 0; continue } | ||
232 | default { if {!$literal} { | ||
233 | if {$regexp} { | ||
225 | set item "\\* [lindex $args $i]" | 234 | set item "\\* [lindex $args $i]" |
226 | } else { | 235 | } else { |
227 | set item "* [lindex $args $i]" | 236 | set item "* [lindex $args $i]" |
228 | } | 237 | } |
238 | } else { | ||
239 | set item [lindex $args $i] | ||
240 | } | ||
229 | set regexp 0 | 241 | set regexp 0 |
230 | } | 242 | } |
231 | } | 243 | } | ... | ... |
-
Please register or sign in to post a comment