summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorandreas_kupries <akupries@shaw.ca>2007-02-22 19:49:06 (GMT)
committerandreas_kupries <akupries@shaw.ca>2007-02-22 19:49:06 (GMT)
commitc7b7f8149ea5548559856d3e5a2d63af03d863d8 (patch)
tree77d05286a3fc4566d073258a188a4d95056fd1e9 /tests
parent037fc9fc3a7078786cd2a4a034a4f9f10ff396f6 (diff)
downloadtcl-c7b7f8149ea5548559856d3e5a2d63af03d863d8.zip
tcl-c7b7f8149ea5548559856d3e5a2d63af03d863d8.tar.gz
tcl-c7b7f8149ea5548559856d3e5a2d63af03d863d8.tar.bz2
* tests/pkg.test: Added tests for the case of an alpha package
satisfying a require for the regular package, demonstrating a corner case specified in TIP#280. More notes in the comments to the test.
Diffstat (limited to 'tests')
-rw-r--r--tests/pkg.test18
1 files changed, 17 insertions, 1 deletions
diff --git a/tests/pkg.test b/tests/pkg.test
index cde4151..627c08e 100644
--- a/tests/pkg.test
+++ b/tests/pkg.test
@@ -10,7 +10,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.9.12.7 2006/12/05 17:44:44 andreas_kupries Exp $
+# RCS: @(#) $Id: pkg.test,v 1.9.12.8 2007/02/22 19:49:07 andreas_kupries Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest 2
@@ -1013,8 +1013,24 @@ test pkg-7.18 {Tcl_PackageCmd procedure, "present" option} {
} {1 {wrong # args: should be "package present ?-exact? package ?version?"}}
+# Note: It is correct that the result of the very first test,
+# i.e. "5.0 5.01" is 1, i.e. that version 5.0a1 satisifes a 5.0
+# requirement.
+
+# The requirement "5.0" internally translates first to "5.0-6", and
+# then to its final form of "5.0a0-6a0". These translations are
+# explicitly specified by the TIP (Search for "padded/extended
+# internally with 'a0'"). This was done intentionally for exactly the
+# tested case, that an alpha package can satisfy a requirement for the
+# regular package. An example would be a package FOO requiring Tcl 8.X
+# for its operation. It can be used with Tcl 8.Xa0. Without our
+# translation that would not be possible.
+
set n 0
foreach {r p vs vc} {
+ 5.0 5.0a0 1 1
+ 5.0a0 5.0 1 -1
+
8.5a0 8.5a5 1 -1
8.5a0 8.5b1 1 -1
8.5a0 8.5.1 1 -1