home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / C / Applications / Tcl-Tk 8.0 / Pre-installed version / tcl8.0 / tests / osa.test < prev    next >
Encoding:
Text File  |  1997-08-15  |  1.3 KB  |  37 lines  |  [TEXT/ALFA]

  1. # Commands covered:  AppleScript
  2. #
  3. # This file contains a collection of tests for one or more of the Tcl
  4. # built-in commands.  Sourcing this file into Tcl runs the tests and
  5. # generates output for errors.  No output means no errors were found.
  6. #
  7. # Copyright (c) 1997 Sun Microsystems, Inc.
  8. #
  9. # See the file "license.terms" for information on usage and redistribution
  10. # of this file, and for a DISCLAIMER OF ALL WARRANTIES.
  11. #
  12. # SCCS: @(#) osa.test 1.4 97/06/23 18:24:24
  13.  
  14. if {[string compare test [info procs test]] == 1} then {source defs}
  15.  
  16. # This command only runs on the Macintosh, only run the test if we
  17. # can load the command
  18. if {$tcl_platform(platform) != "macintosh"} {
  19.     puts "skipping: Mac only tests..."
  20.     return
  21. }
  22. if {[info commands AppleScript] == ""} {
  23.     puts "couldn't find AppleScript command..."
  24.     return
  25. }
  26.  
  27. test osa-1.1 {Tcl_OSAComponentCmd} {
  28.     list [catch AppleScript msg] $msg
  29. } {1 {wrong # args: should be "AppleScript option ?arg ...?"}}
  30. test osa-1.2 {Tcl_OSAComponentCmd} {
  31.     list [catch {AppleScript x} msg] $msg
  32. } {1 {bad option "x": should be compile, decompile, delete, execute, info, load, run or store}}
  33.  
  34. test osa-1.3 {TclOSACompileCmd} {
  35.     list [catch {AppleScript compile} msg] $msg
  36. } {1 {wrong # args: should be "AppleScript compile ?options? code"}}
  37.