summaryrefslogtreecommitdiffstats
path: root/tests/pkg.test
diff options
context:
space:
mode:
authorstanton <stanton>1999-03-08 20:14:02 (GMT)
committerstanton <stanton>1999-03-08 20:14:02 (GMT)
commitb825d52a6a6fc13fa86d2dd2b066dbc24ae954be (patch)
tree7ff9d7f16861bf93b582fd332bd79ffe4a8280a8 /tests/pkg.test
parent2efea334f7d59bc5e801dd8d131acd64c4ae7874 (diff)
downloadtcl-b825d52a6a6fc13fa86d2dd2b066dbc24ae954be.zip
tcl-b825d52a6a6fc13fa86d2dd2b066dbc24ae954be.tar.gz
tcl-b825d52a6a6fc13fa86d2dd2b066dbc24ae954be.tar.bz2
First pass at integrating stubs mechanism from 8.0.
Diffstat (limited to 'tests/pkg.test')
-rw-r--r--tests/pkg.test76
1 files changed, 74 insertions, 2 deletions
diff --git a/tests/pkg.test b/tests/pkg.test
index 22b2baa..2fac347 100644
--- a/tests/pkg.test
+++ b/tests/pkg.test
@@ -9,7 +9,7 @@
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# RCS: @(#) $Id: pkg.test,v 1.1.2.2 1998/09/24 23:59:34 stanton Exp $
+# RCS: @(#) $Id: pkg.test,v 1.1.2.2.2.1 1999/03/08 20:14:14 stanton Exp $
if {[string compare test [info procs test]] == 1} then {source defs}
@@ -483,7 +483,7 @@ test pkg-3.52 {Tcl_PackageCmd procedure, "vsatisfies" option} {
} {0}
test pkg-3.53 {Tcl_PackageCmd procedure, "versions" option} {
list [catch {package foo} msg] $msg
-} {1 {bad option "foo": must be forget, ifneeded, names, provide, require, unknown, vcompare, versions, or vsatisfies}}
+} {1 {bad option "foo": must be forget, ifneeded, names, present, provide, require, unknown, vcompare, versions, or vsatisfies}}
# No tests for FindPackage; can't think up anything detectable
# errors.
@@ -555,6 +555,78 @@ test pkg-6.9 {ComparePkgVersions procedure} {
package vsatisfies 2 1
} {0}
+test pkg-7.1 {Tcl_PkgPresent procedure, any version} {
+ package forget t
+ package provide t 2.4
+ package present t
+} {2.4}
+test pkg-7.2 {Tcl_PkgPresent procedure, correct version} {
+ package forget t
+ package provide t 2.4
+ package present t 2.4
+} {2.4}
+test pkg-7.3 {Tcl_PkgPresent procedure, satisfying version} {
+ package forget t
+ package provide t 2.4
+ package present t 2.0
+} {2.4}
+test pkg-7.4 {Tcl_PkgPresent procedure, not satisfying version} {
+ package forget t
+ package provide t 2.4
+ list [catch {package present t 2.6} msg] $msg
+} {1 {version conflict for package "t": have 2.4, need 2.6}}
+test pkg-7.5 {Tcl_PkgPresent procedure, not satisfying version} {
+ package forget t
+ package provide t 2.4
+ list [catch {package present t 1.0} msg] $msg
+} {1 {version conflict for package "t": have 2.4, need 1.0}}
+test pkg-7.6 {Tcl_PkgPresent procedure, exact version} {
+ package forget t
+ package provide t 2.4
+ package present -exact t 2.4
+} {2.4}
+test pkg-7.7 {Tcl_PkgPresent procedure, not exact version} {
+ package forget t
+ package provide t 2.4
+ list [catch {package present -exact t 2.3} msg] $msg
+} {1 {version conflict for package "t": have 2.4, need 2.3}}
+test pkg-7.8 {Tcl_PkgPresent procedure, unknown package} {
+ package forget t
+ list [catch {package present t} msg] $msg
+} {1 {package t is not present}}
+test pkg-7.9 {Tcl_PkgPresent procedure, unknown package} {
+ package forget t
+ list [catch {package present t 2.4} msg] $msg
+} {1 {package t 2.4 is not present}}
+test pkg-7.10 {Tcl_PkgPresent procedure, unknown package} {
+ package forget t
+ list [catch {package present -exact t 2.4} msg] $msg
+} {1 {package t 2.4 is not present}}
+test pkg-7.11 {Tcl_PackageCmd procedure, "present" option} {
+ list [catch {package present} msg] $msg
+} {1 {wrong # args: must be "package present ?-exact? package ?version?"}}
+test pkg-7.12 {Tcl_PackageCmd procedure, "present" option} {
+ list [catch {package present a b c} msg] $msg
+} {1 {wrong # args: must be "package present ?-exact? package ?version?"}}
+test pkg-7.13 {Tcl_PackageCmd procedure, "present" option} {
+ list [catch {package present -exact a b c} msg] $msg
+} {1 {wrong # args: must be "package present ?-exact? package ?version?"}}
+test pkg-7.14 {Tcl_PackageCmd procedure, "present" option} {
+ list [catch {package present -bs a b} msg] $msg
+} {1 {wrong # args: must be "package present ?-exact? package ?version?"}}
+test pkg-7.15 {Tcl_PackageCmd procedure, "present" option} {
+ list [catch {package present x a.b} msg] $msg
+} {1 {expected version number but got "a.b"}}
+test pkg-7.16 {Tcl_PackageCmd procedure, "present" option} {
+ list [catch {package present -exact x a.b} msg] $msg
+} {1 {expected version number but got "a.b"}}
+test pkg-7.17 {Tcl_PackageCmd procedure, "present" option} {
+ list [catch {package present -exact x} msg] $msg
+} {1 {wrong # args: must be "package present ?-exact? package ?version?"}}
+test pkg-7.18 {Tcl_PackageCmd procedure, "present" option} {
+ list [catch {package present -exact} msg] $msg
+} {1 {wrong # args: must be "package present ?-exact? package ?version?"}}
+
set auto_path $oldPath
package unknown $oldPkgUnknown
concat