Posted to tcl by kostix at Tue May 27 22:58:44 GMT 2008view raw

  1. proc printerror {script} {
  2. uplevel 1 "if \{\[set code \[catch \{$script\} _msg\]\] == 1\} \{ puts -nonewline stderr \$_msg ; return -code error \} \{set \$_msg\}"
  3. }
  4.  
  5. test ldap-2.0 {check info ip subcommand error handling
  6. } -body {
  7. printerror {ldap::info ip}
  8. } -returnCodes {error} \
  9. -errorOutput {Wrong # of arguments. Usage: ldap::info ip handle}